Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.2.0: Implement generated user impersonation #38

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

david-r-cox
Copy link
Member

This PR implements user generation for KeyHippo.

The new feature allows administrators to create test users quickly and easily, which can then be used with the existing impersonation system.
Main changes:

  • Implemented keyhippo_impersonation.generate_random_user_data() function to create random user data
  • Created keyhippo_impersonation.generate_new_user() function to insert new test users into auth.users

Integration with existing impersonation features:

  1. Generate a new test user:

    SELECT keyhippo_impersonation.generate_new_user();

    This returns a new user_id.

  2. Impersonate the newly created user:

    CALL keyhippo_impersonation.login_as_user(new_user_id);
  3. Perform actions as the impersonated user

  4. End the impersonation session:

    CALL keyhippo_impersonation.logout();

This workflow allows administrators to quickly create test users with varied attributes and immediately impersonate them, facilitating thorough testing of user-specific features and permissions.

Mega Launch Week day 4!

@david-r-cox david-r-cox merged commit ee6c98b into main Dec 5, 2024
14 checks passed
@david-r-cox david-r-cox deleted the random-user-generation branch December 5, 2024 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant