Check out v4 of the Fauna CLI
v4 of the Fauna CLI is now in beta. The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start. |
AccessProvider.all()
Learn: Access providers |
---|
Get a Set of all access providers.
Signature
AccessProvider.all() => Set<AccessProvider>
AccessProvider.all(range: { from: Any } | { to: Any } | { from: Any, to: Any }) => Set<AccessProvider>
Description
Gets a Set containing all
AccessProvider
documents in the database. To limit the returned Set, you can provide an
optional range.
AccessProvider
documents are FQL versions of a database’s FSL
access provider schema.
AccessProvider
documents have the AccessProvider type. See
Access providers.
If this method is the last expression in a query, the first page of the Set is returned. See Pagination.
Staged schema
If a database has staged schema, this method interacts with the database’s staged schema, not the active schema.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
range |
|
Specifies a range of The Set only includes documents in this range (inclusive). Omit If a range is omitted, all access providers are returned. |
Range parameters
Name | Type | Required | Description |
---|---|---|---|
|
Beginning of the range (inclusive). Must be an
|
||
|
End of the range (inclusive). Must be an
|
Return value
Type | Description |
---|---|
Set of The Set is empty if:
|
Examples
Range examples
-
Get all access providers for the database:
AccessProvider.all()
{ data: [ { name: "issuerFoo", coll: AccessProvider, ts: Time("2099-06-25T14:57:23.125Z"), ... issuer: "https://example.com/a", audience: "https://db.fauna.com/db/ysjowue14yyr1", jwks_uri: "https://example.com/a/.well-known/jwks.json" }, { name: "issuerBaz", coll: AccessProvider, ts: Time("2099-06-25T14:57:23.125Z"), ... issuer: "https://example.com/b", audience: "https://db.fauna.com/db/ysjowue14yyr1", jwks_uri: "https://example.com/b/.well-known/jwks.json" }, { name: "issuerBar", coll: AccessProvider, ts: Time("2099-06-25T14:57:23.125Z"), ... issuer: "https://example.com/c", audience: "https://db.fauna.com/db/ysjowue14yyr1", jwks_uri: "https://example.com/c/.well-known/jwks.json" }, { name: "issuerQux", coll: AccessProvider, ts: Time("2099-06-25T14:57:23.125Z"), ... issuer: "https://example.com/d", audience: "https://db.fauna.com/db/ysjowue14yyr1", jwks_uri: "https://example.com/d/.well-known/jwks.json" }, ... ] }
-
Given the previous Set, get all access providers starting with
issuerBaz
(inclusive):AccessProvider.all({ from: AccessProvider.byName("issuerBaz") })
{ data: [ { name: "issuerBaz", coll: AccessProvider, ts: Time("2099-06-25T14:57:23.125Z"), ... issuer: "https://example.com/b", audience: "https://db.fauna.com/db/ysjowue14yyr1", jwks_uri: "https://example.com/b/.well-known/jwks.json" }, { name: "issuerBar", coll: AccessProvider, ts: Time("2099-06-25T14:57:23.125Z"), ... issuer: "https://example.com/c", audience: "https://db.fauna.com/db/ysjowue14yyr1", jwks_uri: "https://example.com/c/.well-known/jwks.json" }, { name: "issuerQux", coll: AccessProvider, ts: Time("2099-06-25T14:57:23.125Z"), ... issuer: "https://example.com/d", audience: "https://db.fauna.com/db/ysjowue14yyr1", jwks_uri: "https://example.com/d/.well-known/jwks.json" }, ... ] }
-
Get a Set of access providers from
issuerBaz
(inclusive) toissuerBar
(inclusive):AccessProvider.all({ from: AccessProvider.byName("issuerBaz"), to: AccessProvider.byName("issuerBar") })
{ data: [ { name: "issuerBaz", coll: AccessProvider, ts: Time("2099-06-25T14:57:23.125Z"), ... issuer: "https://example.com/b", audience: "https://db.fauna.com/db/ysjowue14yyr1", jwks_uri: "https://example.com/b/.well-known/jwks.json" }, { name: "issuerBar", coll: AccessProvider, ts: Time("2099-06-25T14:57:23.125Z"), ... issuer: "https://example.com/bc", audience: "https://db.fauna.com/db/ysjowue14yyr1", jwks_uri: "https://example.com/c/.well-known/jwks.json" } ] }
-
Get a Set of access providers up to
issuerBar
(inclusive):AccessProvider.all({ to: AccessProvider.byName("issuerBar") })
{ data: [ { name: "issuerFoo", coll: AccessProvider, ts: Time("2099-06-25T14:57:23.125Z"), ... issuer: "https://example.com/a", audience: "https://db.fauna.com/db/ysjowue14yyr1", jwks_uri: "https://example.com/a/.well-known/jwks.json" }, { name: "issuerBaz", coll: AccessProvider, ts: Time("2099-06-25T14:57:23.125Z"), ... issuer: "https://example.com/b", audience: "https://db.fauna.com/db/ysjowue14yyr1", jwks_uri: "https://example.com/b/.well-known/jwks.json" }, { name: "issuerBar", coll: AccessProvider, ts: Time("2099-06-25T14:57:23.125Z"), ... issuer: "https://example.com/c", audience: "https://db.fauna.com/db/ysjowue14yyr1", jwks_uri: "https://example.com/c/.well-known/jwks.json" } ] }
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!