KeyFromSecret
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
KeyFromSecret( secret )
Description
The KeyFromSecret
function retrieves a key document given a key’s
secret string, or a token document given a token’s secret string.
If the key belongs to a parent database, that key document
cannot be retrieved; KeyFromSecret behaves as if the key does
not exist.
|
Parameter
Parameter | Type | Definition and Requirements |
---|---|---|
|
String |
The secret identifying an existing key or token. |
Returns
An object containing data returned by performing a lookup for the secret. If the secret does not match an existing key or token (in the current database or a child database), an error is returned.
When the secret string identifies a key, the object has the following fields:
Field Name | Field Type | Definition and Requirements |
---|---|---|
|
Reference |
The reference identifies the key that was retrieved. |
|
Long |
The timestamp, with microsecond resolution, reporting the most recent modification time of the key. |
|
Reference |
A reference to the database the key is protecting. The reference could refer to a child or deeply nested database, depending on where the key was created. |
|
String |
The security role for this key. |
|
String |
The hash of the secret. |
When the secret string identifies a token, the object has the following fields:
Field Name | Field Type | Definition and Requirements |
---|---|---|
|
Reference |
The reference identifies the token instance that was retrieved. |
|
Integer |
The timestamp, with microsecond resolution, reporting the most recent modification of the token. |
|
Reference |
A reference to the document representing the logged-in user (the one
passed to the |
|
String |
A hash of the secret. The secret is not recoverable from this value. |