Skip to content

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.

2 participants