test__auth#

Do realistic testing of user authentication.

These tests require:

  1. AWS Cognito

  • A User Pool is spun up

  • An app/web client is registered for that user pool

  1. Config

  • The rootski-config.yml file must be configured with the AWS Cognito values

  1. The AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env vars need to be set for an IAM user with admin access to the configured user pool




Functions#

config

confirm_user_email

Confirm a user's email address.

delete_cognito_user

jwt_id_token

register_cognito_user

raises ClientError

if the user can't be signed up; for example, the user may already exist or the app_client_id could be wrong

sign_in_user

test__auth_service

config()#

tests.functional_tests.services.test__auth.config() rootski.config.config.Config[source]#

confirm_user_email()#

tests.functional_tests.services.test__auth.confirm_user_email(user_pool_id: str, username: str)[source]#

Confirm a user’s email address. For rootski, the username is their email.

delete_cognito_user()#

tests.functional_tests.services.test__auth.delete_cognito_user(user_pool_id: str, email: str)[source]#

jwt_id_token()#

tests.functional_tests.services.test__auth.jwt_id_token(config: rootski.config.config.Config) str[source]#

register_cognito_user()#

tests.functional_tests.services.test__auth.register_cognito_user(email: str, password: str, app_client_id: str)[source]#
Raises

ClientError – if the user can’t be signed up; for example, the user may already exist or the app_client_id could be wrong

sign_in_user()#

tests.functional_tests.services.test__auth.sign_in_user(email: str, password: str, user_pool_id: str, app_client_id: str) Tuple[str, str, str][source]#

test__auth_service()#

tests.functional_tests.services.test__auth.test__auth_service(config: rootski.config.config.Config, jwt_id_token: str)[source]#