(self)
| 955 | assert auth_token.audit_log_data == token.get_audit_log_data() |
| 956 | |
| 957 | def test_api_keys(self) -> None: |
| 958 | ak = self.create_api_key(organization=self.organization, scope_list=["projects:read"]) |
| 959 | with assume_test_silo_mode(SiloMode.CELL): |
| 960 | akr = ApiKeyReplica.objects.get(apikey_id=ak.id) |
| 961 | |
| 962 | for token in [ak, akr]: |
| 963 | auth_token = AuthenticatedToken.from_token(token) |
| 964 | |
| 965 | assert auth_token is not None |
| 966 | assert auth_token.entity_id == ak.id |
| 967 | assert auth_token.user_id is None |
| 968 | assert is_api_key_auth(token) and is_api_key_auth(auth_token) |
| 969 | assert auth_token.organization_id == self.organization.id |
| 970 | assert auth_token.application_id is None |
| 971 | assert auth_token.allowed_origins == token.get_allowed_origins() |
| 972 | assert auth_token.scopes == token.get_scopes() |
| 973 | assert auth_token.audit_log_data == token.get_audit_log_data() |
| 974 | |
| 975 | def test_org_auth_tokens(self) -> None: |
| 976 | oat = OrgAuthToken.objects.create( |
nothing calls this directly
no test coverage detected