-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: align realm claims with profiles
Refactor realm claims to align with PSA token profile definitions and to allow them to be potentially extended in an analogous way via CCA profiles. - Use psatoken.IClaimsBase to define realm.IClaims. This exposes operations common to all claims objects, namely marshalling and validation. - Expose previously internal realm.validate() as realm.ValidateClaims(). This will help with implementing profiles that do not embed the original claims structure. - Expose individual claim field validators and rename them from isValidXXX (which implies a boolean return) to ValidateXXX. This will be useful if, e.g., client code wants to make sure a hash is a valid realm challenge without needing a claims structure. - Reuse errors defined inside psatoken, rather then re-defining them for realm claims. Errors such as "syntax error" or "missing mandatory claims" are in effect part of the generic IClaimsBase interface (i.e. common to all profile-able claims objects). - Do not use json tags inside error messages, as they may be different for profiles that implement their own claims without embedding existing ones. - Some minor stylistic tidying (consistent spacing, etc). Signed-off-by: Sergei Trofimov <[email protected]>
- Loading branch information
Showing
6 changed files
with
99 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.