AccessProvider.firstWhere()
Get the first matching accessible AccessProvider.
Signature
Collection.firstWhere(predicate: () => Boolean)): AccessProvider | NullAccessProvider
Collection.firstWhere(predicate: (val: AccessProvider) => Boolean)): AccessProvider | NullAccessProvider
Description
Each access provider document in a Fauna database is in the AccessProvider
collection. This method returns the first accessible provider that
matches the predicate function.
Parameters
Return value
One of:
Type | Description |
---|---|
First accessible document matching the predicate function. |
|
When no provides match the predicate function or all matching providers are inaccessible. |
Examples
{
name: "newAccesProvider",
coll: AccessProvider,
ts: Time("2023-07-28T03:49:22.120Z"),
issuer: "https://fauna.auth2.com",
audience: "https://db.fauna.com/db/ywtfhw4poyynr",
roles: [
"mgmtTeam",
{
role: "mgmtTeam",
predicate: "_ => true"
}
],
jwks_uri: "https://fauna.auth0.com/.well-known/jwks.json",
data: {
custom: "some data"
}
}
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!