-
Notifications
You must be signed in to change notification settings - Fork 0
Application Keys
Billcountry Mwaniki edited this page Aug 30, 2020
·
1 revision
Application Keys are used to authorize ops from API/RPC requests. Application Keys are immutable and hold permissions less than or equal to those of the user who created them. Keys can have multiple tokens and a token can be removed or all tokens invalidated by invalidating a key.
-
KeyIdprimitive.ObjectId -
AppUserIdprimitive.ObjectIdThe user who created the key -
ApplicationIdprimitive.ObjectIdThe application the key belongs to. We can get the same from a user but it's one less database call -
Permissions[]uint8A list of permissions this key can access. You can get values of permissions from Users -
Statusuint8Status of the app including-
Active: 0 -
Revoked: 1 -
Archived: 2
-
-
Tokens[]TokenA list of JWT tokens that can be used to authorize as this key. A Token has the structure below:-
Idprimitive.ObjectIdUnique identifier to a token -
Issuedint64Unix timestamp of when the token was issued -
Expiryint64Unix timestamp of when the token expires
-
-
CreatedTime
Creates a new token, adds it to the Tokens list and returns a JWT token string that can be used to authorize the key.
Check if a token has a specific key. This should be used to reject deleted tokens.