Skip to content

Refactor API key creator realm check  #52511

@ywangd

Description

@ywangd

The current methods for checking API key creator realm (ApiKeyService#getCreatorRealmXxx) can be improved by:

  • Use sourceRealm instead authenticatedBy so lookedUp is always in effect (if there is one).
    Right now this does not cause real problem since API key cannot impersonate another key.
    But it is better to be consistent with other checks and be future proof.
  • Test for AuthenticateType is better done using Enum instead of string comparison.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions