MMO\oauth
MMO\oauth · 23 symbols · generated 5 Oct 2026
b64UrlDecode
functions.php:297Decode a string with URL-safe Base64.
- Namespace
MMO\oauth
Call graph
b64UrlEncode
functions.php:288Encode a string with URL-safe Base64.
- Namespace
MMO\oauth
contentScopeID
functions.php:98- Namespace
MMO\oauth
decodeDER
functions.php:402Reads binary DER-encoded data and decodes into a single object
- Namespace
MMO\oauth
| $der | string | the binary data in DER format |
| returns | mixed | $data the decoded objects or null if nothing was found |
Call graph
Uses (1)
DERtoSignature
functions.php:473Encodes signature from a DER object.
- Namespace
MMO\oauth
| $der | string | binary signature in DER format |
| $keySize | int | the number of bits in the key |
| returns | string | the signature |
Call graph
Uses (1)
encodeDER
functions.php:359Encodes a value into a DER object.
- Namespace
MMO\oauth
| $value | mixed | the value to encode |
| $type = null | null | int | DER tag. if null, figure out the type from the value's type. |
| returns | string | the encoded object |
Call graph
encodeDERLength
functions.php:346DER-encode the length
- Namespace
MMO\oauth
Call graph
Used by (2)
entityScopeID
functions.php:74- Namespace
MMO\oauth
| $value = null | iRepository | iCollection | iEntity | null | |
| $action = '' | string | |
| returns | string |
generateKeys
functions.php:226Generate a private/public key pair using openssl sha512
- Namespace
MMO\oauth
getCSRFToken
functions.php:254Create a CRSF token
- Namespace
MMO\oauth
| $key | string | the session's key to save crsf token in |
| $privateKey = null | null | iPrivateKey | |
| returns | string | the csrf signature |
Call graph
Uses (2)
Used by (1)
GUIDv4
functions.php:322Generate valid version 4 UUIDS This function can serve to generate API keys
- Namespace
MMO\oauth
isAllAllowed
functions.php:171Test if all scopes are allowed Scopes expressed as string can be a list of scope's uid seperated by a space: each of them must be allowed too, as an OAuth2 scope parameter means.
- Namespace
MMO\oauth
isAllowed
functions.php:123Test if scope is allowed To compare two scopes, we look for any scopes containing the given one or one of its subset.
- Namespace
MMO\oauth
| $scopes | array | the current scopes |
| $uid | string | the scope's name |
| $default = false | null | bool | |
| $realUid = null | null | string | |
| returns | null | bool |
Call graph
Used by (22)
- tClient::blameOwnScope
- tClient::hasScope
- tUser::blameOwnScope
- tUser::hasScope
- tWithRoles::blameOwnScope
- tWithRoles::hasScope
- tWithScopes::blameScope
- tWithScopes::hasScope
- AccessController::hasUserScope
- AuthCode::blameScope
- AuthCode::hasScope
- Client::blameOwnScope
- Client::hasScope
- Role::blameScope
- Role::hasScope
- User::blameOwnScope
- User::hasScope
- GoogleUser::blameOwnScope
- GoogleUser::hasScope
- isAllAllowed
- isUserAllowed
- mergeScopes
isAnyAllowed
functions.php:154Test if at least one scope is allowed Scopes expressed as string can be a list of scope's uid seperated by a space (in this case, all scopes MUST be allowed).
- Namespace
MMO\oauth
| $scopes | array | array<uid: ?bool> |
| ...$uids | object | string | the scopes to test for |
| returns | bool | true when no scope is asked for |
isUserAllowed
functions.php:41- Namespace
MMO\oauth
logout
functions.php:22- Namespace
MMO\oauth
| returns | void |
Call graph
Uses (2)
Used by (1)
mergeScopes
functions.php:207Merge scopes into source.
- Namespace
MMO\oauth
| $source | array | scopes to merge into |
| $scopes | array | list of {scope:uid} => {allow:bool} |
| $set = false | bool | table rule to merge |
| returns | array |
Call graph
Uses (1)
Used by (15)
randomBytes
functions.php:312Generate a unique identifier in hexadecimal
- Namespace
MMO\oauth
| $length = null | null | int | the length in bytes. If null use the default length set in the package's config |
| $raw = false | bool | if true, don't encode in hexadecimal |
| returns | string | hexadecimal string |
Call graph
scopeID
functions.php:60Get the scope id for a given object
- Namespace
MMO\oauth
setUser
functions.php:37- Namespace
MMO\oauth
signatureToDER
functions.php:450Convert an ECDSA signature to an ASN.1 DER sequence
- Namespace
MMO\oauth
Call graph
Uses (1)
Used by (1)
user
functions.php:33Get current user set in the route This function MUST be called after middleware CurrentUser has been triggered.
- Namespace
MMO\oauth
validateCSRFToken
functions.php:268Validate a CRSF token
- Namespace
MMO\oauth
| $key | string | the session's key to save crsf token in |
| $signature | string | the csrf signature |
| $publicKey = null | null | iPublicKey | a public key to verify the signature of the token |
| $clear = true | bool | if true, clear the crsf token from the session |
| returns | bool |