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.byName()

Learn: Access providers

Get an access provider by its name.

Signature

AccessProvider.byName(name: String) => NamedRef<AccessProvider>

Description

Gets an access provider, represented as an AccessProvider document, by its name.

AccessProvider documents are FQL versions of a database’s FSL access provider schema. AccessProvider documents have the AccessProvider type. See Access providers.

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

name

String

true

name of the AccessProvider document to retrieve.

Return value

Type Description

NamedRef<AccessProvider>

Resolved reference to the AccessProvider document. Can resolve to an existing document or a NullDoc.

Examples

AccessProvider.byName("someIssuer")
{
  name: "someIssuer",
  coll: AccessProvider,
  ts: Time("2099-06-25T14:57:23.125Z"),
  roles: [
    "customer",
    {
      role: "manager",
      predicate: "(jwt) => jwt!.scope.includes(\"manager\")"
    }
  ],
  issuer: "https://example.com/",
  jwks_uri: "https://example.com/.well-known/jwks.json",
  audience: "https://db.fauna.com/db/ysjowue14yyr1"
}

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!