We announced the upcoming end-of-support for AWS SDK for JavaScript v2.
We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Class: AWS.VerifiedPermissions

Inherits:
AWS.Service show all
Identifier:
verifiedpermissions
API Version:
2021-12-01
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

Amazon Verified Permissions is a permissions management service from Amazon Web Services. You can use Verified Permissions to manage permissions for your application, and authorize user access based on those permissions. Using Verified Permissions, application developers can grant access based on information about the users, resources, and requested actions. You can also evaluate additional information like group membership, attributes of the resources, and session context, such as time of request and IP addresses. Verified Permissions manages these permissions by letting you create and store authorization policies for your applications, such as consumer-facing web sites and enterprise business systems.

Verified Permissions uses Cedar as the policy language to express your permission requirements. Cedar supports both role-based access control (RBAC) and attribute-based access control (ABAC) authorization models.

For more information about configuring, administering, and using Amazon Verified Permissions in your applications, see the Amazon Verified Permissions User Guide.

For more information about the Cedar policy language, see the Cedar Policy Language Guide.

When you write Cedar policies that reference principals, resources and actions, you can define the unique identifiers used for each of those elements. We strongly recommend that you follow these best practices:

  • Use values like universally unique identifiers (UUIDs) for all principal and resource identifiers.

    For example, if user jane leaves the company, and you later let someone else use the name jane, then that new user automatically gets access to everything granted by policies that still reference User::"jane". Cedar can’t distinguish between the new user and the old. This applies to both principal and resource identifiers. Always use identifiers that are guaranteed unique and never reused to ensure that you don’t unintentionally grant access because of the presence of an old identifier in a policy.

    Where you use a UUID for an entity, we recommend that you follow it with the // comment specifier and the ‘friendly’ name of your entity. This helps to make your policies easier to understand. For example: principal == User::"a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111", // alice

  • Do not include personally identifying, confidential, or sensitive information as part of the unique identifier for your principals or resources. These identifiers are included in log entries shared in CloudTrail trails.

Several operations return structures that appear similar, but have different purposes. As new functionality is added to the product, the structure used in a parameter of one operation might need to change in a way that wouldn't make sense for the same parameter in a different operation. To help you understand the purpose of each, the following naming convention is used for the structures:

  • Parameter type structures that end in Detail are used in Get operations.

  • Parameter type structures that end in Item are used in List operations.

  • Parameter type structures that use neither suffix are used in the mutating (create and update) operations.

Sending a Request Using VerifiedPermissions

var verifiedpermissions = new AWS.VerifiedPermissions();
verifiedpermissions.batchIsAuthorized(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the VerifiedPermissions object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var verifiedpermissions = new AWS.VerifiedPermissions({apiVersion: '2021-12-01'});

You can also set the API version globally in AWS.config.apiVersions using the verifiedpermissions service identifier:

AWS.config.apiVersions = {
  verifiedpermissions: '2021-12-01',
  // other service API versions
};

var verifiedpermissions = new AWS.VerifiedPermissions();

Version:

  • 2021-12-01

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, setupRequestListeners, defineService

Constructor Details

new AWS.VerifiedPermissions(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a VerifiedPermissions object

var verifiedpermissions = new AWS.VerifiedPermissions({apiVersion: '2021-12-01'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String|AWS.Endpoint)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.VerifiedPermissions.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.VerifiedPermissions.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.VerifiedPermissions.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

  • useFipsEndpoint (Boolean)

    Enables FIPS compatible endpoints. Defaults to false.

  • useDualstackEndpoint (Boolean)

    Enables IPv6 dualstack endpoint. Defaults to false.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

batchIsAuthorized(params = {}, callback) ⇒ AWS.Request

Makes a series of decisions about multiple authorization requests for one principal or resource. Each request contains the equivalent content of an IsAuthorized request: principal, action, resource, and context. Either the principal or the resource parameter must be identical across all requests. For example, Verified Permissions won't evaluate a pair of requests where bob views photo1 and alice views photo2. Authorization of bob to view photo1 and photo2, or bob and alice to view photo1, are valid batches.

The request is evaluated against all policies in the specified policy store that match the entities that you declare. The result of the decisions is a series of Allow or Deny responses, along with the IDs of the policies that produced each decision.

The entities of a BatchIsAuthorized API request can contain up to 100 principals and up to 100 resources. The requests of a BatchIsAuthorized API request can contain up to 30 requests.

Note: The BatchIsAuthorized operation doesn't have its own IAM permission. To authorize this operation for Amazon Web Services principals, include the permission verifiedpermissions:IsAuthorized in their IAM policies.

Service Reference:

Examples:

Calling the batchIsAuthorized operation

var params = {
  policyStoreId: 'STRING_VALUE', /* required */
  requests: [ /* required */
    {
      action: {
        actionId: 'STRING_VALUE', /* required */
        actionType: 'STRING_VALUE' /* required */
      },
      context: {
        contextMap: {
          '<String>': { /* AttributeValue */
            boolean: true || false,
            entityIdentifier: {
              entityId: 'STRING_VALUE', /* required */
              entityType: 'STRING_VALUE' /* required */
            },
            long: 'NUMBER_VALUE',
            record: {
              '<String>': /* recursive AttributeValue */,
              /* '<String>': ... */
            },
            set: [
              /* recursive AttributeValue */,
              /* more items */
            ],
            string: 'STRING_VALUE'
          },
          /* '<String>': ... */
        }
      },
      principal: {
        entityId: 'STRING_VALUE', /* required */
        entityType: 'STRING_VALUE' /* required */
      },
      resource: {
        entityId: 'STRING_VALUE', /* required */
        entityType: 'STRING_VALUE' /* required */
      }
    },
    /* more items */
  ],
  entities: {
    entityList: [
      {
        identifier: { /* required */
          entityId: 'STRING_VALUE', /* required */
          entityType: 'STRING_VALUE' /* required */
        },
        attributes: {
          '<String>': { /* AttributeValue */
            boolean: true || false,
            entityIdentifier: {
              entityId: 'STRING_VALUE', /* required */
              entityType: 'STRING_VALUE' /* required */
            },
            long: 'NUMBER_VALUE',
            record: {
              '<String>': /* recursive AttributeValue */,
              /* '<String>': ... */
            },
            set: [
              /* recursive AttributeValue */,
              /* more items */
            ],
            string: 'STRING_VALUE'
          },
          /* '<String>': ... */
        },
        parents: [
          {
            entityId: 'STRING_VALUE', /* required */
            entityType: 'STRING_VALUE' /* required */
          },
          /* more items */
        ]
      },
      /* more items */
    ]
  }
};
verifiedpermissions.batchIsAuthorized(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store. Policies in this policy store will be used to make the authorization decisions for the input.

    • entities — (map)

      Specifies the list of resources and principals and their associated attributes that Verified Permissions can examine when evaluating the policies.

      Note: You can include only principal and resource entities in this parameter; you can't include actions. You must specify actions in the schema.
      • entityList — (Array<map>)

        An array of entities that are needed to successfully evaluate an authorization request. Each entity in this array must include an identifier for the entity, the attributes of the entity, and a list of any parent entities.

        • identifierrequired — (map)

          The identifier of the entity.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

        • attributes — (map<map>)

          A list of attributes for the entity.

          • boolean — (Boolean)

            An attribute value of Boolean type.

            Example: {"boolean": true}

          • entityIdentifier — (map)

            An attribute value of type EntityIdentifier.

            Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

            • entityTyperequired — (String)

              The type of an entity.

              Example: "entityType":"typeName"

            • entityIdrequired — (String)

              The identifier of an entity.

              "entityId":"identifier"

          • long — (Integer)

            An attribute value of Long type.

            Example: {"long": 0}

          • string — (String)

            An attribute value of String type.

            Example: {"string": "abc"}

          • set — (Array<map>)

            An attribute value of Set type.

            Example: {"set": [ {} ] }

          • record — (map<map>)

            An attribute value of Record type.

            Example: {"record": { "keyName": {} } }

        • parents — (Array<map>)

          The parent entities in the hierarchy that contains the entity. A principal or resource entity can be defined with at most 99 transitive parents per authorization request.

          A transitive parent is an entity in the hierarchy of entities including all direct parents, and parents of parents. For example, a user can be a member of 91 groups if one of those groups is a member of eight groups, for a total of 100: one entity, 91 entity parents, and eight parents of parents.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

    • requests — (Array<map>)

      An array of up to 30 requests that you want Verified Permissions to evaluate.

      • principal — (map)

        Specifies the principal for which the authorization decision is to be made.

        • entityTyperequired — (String)

          The type of an entity.

          Example: "entityType":"typeName"

        • entityIdrequired — (String)

          The identifier of an entity.

          "entityId":"identifier"

      • action — (map)

        Specifies the requested action to be authorized. For example, PhotoFlash::ReadPhoto.

        • actionTyperequired — (String)

          The type of an action.

        • actionIdrequired — (String)

          The ID of an action.

      • resource — (map)

        Specifies the resource that you want an authorization decision for. For example, PhotoFlash::Photo.

        • entityTyperequired — (String)

          The type of an entity.

          Example: "entityType":"typeName"

        • entityIdrequired — (String)

          The identifier of an entity.

          "entityId":"identifier"

      • context — (map)

        Specifies additional context that can be used to make more granular authorization decisions.

        • contextMap — (map<map>)

          An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.

          Example: "contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}

          • boolean — (Boolean)

            An attribute value of Boolean type.

            Example: {"boolean": true}

          • entityIdentifier — (map)

            An attribute value of type EntityIdentifier.

            Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

            • entityTyperequired — (String)

              The type of an entity.

              Example: "entityType":"typeName"

            • entityIdrequired — (String)

              The identifier of an entity.

              "entityId":"identifier"

          • long — (Integer)

            An attribute value of Long type.

            Example: {"long": 0}

          • string — (String)

            An attribute value of String type.

            Example: {"string": "abc"}

          • set — (Array<map>)

            An attribute value of Set type.

            Example: {"set": [ {} ] }

          • record — (map<map>)

            An attribute value of Record type.

            Example: {"record": { "keyName": {} } }

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • results — (Array<map>)

        A series of Allow or Deny decisions for each request, and the policies that produced them.

        • requestrequired — (map)

          The authorization request that initiated the decision.

          • principal — (map)

            Specifies the principal for which the authorization decision is to be made.

            • entityTyperequired — (String)

              The type of an entity.

              Example: "entityType":"typeName"

            • entityIdrequired — (String)

              The identifier of an entity.

              "entityId":"identifier"

          • action — (map)

            Specifies the requested action to be authorized. For example, PhotoFlash::ReadPhoto.

            • actionTyperequired — (String)

              The type of an action.

            • actionIdrequired — (String)

              The ID of an action.

          • resource — (map)

            Specifies the resource that you want an authorization decision for. For example, PhotoFlash::Photo.

            • entityTyperequired — (String)

              The type of an entity.

              Example: "entityType":"typeName"

            • entityIdrequired — (String)

              The identifier of an entity.

              "entityId":"identifier"

          • context — (map)

            Specifies additional context that can be used to make more granular authorization decisions.

            • contextMap — (map<map>)

              An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.

              Example: "contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}

              • boolean — (Boolean)

                An attribute value of Boolean type.

                Example: {"boolean": true}

              • entityIdentifier — (map)

                An attribute value of type EntityIdentifier.

                Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

                • entityTyperequired — (String)

                  The type of an entity.

                  Example: "entityType":"typeName"

                • entityIdrequired — (String)

                  The identifier of an entity.

                  "entityId":"identifier"

              • long — (Integer)

                An attribute value of Long type.

                Example: {"long": 0}

              • string — (String)

                An attribute value of String type.

                Example: {"string": "abc"}

              • set — (Array<map>)

                An attribute value of Set type.

                Example: {"set": [ {} ] }

              • record — (map<map>)

                An attribute value of Record type.

                Example: {"record": { "keyName": {} } }

        • decisionrequired — (String)

          An authorization decision that indicates if the authorization request should be allowed or denied.

          Possible values include:
          • "ALLOW"
          • "DENY"
        • determiningPoliciesrequired — (Array<map>)

          The list of determining policies used to make the authorization decision. For example, if there are two matching policies, where one is a forbid and the other is a permit, then the forbid policy will be the determining policy. In the case of multiple matching permit policies then there would be multiple determining policies. In the case that no policies match, and hence the response is DENY, there would be no determining policies.

          • policyIdrequired — (String)

            The Id of a policy that determined to an authorization decision.

            Example: "policyId":"SPEXAMPLEabcdefg111111"

        • errorsrequired — (Array<map>)

          Errors that occurred while making an authorization decision. For example, a policy might reference an entity or attribute that doesn't exist in the request.

          • errorDescriptionrequired — (String)

            The error description.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

batchIsAuthorizedWithToken(params = {}, callback) ⇒ AWS.Request

Makes a series of decisions about multiple authorization requests for one token. The principal in this request comes from an external identity source in the form of an identity or access token, formatted as a JSON web token (JWT). The information in the parameters can also define additional context that Verified Permissions can include in the evaluations.

The request is evaluated against all policies in the specified policy store that match the entities that you provide in the entities declaration and in the token. The result of the decisions is a series of Allow or Deny responses, along with the IDs of the policies that produced each decision.

The entities of a BatchIsAuthorizedWithToken API request can contain up to 100 resources and up to 99 user groups. The requests of a BatchIsAuthorizedWithToken API request can contain up to 30 requests.

Note: The BatchIsAuthorizedWithToken operation doesn't have its own IAM permission. To authorize this operation for Amazon Web Services principals, include the permission verifiedpermissions:IsAuthorizedWithToken in their IAM policies.

Service Reference:

Examples:

Calling the batchIsAuthorizedWithToken operation

var params = {
  policyStoreId: 'STRING_VALUE', /* required */
  requests: [ /* required */
    {
      action: {
        actionId: 'STRING_VALUE', /* required */
        actionType: 'STRING_VALUE' /* required */
      },
      context: {
        contextMap: {
          '<String>': { /* AttributeValue */
            boolean: true || false,
            entityIdentifier: {
              entityId: 'STRING_VALUE', /* required */
              entityType: 'STRING_VALUE' /* required */
            },
            long: 'NUMBER_VALUE',
            record: {
              '<String>': /* recursive AttributeValue */,
              /* '<String>': ... */
            },
            set: [
              /* recursive AttributeValue */,
              /* more items */
            ],
            string: 'STRING_VALUE'
          },
          /* '<String>': ... */
        }
      },
      resource: {
        entityId: 'STRING_VALUE', /* required */
        entityType: 'STRING_VALUE' /* required */
      }
    },
    /* more items */
  ],
  accessToken: 'STRING_VALUE',
  entities: {
    entityList: [
      {
        identifier: { /* required */
          entityId: 'STRING_VALUE', /* required */
          entityType: 'STRING_VALUE' /* required */
        },
        attributes: {
          '<String>': { /* AttributeValue */
            boolean: true || false,
            entityIdentifier: {
              entityId: 'STRING_VALUE', /* required */
              entityType: 'STRING_VALUE' /* required */
            },
            long: 'NUMBER_VALUE',
            record: {
              '<String>': /* recursive AttributeValue */,
              /* '<String>': ... */
            },
            set: [
              /* recursive AttributeValue */,
              /* more items */
            ],
            string: 'STRING_VALUE'
          },
          /* '<String>': ... */
        },
        parents: [
          {
            entityId: 'STRING_VALUE', /* required */
            entityType: 'STRING_VALUE' /* required */
          },
          /* more items */
        ]
      },
      /* more items */
    ]
  },
  identityToken: 'STRING_VALUE'
};
verifiedpermissions.batchIsAuthorizedWithToken(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input.

    • identityToken — (String)

      Specifies an identity (ID) token for the principal that you want to authorize in each request. This token is provided to you by the identity provider (IdP) associated with the specified identity source. You must specify either an accessToken, an identityToken, or both.

      Must be an ID token. Verified Permissions returns an error if the token_use claim in the submitted token isn't id.

    • accessToken — (String)

      Specifies an access token for the principal that you want to authorize in each request. This token is provided to you by the identity provider (IdP) associated with the specified identity source. You must specify either an accessToken, an identityToken, or both.

      Must be an access token. Verified Permissions returns an error if the token_use claim in the submitted token isn't access.

    • entities — (map)

      Specifies the list of resources and their associated attributes that Verified Permissions can examine when evaluating the policies.

      You can't include principals in this parameter, only resource and action entities. This parameter can't include any entities of a type that matches the user or group entity types that you defined in your identity source.

      • The BatchIsAuthorizedWithToken operation takes principal attributes from only the identityToken or accessToken passed to the operation.

      • For action entities, you can include only their Identifier and EntityType.

      • entityList — (Array<map>)

        An array of entities that are needed to successfully evaluate an authorization request. Each entity in this array must include an identifier for the entity, the attributes of the entity, and a list of any parent entities.

        • identifierrequired — (map)

          The identifier of the entity.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

        • attributes — (map<map>)

          A list of attributes for the entity.

          • boolean — (Boolean)

            An attribute value of Boolean type.

            Example: {"boolean": true}

          • entityIdentifier — (map)

            An attribute value of type EntityIdentifier.

            Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

            • entityTyperequired — (String)

              The type of an entity.

              Example: "entityType":"typeName"

            • entityIdrequired — (String)

              The identifier of an entity.

              "entityId":"identifier"

          • long — (Integer)

            An attribute value of Long type.

            Example: {"long": 0}

          • string — (String)

            An attribute value of String type.

            Example: {"string": "abc"}

          • set — (Array<map>)

            An attribute value of Set type.

            Example: {"set": [ {} ] }

          • record — (map<map>)

            An attribute value of Record type.

            Example: {"record": { "keyName": {} } }

        • parents — (Array<map>)

          The parent entities in the hierarchy that contains the entity. A principal or resource entity can be defined with at most 99 transitive parents per authorization request.

          A transitive parent is an entity in the hierarchy of entities including all direct parents, and parents of parents. For example, a user can be a member of 91 groups if one of those groups is a member of eight groups, for a total of 100: one entity, 91 entity parents, and eight parents of parents.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

    • requests — (Array<map>)

      An array of up to 30 requests that you want Verified Permissions to evaluate.

      • action — (map)

        Specifies the requested action to be authorized. For example, PhotoFlash::ReadPhoto.

        • actionTyperequired — (String)

          The type of an action.

        • actionIdrequired — (String)

          The ID of an action.

      • resource — (map)

        Specifies the resource that you want an authorization decision for. For example, PhotoFlash::Photo.

        • entityTyperequired — (String)

          The type of an entity.

          Example: "entityType":"typeName"

        • entityIdrequired — (String)

          The identifier of an entity.

          "entityId":"identifier"

      • context — (map)

        Specifies additional context that can be used to make more granular authorization decisions.

        • contextMap — (map<map>)

          An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.

          Example: "contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}

          • boolean — (Boolean)

            An attribute value of Boolean type.

            Example: {"boolean": true}

          • entityIdentifier — (map)

            An attribute value of type EntityIdentifier.

            Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

            • entityTyperequired — (String)

              The type of an entity.

              Example: "entityType":"typeName"

            • entityIdrequired — (String)

              The identifier of an entity.

              "entityId":"identifier"

          • long — (Integer)

            An attribute value of Long type.

            Example: {"long": 0}

          • string — (String)

            An attribute value of String type.

            Example: {"string": "abc"}

          • set — (Array<map>)

            An attribute value of Set type.

            Example: {"set": [ {} ] }

          • record — (map<map>)

            An attribute value of Record type.

            Example: {"record": { "keyName": {} } }

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • principal — (map)

        The identifier of the principal in the ID or access token.

        • entityTyperequired — (String)

          The type of an entity.

          Example: "entityType":"typeName"

        • entityIdrequired — (String)

          The identifier of an entity.

          "entityId":"identifier"

      • results — (Array<map>)

        A series of Allow or Deny decisions for each request, and the policies that produced them.

        • requestrequired — (map)

          The authorization request that initiated the decision.

          • action — (map)

            Specifies the requested action to be authorized. For example, PhotoFlash::ReadPhoto.

            • actionTyperequired — (String)

              The type of an action.

            • actionIdrequired — (String)

              The ID of an action.

          • resource — (map)

            Specifies the resource that you want an authorization decision for. For example, PhotoFlash::Photo.

            • entityTyperequired — (String)

              The type of an entity.

              Example: "entityType":"typeName"

            • entityIdrequired — (String)

              The identifier of an entity.

              "entityId":"identifier"

          • context — (map)

            Specifies additional context that can be used to make more granular authorization decisions.

            • contextMap — (map<map>)

              An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.

              Example: "contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}

              • boolean — (Boolean)

                An attribute value of Boolean type.

                Example: {"boolean": true}

              • entityIdentifier — (map)

                An attribute value of type EntityIdentifier.

                Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

                • entityTyperequired — (String)

                  The type of an entity.

                  Example: "entityType":"typeName"

                • entityIdrequired — (String)

                  The identifier of an entity.

                  "entityId":"identifier"

              • long — (Integer)

                An attribute value of Long type.

                Example: {"long": 0}

              • string — (String)

                An attribute value of String type.

                Example: {"string": "abc"}

              • set — (Array<map>)

                An attribute value of Set type.

                Example: {"set": [ {} ] }

              • record — (map<map>)

                An attribute value of Record type.

                Example: {"record": { "keyName": {} } }

        • decisionrequired — (String)

          An authorization decision that indicates if the authorization request should be allowed or denied.

          Possible values include:
          • "ALLOW"
          • "DENY"
        • determiningPoliciesrequired — (Array<map>)

          The list of determining policies used to make the authorization decision. For example, if there are two matching policies, where one is a forbid and the other is a permit, then the forbid policy will be the determining policy. In the case of multiple matching permit policies then there would be multiple determining policies. In the case that no policies match, and hence the response is DENY, there would be no determining policies.

          • policyIdrequired — (String)

            The Id of a policy that determined to an authorization decision.

            Example: "policyId":"SPEXAMPLEabcdefg111111"

        • errorsrequired — (Array<map>)

          Errors that occurred while making an authorization decision. For example, a policy might reference an entity or attribute that doesn't exist in the request.

          • errorDescriptionrequired — (String)

            The error description.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createIdentitySource(params = {}, callback) ⇒ AWS.Request

Adds an identity source to a policy store–an Amazon Cognito user pool or OpenID Connect (OIDC) identity provider (IdP).

After you create an identity source, you can use the identities provided by the IdP as proxies for the principal in authorization queries that use the IsAuthorizedWithToken or BatchIsAuthorizedWithToken API operations. These identities take the form of tokens that contain claims about the user, such as IDs, attributes and group memberships. Identity sources provide identity (ID) tokens and access tokens. Verified Permissions derives information about your user and session from token claims. Access tokens provide action context to your policies, and ID tokens provide principal Attributes.

Tokens from an identity source user continue to be usable until they expire. Token revocation and resource deletion have no effect on the validity of a token in your policy store

Note: To reference a user from this identity source in your Cedar policies, refer to the following syntax examples.
  • Amazon Cognito user pool: Namespace::[Entity type]::[User pool ID]|[user principal attribute], for example MyCorp::User::us-east-1_EXAMPLE|a1b2c3d4-5678-90ab-cdef-EXAMPLE11111.
  • OpenID Connect (OIDC) provider: Namespace::[Entity type]::[principalIdClaim]|[user principal attribute], for example MyCorp::User::MyOIDCProvider|a1b2c3d4-5678-90ab-cdef-EXAMPLE22222.
Note: Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

Service Reference:

Examples:

Calling the createIdentitySource operation

var params = {
  configuration: { /* required */
    cognitoUserPoolConfiguration: {
      userPoolArn: 'STRING_VALUE', /* required */
      clientIds: [
        'STRING_VALUE',
        /* more items */
      ],
      groupConfiguration: {
        groupEntityType: 'STRING_VALUE' /* required */
      }
    },
    openIdConnectConfiguration: {
      issuer: 'STRING_VALUE', /* required */
      tokenSelection: { /* required */
        accessTokenOnly: {
          audiences: [
            'STRING_VALUE',
            /* more items */
          ],
          principalIdClaim: 'STRING_VALUE'
        },
        identityTokenOnly: {
          clientIds: [
            'STRING_VALUE',
            /* more items */
          ],
          principalIdClaim: 'STRING_VALUE'
        }
      },
      entityIdPrefix: 'STRING_VALUE',
      groupConfiguration: {
        groupClaim: 'STRING_VALUE', /* required */
        groupEntityType: 'STRING_VALUE' /* required */
      }
    }
  },
  policyStoreId: 'STRING_VALUE', /* required */
  clientToken: 'STRING_VALUE',
  principalEntityType: 'STRING_VALUE'
};
verifiedpermissions.createIdentitySource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • clientToken — (String)

      Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value..

      If you don't provide this value, then Amazon Web Services generates a random one for you.

      If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an ConflictException error.

      Verified Permissions recognizes a ClientToken for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of ClientToken.

      If a token is not provided, the SDK will use a version 4 UUID.
    • policyStoreId — (String)

      Specifies the ID of the policy store in which you want to store this identity source. Only policies and requests made using this policy store can reference identities from the identity provider configured in the new identity source.

    • configuration — (map)

      Specifies the details required to communicate with the identity provider (IdP) associated with this identity source.

      • cognitoUserPoolConfiguration — (map)

        Contains configuration details of a Amazon Cognito user pool that Verified Permissions can use as a source of authenticated identities as entities. It specifies the Amazon Resource Name (ARN) of a Amazon Cognito user pool and one or more application client IDs.

        Example: "configuration":{"cognitoUserPoolConfiguration":{"userPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","clientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": "MyCorp::Group"}}}

        • userPoolArnrequired — (String)

          The Amazon Resource Name (ARN) of the Amazon Cognito user pool that contains the identities to be authorized.

          Example: "UserPoolArn": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5"

        • clientIds — (Array<String>)

          The unique application client IDs that are associated with the specified Amazon Cognito user pool.

          Example: "ClientIds": ["&ExampleCogClientId;"]

        • groupConfiguration — (map)

          The type of entity that a policy store maps to groups from an Amazon Cognito user pool identity source.

          • groupEntityTyperequired — (String)

            The name of the schema entity type that's mapped to the user pool group. Defaults to AWS::CognitoGroup.

      • openIdConnectConfiguration — (map)

        Contains configuration details of an OpenID Connect (OIDC) identity provider, or identity source, that Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details.

        Example:"configuration":{"openIdConnectConfiguration":{"issuer":"https://auth.example.com","tokenSelection":{"accessTokenOnly":{"audiences":["https://myapp.example.com","https://myapp2.example.com"],"principalIdClaim":"sub"}},"entityIdPrefix":"MyOIDCProvider","groupConfiguration":{"groupClaim":"groups","groupEntityType":"MyCorp::UserGroup"}}}

        • issuerrequired — (String)

          The issuer URL of an OIDC identity provider. This URL must have an OIDC discovery endpoint at the path .well-known/openid-configuration.

        • entityIdPrefix — (String)

          A descriptive string that you want to prefix to user entities from your OIDC identity provider. For example, if you set an entityIdPrefix of MyOIDCProvider, you can reference principals in your policies in the format MyCorp::User::MyOIDCProvider|Carlos.

        • groupConfiguration — (map)

          The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object can map the contents of a groups claim to MyCorp::UserGroup.

          • groupClaimrequired — (String)

            The token claim that you want Verified Permissions to interpret as group membership. For example, groups.

          • groupEntityTyperequired — (String)

            The policy store entity type that you want to map your users' group claim to. For example, MyCorp::UserGroup. A group entity type is an entity that can have a user entity type as a member.

        • tokenSelectionrequired — (map)

          The token type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source.

          • accessTokenOnly — (map)

            The OIDC configuration for processing access tokens. Contains allowed audience claims, for example https://auth.example.com, and the claim that you want to map to the principal, for example sub.

            • principalIdClaim — (String)

              The claim that determines the principal in OIDC access tokens. For example, sub.

            • audiences — (Array<String>)

              The access token aud claim values that you want to accept in your policy store. For example, https://myapp.example.com, https://myapp2.example.com.

          • identityTokenOnly — (map)

            The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example 1example23456789, and the claim that you want to map to the principal, for example sub.

            • principalIdClaim — (String)

              The claim that determines the principal in OIDC access tokens. For example, sub.

            • clientIds — (Array<String>)

              The ID token audience, or client ID, claim values that you want to accept in your policy store from an OIDC identity provider. For example, 1example23456789, 2example10111213.

    • principalEntityType — (String)

      Specifies the namespace and data type of the principals generated for identities authenticated by the new identity source.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • createdDate — (Date)

        The date and time the identity source was originally created.

      • identitySourceId — (String)

        The unique ID of the new identity source.

      • lastUpdatedDate — (Date)

        The date and time the identity source was most recently updated.

      • policyStoreId — (String)

        The ID of the policy store that contains the identity source.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createPolicy(params = {}, callback) ⇒ AWS.Request

Creates a Cedar policy and saves it in the specified policy store. You can create either a static policy or a policy linked to a policy template.

  • To create a static policy, provide the Cedar policy text in the StaticPolicy section of the PolicyDefinition.

  • To create a policy that is dynamically linked to a policy template, specify the policy template ID and the principal and resource to associate with this policy in the templateLinked section of the PolicyDefinition. If the policy template is ever updated, any policies linked to the policy template automatically use the updated template.

Note: Creating a policy causes it to be validated against the schema in the policy store. If the policy doesn't pass validation, the operation fails and the policy isn't stored.
Note: Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

Service Reference:

Examples:

Calling the createPolicy operation

var params = {
  definition: { /* required */
    static: {
      statement: 'STRING_VALUE', /* required */
      description: 'STRING_VALUE'
    },
    templateLinked: {
      policyTemplateId: 'STRING_VALUE', /* required */
      principal: {
        entityId: 'STRING_VALUE', /* required */
        entityType: 'STRING_VALUE' /* required */
      },
      resource: {
        entityId: 'STRING_VALUE', /* required */
        entityType: 'STRING_VALUE' /* required */
      }
    }
  },
  policyStoreId: 'STRING_VALUE', /* required */
  clientToken: 'STRING_VALUE'
};
verifiedpermissions.createPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • clientToken — (String)

      Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value..

      If you don't provide this value, then Amazon Web Services generates a random one for you.

      If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an ConflictException error.

      Verified Permissions recognizes a ClientToken for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of ClientToken.

      If a token is not provided, the SDK will use a version 4 UUID.
    • policyStoreId — (String)

      Specifies the PolicyStoreId of the policy store you want to store the policy in.

    • definition — (map)

      A structure that specifies the policy type and content to use for the new policy. You must include either a static or a templateLinked element. The policy content must be written in the Cedar policy language.

      • static — (map)

        A structure that describes a static policy. An static policy doesn't use a template or allow placeholders for entities.

        • description — (String)

          The description of the static policy.

        • statementrequired — (String)

          The policy content of the static policy, written in the Cedar policy language.

      • templateLinked — (map)

        A structure that describes a policy that was instantiated from a template. The template can specify placeholders for principal and resource. When you use CreatePolicy to create a policy from a template, you specify the exact principal and resource to use for the instantiated policy.

        • policyTemplateIdrequired — (String)

          The unique identifier of the policy template used to create this policy.

        • principal — (map)

          The principal associated with this template-linked policy. Verified Permissions substitutes this principal for the ?principal placeholder in the policy template when it evaluates an authorization request.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

        • resource — (map)

          The resource associated with this template-linked policy. Verified Permissions substitutes this resource for the ?resource placeholder in the policy template when it evaluates an authorization request.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyStoreId — (String)

        The ID of the policy store that contains the new policy.

      • policyId — (String)

        The unique ID of the new policy.

      • policyType — (String)

        The policy type of the new policy.

        Possible values include:
        • "STATIC"
        • "TEMPLATE_LINKED"
      • principal — (map)

        The principal specified in the new policy's scope. This response element isn't present when principal isn't specified in the policy content.

        • entityTyperequired — (String)

          The type of an entity.

          Example: "entityType":"typeName"

        • entityIdrequired — (String)

          The identifier of an entity.

          "entityId":"identifier"

      • resource — (map)

        The resource specified in the new policy's scope. This response element isn't present when the resource isn't specified in the policy content.

        • entityTyperequired — (String)

          The type of an entity.

          Example: "entityType":"typeName"

        • entityIdrequired — (String)

          The identifier of an entity.

          "entityId":"identifier"

      • actions — (Array<map>)

        The action that a policy permits or forbids. For example, {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]}.

        • actionTyperequired — (String)

          The type of an action.

        • actionIdrequired — (String)

          The ID of an action.

      • createdDate — (Date)

        The date and time the policy was originally created.

      • lastUpdatedDate — (Date)

        The date and time the policy was last updated.

      • effect — (String)

        The effect of the decision that a policy returns to an authorization request. For example, "effect": "Permit".

        Possible values include:
        • "Permit"
        • "Forbid"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createPolicyStore(params = {}, callback) ⇒ AWS.Request

Creates a policy store. A policy store is a container for policy resources.

Note: Although Cedar supports multiple namespaces, Verified Permissions currently supports only one namespace per policy store.
Note: Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

Service Reference:

Examples:

Calling the createPolicyStore operation

var params = {
  validationSettings: { /* required */
    mode: OFF | STRICT /* required */
  },
  clientToken: 'STRING_VALUE',
  description: 'STRING_VALUE'
};
verifiedpermissions.createPolicyStore(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • clientToken — (String)

      Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value..

      If you don't provide this value, then Amazon Web Services generates a random one for you.

      If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an ConflictException error.

      Verified Permissions recognizes a ClientToken for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of ClientToken.

      If a token is not provided, the SDK will use a version 4 UUID.
    • validationSettings — (map)

      Specifies the validation setting for this policy store.

      Currently, the only valid and required value is Mode.

      We recommend that you turn on STRICT mode only after you define a schema. If a schema doesn't exist, then STRICT mode causes any policy to fail validation, and Verified Permissions rejects the policy. You can turn off validation by using the UpdatePolicyStore. Then, when you have a schema defined, use UpdatePolicyStore again to turn validation back on.

      • moderequired — (String)

        The validation mode currently configured for this policy store. The valid values are:

        • OFF – Neither Verified Permissions nor Cedar perform any validation on policies. No validation errors are reported by either service.

        • STRICT – Requires a schema to be present in the policy store. Cedar performs validation on all submitted new or updated static policies and policy templates. Any that fail validation are rejected and Cedar doesn't store them in the policy store.

        If Mode=STRICT and the policy store doesn't contain a schema, Verified Permissions rejects all static policies and policy templates because there is no schema to validate against.

        To submit a static policy or policy template without a schema, you must turn off validation.

        Possible values include:
        • "OFF"
        • "STRICT"
    • description — (String)

      Descriptive text that you can provide to help with identification of the current policy store.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyStoreId — (String)

        The unique ID of the new policy store.

      • arn — (String)

        The Amazon Resource Name (ARN) of the new policy store.

      • createdDate — (Date)

        The date and time the policy store was originally created.

      • lastUpdatedDate — (Date)

        The date and time the policy store was last updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createPolicyTemplate(params = {}, callback) ⇒ AWS.Request

Creates a policy template. A template can use placeholders for the principal and resource. A template must be instantiated into a policy by associating it with specific principals and resources to use for the placeholders. That instantiated policy can then be considered in authorization decisions. The instantiated policy works identically to any other policy, except that it is dynamically linked to the template. If the template changes, then any policies that are linked to that template are immediately updated as well.

Note: Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

Service Reference:

Examples:

Calling the createPolicyTemplate operation

var params = {
  policyStoreId: 'STRING_VALUE', /* required */
  statement: 'STRING_VALUE', /* required */
  clientToken: 'STRING_VALUE',
  description: 'STRING_VALUE'
};
verifiedpermissions.createPolicyTemplate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • clientToken — (String)

      Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value..

      If you don't provide this value, then Amazon Web Services generates a random one for you.

      If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an ConflictException error.

      Verified Permissions recognizes a ClientToken for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of ClientToken.

      If a token is not provided, the SDK will use a version 4 UUID.
    • policyStoreId — (String)

      The ID of the policy store in which to create the policy template.

    • description — (String)

      Specifies a description for the policy template.

    • statement — (String)

      Specifies the content that you want to use for the new policy template, written in the Cedar policy language.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyStoreId — (String)

        The ID of the policy store that contains the policy template.

      • policyTemplateId — (String)

        The unique ID of the new policy template.

      • createdDate — (Date)

        The date and time the policy template was originally created.

      • lastUpdatedDate — (Date)

        The date and time the policy template was most recently updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteIdentitySource(params = {}, callback) ⇒ AWS.Request

Deletes an identity source that references an identity provider (IdP) such as Amazon Cognito. After you delete the identity source, you can no longer use tokens for identities from that identity source to represent principals in authorization queries made using IsAuthorizedWithToken. operations.

Service Reference:

Examples:

Calling the deleteIdentitySource operation

var params = {
  identitySourceId: 'STRING_VALUE', /* required */
  policyStoreId: 'STRING_VALUE' /* required */
};
verifiedpermissions.deleteIdentitySource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that contains the identity source that you want to delete.

    • identitySourceId — (String)

      Specifies the ID of the identity source that you want to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deletePolicy(params = {}, callback) ⇒ AWS.Request

Deletes the specified policy from the policy store.

This operation is idempotent; if you specify a policy that doesn't exist, the request response returns a successful HTTP 200 status code.

Service Reference:

Examples:

Calling the deletePolicy operation

var params = {
  policyId: 'STRING_VALUE', /* required */
  policyStoreId: 'STRING_VALUE' /* required */
};
verifiedpermissions.deletePolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that contains the policy that you want to delete.

    • policyId — (String)

      Specifies the ID of the policy that you want to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deletePolicyStore(params = {}, callback) ⇒ AWS.Request

Deletes the specified policy store.

This operation is idempotent. If you specify a policy store that does not exist, the request response will still return a successful HTTP 200 status code.

Service Reference:

Examples:

Calling the deletePolicyStore operation

var params = {
  policyStoreId: 'STRING_VALUE' /* required */
};
verifiedpermissions.deletePolicyStore(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that you want to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deletePolicyTemplate(params = {}, callback) ⇒ AWS.Request

Deletes the specified policy template from the policy store.

This operation also deletes any policies that were created from the specified policy template. Those policies are immediately removed from all future API responses, and are asynchronously deleted from the policy store.

Service Reference:

Examples:

Calling the deletePolicyTemplate operation

var params = {
  policyStoreId: 'STRING_VALUE', /* required */
  policyTemplateId: 'STRING_VALUE' /* required */
};
verifiedpermissions.deletePolicyTemplate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that contains the policy template that you want to delete.

    • policyTemplateId — (String)

      Specifies the ID of the policy template that you want to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getIdentitySource(params = {}, callback) ⇒ AWS.Request

Retrieves the details about the specified identity source.

Service Reference:

Examples:

Calling the getIdentitySource operation

var params = {
  identitySourceId: 'STRING_VALUE', /* required */
  policyStoreId: 'STRING_VALUE' /* required */
};
verifiedpermissions.getIdentitySource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that contains the identity source you want information about.

    • identitySourceId — (String)

      Specifies the ID of the identity source you want information about.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • createdDate — (Date)

        The date and time that the identity source was originally created.

      • details — (map)

        A structure that describes the configuration of the identity source.

        • clientIds — (Array<String>)

          The application client IDs associated with the specified Amazon Cognito user pool that are enabled for this identity source.

        • userPoolArn — (String)

          The Amazon Resource Name (ARN) of the Amazon Cognito user pool whose identities are accessible to this Verified Permissions policy store.

        • discoveryUrl — (String)

          The well-known URL that points to this user pool's OIDC discovery endpoint. This is a URL string in the following format. This URL replaces the placeholders for both the Amazon Web Services Region and the user pool identifier with those appropriate for this user pool.

          https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/.well-known/openid-configuration

        • openIdIssuer — (String)

          A string that identifies the type of OIDC service represented by this identity source.

          At this time, the only valid value is cognito.

          Possible values include:
          • "COGNITO"
      • identitySourceId — (String)

        The ID of the identity source.

      • lastUpdatedDate — (Date)

        The date and time that the identity source was most recently updated.

      • policyStoreId — (String)

        The ID of the policy store that contains the identity source.

      • principalEntityType — (String)

        The data type of principals generated for identities authenticated by this identity source.

      • configuration — (map)

        Contains configuration information about an identity source.

        • cognitoUserPoolConfiguration — (map)

          Contains configuration details of a Amazon Cognito user pool that Verified Permissions can use as a source of authenticated identities as entities. It specifies the Amazon Resource Name (ARN) of a Amazon Cognito user pool, the policy store entity that you want to assign to user groups, and one or more application client IDs.

          Example: "configuration":{"cognitoUserPoolConfiguration":{"userPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","clientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": "MyCorp::Group"}}}

          • userPoolArnrequired — (String)

            The Amazon Resource Name (ARN) of the Amazon Cognito user pool that contains the identities to be authorized.

            Example: "userPoolArn": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5"

          • clientIdsrequired — (Array<String>)

            The unique application client IDs that are associated with the specified Amazon Cognito user pool.

            Example: "clientIds": ["&ExampleCogClientId;"]

          • issuerrequired — (String)

            The OpenID Connect (OIDC) issuer ID of the Amazon Cognito user pool that contains the identities to be authorized.

            Example: "issuer": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1&#95;1a2b3c4d5"

          • groupConfiguration — (map)

            The type of entity that a policy store maps to groups from an Amazon Cognito user pool identity source.

            • groupEntityType — (String)

              The name of the schema entity type that's mapped to the user pool group. Defaults to AWS::CognitoGroup.

        • openIdConnectConfiguration — (map)

          Contains configuration details of an OpenID Connect (OIDC) identity provider, or identity source, that Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details.

          Example:"configuration":{"openIdConnectConfiguration":{"issuer":"https://auth.example.com","tokenSelection":{"accessTokenOnly":{"audiences":["https://myapp.example.com","https://myapp2.example.com"],"principalIdClaim":"sub"}},"entityIdPrefix":"MyOIDCProvider","groupConfiguration":{"groupClaim":"groups","groupEntityType":"MyCorp::UserGroup"}}}

          • issuerrequired — (String)

            The issuer URL of an OIDC identity provider. This URL must have an OIDC discovery endpoint at the path .well-known/openid-configuration.

          • entityIdPrefix — (String)

            A descriptive string that you want to prefix to user entities from your OIDC identity provider. For example, if you set an entityIdPrefix of MyOIDCProvider, you can reference principals in your policies in the format MyCorp::User::MyOIDCProvider|Carlos.

          • groupConfiguration — (map)

            The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object can map the contents of a groups claim to MyCorp::UserGroup.

            • groupClaimrequired — (String)

              The token claim that you want Verified Permissions to interpret as group membership. For example, groups.

            • groupEntityTyperequired — (String)

              The policy store entity type that you want to map your users' group claim to. For example, MyCorp::UserGroup. A group entity type is an entity that can have a user entity type as a member.

          • tokenSelectionrequired — (map)

            The token type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source.

            • accessTokenOnly — (map)

              The OIDC configuration for processing access tokens. Contains allowed audience claims, for example https://auth.example.com, and the claim that you want to map to the principal, for example sub.

              • principalIdClaim — (String)

                The claim that determines the principal in OIDC access tokens. For example, sub.

              • audiences — (Array<String>)

                The access token aud claim values that you want to accept in your policy store. For example, https://myapp.example.com, https://myapp2.example.com.

            • identityTokenOnly — (map)

              The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example 1example23456789, and the claim that you want to map to the principal, for example sub.

              • principalIdClaim — (String)

                The claim that determines the principal in OIDC access tokens. For example, sub.

              • clientIds — (Array<String>)

                The ID token audience, or client ID, claim values that you want to accept in your policy store from an OIDC identity provider. For example, 1example23456789, 2example10111213.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getPolicy(params = {}, callback) ⇒ AWS.Request

Retrieves information about the specified policy.

Service Reference:

Examples:

Calling the getPolicy operation

var params = {
  policyId: 'STRING_VALUE', /* required */
  policyStoreId: 'STRING_VALUE' /* required */
};
verifiedpermissions.getPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that contains the policy that you want information about.

    • policyId — (String)

      Specifies the ID of the policy you want information about.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyStoreId — (String)

        The ID of the policy store that contains the policy that you want information about.

      • policyId — (String)

        The unique ID of the policy that you want information about.

      • policyType — (String)

        The type of the policy.

        Possible values include:
        • "STATIC"
        • "TEMPLATE_LINKED"
      • principal — (map)

        The principal specified in the policy's scope. This element isn't included in the response when Principal isn't present in the policy content.

        • entityTyperequired — (String)

          The type of an entity.

          Example: "entityType":"typeName"

        • entityIdrequired — (String)

          The identifier of an entity.

          "entityId":"identifier"

      • resource — (map)

        The resource specified in the policy's scope. This element isn't included in the response when Resource isn't present in the policy content.

        • entityTyperequired — (String)

          The type of an entity.

          Example: "entityType":"typeName"

        • entityIdrequired — (String)

          The identifier of an entity.

          "entityId":"identifier"

      • actions — (Array<map>)

        The action that a policy permits or forbids. For example, {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]}.

        • actionTyperequired — (String)

          The type of an action.

        • actionIdrequired — (String)

          The ID of an action.

      • definition — (map)

        The definition of the requested policy.

        • static — (map)

          Information about a static policy that wasn't created with a policy template.

          • description — (String)

            A description of the static policy.

          • statementrequired — (String)

            The content of the static policy written in the Cedar policy language.

        • templateLinked — (map)

          Information about a template-linked policy that was created by instantiating a policy template.

          • policyTemplateIdrequired — (String)

            The unique identifier of the policy template used to create this policy.

          • principal — (map)

            The principal associated with this template-linked policy. Verified Permissions substitutes this principal for the ?principal placeholder in the policy template when it evaluates an authorization request.

            • entityTyperequired — (String)

              The type of an entity.

              Example: "entityType":"typeName"

            • entityIdrequired — (String)

              The identifier of an entity.

              "entityId":"identifier"

          • resource — (map)

            The resource associated with this template-linked policy. Verified Permissions substitutes this resource for the ?resource placeholder in the policy template when it evaluates an authorization request.

            • entityTyperequired — (String)

              The type of an entity.

              Example: "entityType":"typeName"

            • entityIdrequired — (String)

              The identifier of an entity.

              "entityId":"identifier"

      • createdDate — (Date)

        The date and time that the policy was originally created.

      • lastUpdatedDate — (Date)

        The date and time that the policy was last updated.

      • effect — (String)

        The effect of the decision that a policy returns to an authorization request. For example, "effect": "Permit".

        Possible values include:
        • "Permit"
        • "Forbid"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getPolicyStore(params = {}, callback) ⇒ AWS.Request

Retrieves details about a policy store.

Service Reference:

Examples:

Calling the getPolicyStore operation

var params = {
  policyStoreId: 'STRING_VALUE' /* required */
};
verifiedpermissions.getPolicyStore(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that you want information about.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyStoreId — (String)

        The ID of the policy store;

      • arn — (String)

        The Amazon Resource Name (ARN) of the policy store.

      • validationSettings — (map)

        The current validation settings for the policy store.

        • moderequired — (String)

          The validation mode currently configured for this policy store. The valid values are:

          • OFF – Neither Verified Permissions nor Cedar perform any validation on policies. No validation errors are reported by either service.

          • STRICT – Requires a schema to be present in the policy store. Cedar performs validation on all submitted new or updated static policies and policy templates. Any that fail validation are rejected and Cedar doesn't store them in the policy store.

          If Mode=STRICT and the policy store doesn't contain a schema, Verified Permissions rejects all static policies and policy templates because there is no schema to validate against.

          To submit a static policy or policy template without a schema, you must turn off validation.

          Possible values include:
          • "OFF"
          • "STRICT"
      • createdDate — (Date)

        The date and time that the policy store was originally created.

      • lastUpdatedDate — (Date)

        The date and time that the policy store was last updated.

      • description — (String)

        Descriptive text that you can provide to help with identification of the current policy store.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getPolicyTemplate(params = {}, callback) ⇒ AWS.Request

Retrieve the details for the specified policy template in the specified policy store.

Service Reference:

Examples:

Calling the getPolicyTemplate operation

var params = {
  policyStoreId: 'STRING_VALUE', /* required */
  policyTemplateId: 'STRING_VALUE' /* required */
};
verifiedpermissions.getPolicyTemplate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that contains the policy template that you want information about.

    • policyTemplateId — (String)

      Specifies the ID of the policy template that you want information about.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyStoreId — (String)

        The ID of the policy store that contains the policy template.

      • policyTemplateId — (String)

        The ID of the policy template.

      • description — (String)

        The description of the policy template.

      • statement — (String)

        The content of the body of the policy template written in the Cedar policy language.

      • createdDate — (Date)

        The date and time that the policy template was originally created.

      • lastUpdatedDate — (Date)

        The date and time that the policy template was most recently updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getSchema(params = {}, callback) ⇒ AWS.Request

Retrieve the details for the specified schema in the specified policy store.

Service Reference:

Examples:

Calling the getSchema operation

var params = {
  policyStoreId: 'STRING_VALUE' /* required */
};
verifiedpermissions.getSchema(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that contains the schema.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyStoreId — (String)

        The ID of the policy store that contains the schema.

      • schema — (String)

        The body of the schema, written in Cedar schema JSON.

      • createdDate — (Date)

        The date and time that the schema was originally created.

      • lastUpdatedDate — (Date)

        The date and time that the schema was most recently updated.

      • namespaces — (Array<String>)

        The namespaces of the entities referenced by this schema.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

isAuthorized(params = {}, callback) ⇒ AWS.Request

Makes an authorization decision about a service request described in the parameters. The information in the parameters can also define additional context that Verified Permissions can include in the evaluation. The request is evaluated against all matching policies in the specified policy store. The result of the decision is either Allow or Deny, along with a list of the policies that resulted in the decision.

Service Reference:

Examples:

Calling the isAuthorized operation

var params = {
  policyStoreId: 'STRING_VALUE', /* required */
  action: {
    actionId: 'STRING_VALUE', /* required */
    actionType: 'STRING_VALUE' /* required */
  },
  context: {
    contextMap: {
      '<String>': { /* AttributeValue */
        boolean: true || false,
        entityIdentifier: {
          entityId: 'STRING_VALUE', /* required */
          entityType: 'STRING_VALUE' /* required */
        },
        long: 'NUMBER_VALUE',
        record: {
          '<String>': /* recursive AttributeValue */,
          /* '<String>': ... */
        },
        set: [
          /* recursive AttributeValue */,
          /* more items */
        ],
        string: 'STRING_VALUE'
      },
      /* '<String>': ... */
    }
  },
  entities: {
    entityList: [
      {
        identifier: { /* required */
          entityId: 'STRING_VALUE', /* required */
          entityType: 'STRING_VALUE' /* required */
        },
        attributes: {
          '<String>': { /* AttributeValue */
            boolean: true || false,
            entityIdentifier: {
              entityId: 'STRING_VALUE', /* required */
              entityType: 'STRING_VALUE' /* required */
            },
            long: 'NUMBER_VALUE',
            record: {
              '<String>': /* recursive AttributeValue */,
              /* '<String>': ... */
            },
            set: [
              /* recursive AttributeValue */,
              /* more items */
            ],
            string: 'STRING_VALUE'
          },
          /* '<String>': ... */
        },
        parents: [
          {
            entityId: 'STRING_VALUE', /* required */
            entityType: 'STRING_VALUE' /* required */
          },
          /* more items */
        ]
      },
      /* more items */
    ]
  },
  principal: {
    entityId: 'STRING_VALUE', /* required */
    entityType: 'STRING_VALUE' /* required */
  },
  resource: {
    entityId: 'STRING_VALUE', /* required */
    entityType: 'STRING_VALUE' /* required */
  }
};
verifiedpermissions.isAuthorized(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input.

    • principal — (map)

      Specifies the principal for which the authorization decision is to be made.

      • entityTyperequired — (String)

        The type of an entity.

        Example: "entityType":"typeName"

      • entityIdrequired — (String)

        The identifier of an entity.

        "entityId":"identifier"

    • action — (map)

      Specifies the requested action to be authorized. For example, is the principal authorized to perform this action on the resource?

      • actionTyperequired — (String)

        The type of an action.

      • actionIdrequired — (String)

        The ID of an action.

    • resource — (map)

      Specifies the resource for which the authorization decision is to be made.

      • entityTyperequired — (String)

        The type of an entity.

        Example: "entityType":"typeName"

      • entityIdrequired — (String)

        The identifier of an entity.

        "entityId":"identifier"

    • context — (map)

      Specifies additional context that can be used to make more granular authorization decisions.

      • contextMap — (map<map>)

        An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.

        Example: "contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}

        • boolean — (Boolean)

          An attribute value of Boolean type.

          Example: {"boolean": true}

        • entityIdentifier — (map)

          An attribute value of type EntityIdentifier.

          Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

        • long — (Integer)

          An attribute value of Long type.

          Example: {"long": 0}

        • string — (String)

          An attribute value of String type.

          Example: {"string": "abc"}

        • set — (Array<map>)

          An attribute value of Set type.

          Example: {"set": [ {} ] }

        • record — (map<map>)

          An attribute value of Record type.

          Example: {"record": { "keyName": {} } }

    • entities — (map)

      Specifies the list of resources and principals and their associated attributes that Verified Permissions can examine when evaluating the policies.

      Note: You can include only principal and resource entities in this parameter; you can't include actions. You must specify actions in the schema.
      • entityList — (Array<map>)

        An array of entities that are needed to successfully evaluate an authorization request. Each entity in this array must include an identifier for the entity, the attributes of the entity, and a list of any parent entities.

        • identifierrequired — (map)

          The identifier of the entity.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

        • attributes — (map<map>)

          A list of attributes for the entity.

          • boolean — (Boolean)

            An attribute value of Boolean type.

            Example: {"boolean": true}

          • entityIdentifier — (map)

            An attribute value of type EntityIdentifier.

            Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

            • entityTyperequired — (String)

              The type of an entity.

              Example: "entityType":"typeName"

            • entityIdrequired — (String)

              The identifier of an entity.

              "entityId":"identifier"

          • long — (Integer)

            An attribute value of Long type.

            Example: {"long": 0}

          • string — (String)

            An attribute value of String type.

            Example: {"string": "abc"}

          • set — (Array<map>)

            An attribute value of Set type.

            Example: {"set": [ {} ] }

          • record — (map<map>)

            An attribute value of Record type.

            Example: {"record": { "keyName": {} } }

        • parents — (Array<map>)

          The parent entities in the hierarchy that contains the entity. A principal or resource entity can be defined with at most 99 transitive parents per authorization request.

          A transitive parent is an entity in the hierarchy of entities including all direct parents, and parents of parents. For example, a user can be a member of 91 groups if one of those groups is a member of eight groups, for a total of 100: one entity, 91 entity parents, and eight parents of parents.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • decision — (String)

        An authorization decision that indicates if the authorization request should be allowed or denied.

        Possible values include:
        • "ALLOW"
        • "DENY"
      • determiningPolicies — (Array<map>)

        The list of determining policies used to make the authorization decision. For example, if there are two matching policies, where one is a forbid and the other is a permit, then the forbid policy will be the determining policy. In the case of multiple matching permit policies then there would be multiple determining policies. In the case that no policies match, and hence the response is DENY, there would be no determining policies.

        • policyIdrequired — (String)

          The Id of a policy that determined to an authorization decision.

          Example: "policyId":"SPEXAMPLEabcdefg111111"

      • errors — (Array<map>)

        Errors that occurred while making an authorization decision, for example, a policy references an Entity or entity Attribute that does not exist in the slice.

        • errorDescriptionrequired — (String)

          The error description.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

isAuthorizedWithToken(params = {}, callback) ⇒ AWS.Request

Makes an authorization decision about a service request described in the parameters. The principal in this request comes from an external identity source in the form of an identity token formatted as a JSON web token (JWT). The information in the parameters can also define additional context that Verified Permissions can include in the evaluation. The request is evaluated against all matching policies in the specified policy store. The result of the decision is either Allow or Deny, along with a list of the policies that resulted in the decision.

At this time, Verified Permissions accepts tokens from only Amazon Cognito.

Verified Permissions validates each token that is specified in a request by checking its expiration date and its signature.

Tokens from an identity source user continue to be usable until they expire. Token revocation and resource deletion have no effect on the validity of a token in your policy store

Service Reference:

Examples:

Calling the isAuthorizedWithToken operation

var params = {
  policyStoreId: 'STRING_VALUE', /* required */
  accessToken: 'STRING_VALUE',
  action: {
    actionId: 'STRING_VALUE', /* required */
    actionType: 'STRING_VALUE' /* required */
  },
  context: {
    contextMap: {
      '<String>': { /* AttributeValue */
        boolean: true || false,
        entityIdentifier: {
          entityId: 'STRING_VALUE', /* required */
          entityType: 'STRING_VALUE' /* required */
        },
        long: 'NUMBER_VALUE',
        record: {
          '<String>': /* recursive AttributeValue */,
          /* '<String>': ... */
        },
        set: [
          /* recursive AttributeValue */,
          /* more items */
        ],
        string: 'STRING_VALUE'
      },
      /* '<String>': ... */
    }
  },
  entities: {
    entityList: [
      {
        identifier: { /* required */
          entityId: 'STRING_VALUE', /* required */
          entityType: 'STRING_VALUE' /* required */
        },
        attributes: {
          '<String>': { /* AttributeValue */
            boolean: true || false,
            entityIdentifier: {
              entityId: 'STRING_VALUE', /* required */
              entityType: 'STRING_VALUE' /* required */
            },
            long: 'NUMBER_VALUE',
            record: {
              '<String>': /* recursive AttributeValue */,
              /* '<String>': ... */
            },
            set: [
              /* recursive AttributeValue */,
              /* more items */
            ],
            string: 'STRING_VALUE'
          },
          /* '<String>': ... */
        },
        parents: [
          {
            entityId: 'STRING_VALUE', /* required */
            entityType: 'STRING_VALUE' /* required */
          },
          /* more items */
        ]
      },
      /* more items */
    ]
  },
  identityToken: 'STRING_VALUE',
  resource: {
    entityId: 'STRING_VALUE', /* required */
    entityType: 'STRING_VALUE' /* required */
  }
};
verifiedpermissions.isAuthorizedWithToken(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input.

    • identityToken — (String)

      Specifies an identity token for the principal to be authorized. This token is provided to you by the identity provider (IdP) associated with the specified identity source. You must specify either an accessToken, an identityToken, or both.

      Must be an ID token. Verified Permissions returns an error if the token_use claim in the submitted token isn't id.

    • accessToken — (String)

      Specifies an access token for the principal to be authorized. This token is provided to you by the identity provider (IdP) associated with the specified identity source. You must specify either an accessToken, an identityToken, or both.

      Must be an access token. Verified Permissions returns an error if the token_use claim in the submitted token isn't access.

    • action — (map)

      Specifies the requested action to be authorized. Is the specified principal authorized to perform this action on the specified resource.

      • actionTyperequired — (String)

        The type of an action.

      • actionIdrequired — (String)

        The ID of an action.

    • resource — (map)

      Specifies the resource for which the authorization decision is made. For example, is the principal allowed to perform the action on the resource?

      • entityTyperequired — (String)

        The type of an entity.

        Example: "entityType":"typeName"

      • entityIdrequired — (String)

        The identifier of an entity.

        "entityId":"identifier"

    • context — (map)

      Specifies additional context that can be used to make more granular authorization decisions.

      • contextMap — (map<map>)

        An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.

        Example: "contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}

        • boolean — (Boolean)

          An attribute value of Boolean type.

          Example: {"boolean": true}

        • entityIdentifier — (map)

          An attribute value of type EntityIdentifier.

          Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

        • long — (Integer)

          An attribute value of Long type.

          Example: {"long": 0}

        • string — (String)

          An attribute value of String type.

          Example: {"string": "abc"}

        • set — (Array<map>)

          An attribute value of Set type.

          Example: {"set": [ {} ] }

        • record — (map<map>)

          An attribute value of Record type.

          Example: {"record": { "keyName": {} } }

    • entities — (map)

      Specifies the list of resources and their associated attributes that Verified Permissions can examine when evaluating the policies.

      You can't include principals in this parameter, only resource and action entities. This parameter can't include any entities of a type that matches the user or group entity types that you defined in your identity source.

      • The IsAuthorizedWithToken operation takes principal attributes from only the identityToken or accessToken passed to the operation.

      • For action entities, you can include only their Identifier and EntityType.

      • entityList — (Array<map>)

        An array of entities that are needed to successfully evaluate an authorization request. Each entity in this array must include an identifier for the entity, the attributes of the entity, and a list of any parent entities.

        • identifierrequired — (map)

          The identifier of the entity.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

        • attributes — (map<map>)

          A list of attributes for the entity.

          • boolean — (Boolean)

            An attribute value of Boolean type.

            Example: {"boolean": true}

          • entityIdentifier — (map)

            An attribute value of type EntityIdentifier.

            Example: "entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}

            • entityTyperequired — (String)

              The type of an entity.

              Example: "entityType":"typeName"

            • entityIdrequired — (String)

              The identifier of an entity.

              "entityId":"identifier"

          • long — (Integer)

            An attribute value of Long type.

            Example: {"long": 0}

          • string — (String)

            An attribute value of String type.

            Example: {"string": "abc"}

          • set — (Array<map>)

            An attribute value of Set type.

            Example: {"set": [ {} ] }

          • record — (map<map>)

            An attribute value of Record type.

            Example: {"record": { "keyName": {} } }

        • parents — (Array<map>)

          The parent entities in the hierarchy that contains the entity. A principal or resource entity can be defined with at most 99 transitive parents per authorization request.

          A transitive parent is an entity in the hierarchy of entities including all direct parents, and parents of parents. For example, a user can be a member of 91 groups if one of those groups is a member of eight groups, for a total of 100: one entity, 91 entity parents, and eight parents of parents.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • decision — (String)

        An authorization decision that indicates if the authorization request should be allowed or denied.

        Possible values include:
        • "ALLOW"
        • "DENY"
      • determiningPolicies — (Array<map>)

        The list of determining policies used to make the authorization decision. For example, if there are multiple matching policies, where at least one is a forbid policy, then because forbid always overrides permit the forbid policies are the determining policies. If all matching policies are permit policies, then those policies are the determining policies. When no policies match and the response is the default DENY, there are no determining policies.

        • policyIdrequired — (String)

          The Id of a policy that determined to an authorization decision.

          Example: "policyId":"SPEXAMPLEabcdefg111111"

      • errors — (Array<map>)

        Errors that occurred while making an authorization decision. For example, a policy references an entity or entity attribute that does not exist in the slice.

        • errorDescriptionrequired — (String)

          The error description.

      • principal — (map)

        The identifier of the principal in the ID or access token.

        • entityTyperequired — (String)

          The type of an entity.

          Example: "entityType":"typeName"

        • entityIdrequired — (String)

          The identifier of an entity.

          "entityId":"identifier"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listIdentitySources(params = {}, callback) ⇒ AWS.Request

Returns a paginated list of all of the identity sources defined in the specified policy store.

Service Reference:

Examples:

Calling the listIdentitySources operation

var params = {
  policyStoreId: 'STRING_VALUE', /* required */
  filters: [
    {
      principalEntityType: 'STRING_VALUE'
    },
    /* more items */
  ],
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
verifiedpermissions.listIdentitySources(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that contains the identity sources that you want to list.

    • nextToken — (String)

      Specifies that you want to receive the next page of results. Valid only if you received a NextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's NextToken response to request the next page of results.

    • maxResults — (Integer)

      Specifies the total number of results that you want included in each response. If additional items exist beyond the number you specify, the NextToken response element is returned with a value (not null). Include the specified value as the NextToken request parameter in the next call to the operation to get the next set of results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

      If you do not specify this parameter, the operation defaults to 10 identity sources per response. You can specify a maximum of 50 identity sources per response.

    • filters — (Array<map>)

      Specifies characteristics of an identity source that you can use to limit the output to matching identity sources.

      • principalEntityType — (String)

        The Cedar entity type of the principals returned by the identity provider (IdP) associated with this identity source.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • nextToken — (String)

        If present, this value indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null. This indicates that this is the last page of results.

      • identitySources — (Array<map>)

        The list of identity sources stored in the specified policy store.

        • createdDaterequired — (Date)

          The date and time the identity source was originally created.

        • details — (map)

          A structure that contains the details of the associated identity provider (IdP).

          • clientIds — (Array<String>)

            The application client IDs associated with the specified Amazon Cognito user pool that are enabled for this identity source.

          • userPoolArn — (String)

            The Amazon Cognito user pool whose identities are accessible to this Verified Permissions policy store.

          • discoveryUrl — (String)

            The well-known URL that points to this user pool's OIDC discovery endpoint. This is a URL string in the following format. This URL replaces the placeholders for both the Amazon Web Services Region and the user pool identifier with those appropriate for this user pool.

            https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/.well-known/openid-configuration

          • openIdIssuer — (String)

            A string that identifies the type of OIDC service represented by this identity source.

            At this time, the only valid value is cognito.

            Possible values include:
            • "COGNITO"
        • identitySourceIdrequired — (String)

          The unique identifier of the identity source.

        • lastUpdatedDaterequired — (Date)

          The date and time the identity source was most recently updated.

        • policyStoreIdrequired — (String)

          The identifier of the policy store that contains the identity source.

        • principalEntityTyperequired — (String)

          The Cedar entity type of the principals returned from the IdP associated with this identity source.

        • configuration — (map)

          Contains configuration information about an identity source.

          • cognitoUserPoolConfiguration — (map)

            Contains configuration details of a Amazon Cognito user pool that Verified Permissions can use as a source of authenticated identities as entities. It specifies the Amazon Resource Name (ARN) of a Amazon Cognito user pool, the policy store entity that you want to assign to user groups, and one or more application client IDs.

            Example: "configuration":{"cognitoUserPoolConfiguration":{"userPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","clientIds": ["a1b2c3d4e5f6g7h8i9j0kalbmc"],"groupConfiguration": {"groupEntityType": "MyCorp::Group"}}}

            • userPoolArnrequired — (String)

              The Amazon Resource Name (ARN) of the Amazon Cognito user pool that contains the identities to be authorized.

              Example: "userPoolArn": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5"

            • clientIdsrequired — (Array<String>)

              The unique application client IDs that are associated with the specified Amazon Cognito user pool.

              Example: "clientIds": ["&ExampleCogClientId;"]

            • issuerrequired — (String)

              The OpenID Connect (OIDC) issuer ID of the Amazon Cognito user pool that contains the identities to be authorized.

              Example: "issuer": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1&#95;1a2b3c4d5"

            • groupConfiguration — (map)

              The type of entity that a policy store maps to groups from an Amazon Cognito user pool identity source.

              • groupEntityType — (String)

                The name of the schema entity type that's mapped to the user pool group. Defaults to AWS::CognitoGroup.

          • openIdConnectConfiguration — (map)

            Contains configuration details of an OpenID Connect (OIDC) identity provider, or identity source, that Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details.

            Example:"configuration":{"openIdConnectConfiguration":{"issuer":"https://auth.example.com","tokenSelection":{"accessTokenOnly":{"audiences":["https://myapp.example.com","https://myapp2.example.com"],"principalIdClaim":"sub"}},"entityIdPrefix":"MyOIDCProvider","groupConfiguration":{"groupClaim":"groups","groupEntityType":"MyCorp::UserGroup"}}}

            • issuerrequired — (String)

              The issuer URL of an OIDC identity provider. This URL must have an OIDC discovery endpoint at the path .well-known/openid-configuration.

            • entityIdPrefix — (String)

              A descriptive string that you want to prefix to user entities from your OIDC identity provider. For example, if you set an entityIdPrefix of MyOIDCProvider, you can reference principals in your policies in the format MyCorp::User::MyOIDCProvider|Carlos.

            • groupConfiguration — (map)

              The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object can map the contents of a groups claim to MyCorp::UserGroup.

              • groupClaimrequired — (String)

                The token claim that you want Verified Permissions to interpret as group membership. For example, groups.

              • groupEntityTyperequired — (String)

                The policy store entity type that you want to map your users' group claim to. For example, MyCorp::UserGroup. A group entity type is an entity that can have a user entity type as a member.

            • tokenSelectionrequired — (map)

              The token type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source.

              • accessTokenOnly — (map)

                The OIDC configuration for processing access tokens. Contains allowed audience claims, for example https://auth.example.com, and the claim that you want to map to the principal, for example sub.

                • principalIdClaim — (String)

                  The claim that determines the principal in OIDC access tokens. For example, sub.

                • audiences — (Array<String>)

                  The access token aud claim values that you want to accept in your policy store. For example, https://myapp.example.com, https://myapp2.example.com.

              • identityTokenOnly — (map)

                The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example 1example23456789, and the claim that you want to map to the principal, for example sub.

                • principalIdClaim — (String)

                  The claim that determines the principal in OIDC access tokens. For example, sub.

                • clientIds — (Array<String>)

                  The ID token audience, or client ID, claim values that you want to accept in your policy store from an OIDC identity provider. For example, 1example23456789, 2example10111213.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listPolicies(params = {}, callback) ⇒ AWS.Request

Returns a paginated list of all policies stored in the specified policy store.

Service Reference:

Examples:

Calling the listPolicies operation

var params = {
  policyStoreId: 'STRING_VALUE', /* required */
  filter: {
    policyTemplateId: 'STRING_VALUE',
    policyType: STATIC | TEMPLATE_LINKED,
    principal: {
      identifier: {
        entityId: 'STRING_VALUE', /* required */
        entityType: 'STRING_VALUE' /* required */
      },
      unspecified: true || false
    },
    resource: {
      identifier: {
        entityId: 'STRING_VALUE', /* required */
        entityType: 'STRING_VALUE' /* required */
      },
      unspecified: true || false
    }
  },
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
verifiedpermissions.listPolicies(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store you want to list policies from.

    • nextToken — (String)

      Specifies that you want to receive the next page of results. Valid only if you received a NextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's NextToken response to request the next page of results.

    • maxResults — (Integer)

      Specifies the total number of results that you want included in each response. If additional items exist beyond the number you specify, the NextToken response element is returned with a value (not null). Include the specified value as the NextToken request parameter in the next call to the operation to get the next set of results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

      If you do not specify this parameter, the operation defaults to 10 policies per response. You can specify a maximum of 50 policies per response.

    • filter — (map)

      Specifies a filter that limits the response to only policies that match the specified criteria. For example, you list only the policies that reference a specified principal.

      • principal — (map)

        Filters the output to only policies that reference the specified principal.

        • unspecified — (Boolean)

          Used to indicate that a principal or resource is not specified. This can be used to search for policies that are not associated with a specific principal or resource.

        • identifier — (map)

          The identifier of the entity. It can consist of either an EntityType and EntityId, a principal, or a resource.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

      • resource — (map)

        Filters the output to only policies that reference the specified resource.

        • unspecified — (Boolean)

          Used to indicate that a principal or resource is not specified. This can be used to search for policies that are not associated with a specific principal or resource.

        • identifier — (map)

          The identifier of the entity. It can consist of either an EntityType and EntityId, a principal, or a resource.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

      • policyType — (String)

        Filters the output to only policies of the specified type.

        Possible values include:
        • "STATIC"
        • "TEMPLATE_LINKED"
      • policyTemplateId — (String)

        Filters the output to only template-linked policies that were instantiated from the specified policy template.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • nextToken — (String)

        If present, this value indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null. This indicates that this is the last page of results.

      • policies — (Array<map>)

        Lists all policies that are available in the specified policy store.

        • policyStoreIdrequired — (String)

          The identifier of the PolicyStore where the policy you want information about is stored.

        • policyIdrequired — (String)

          The identifier of the policy you want information about.

        • policyTyperequired — (String)

          The type of the policy. This is one of the following values:

          • static

          • templateLinked

          Possible values include:
          • "STATIC"
          • "TEMPLATE_LINKED"
        • principal — (map)

          The principal associated with the policy.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

        • resource — (map)

          The resource associated with the policy.

          • entityTyperequired — (String)

            The type of an entity.

            Example: "entityType":"typeName"

          • entityIdrequired — (String)

            The identifier of an entity.

            "entityId":"identifier"

        • actions — (Array<map>)

          The action that a policy permits or forbids. For example, {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]}.

          • actionTyperequired — (String)

            The type of an action.

          • actionIdrequired — (String)

            The ID of an action.

        • definitionrequired — (map)

          The policy definition of an item in the list of policies returned.

          • static — (map)

            Information about a static policy that wasn't created with a policy template.

            • description — (String)

              A description of the static policy.

          • templateLinked — (map)

            Information about a template-linked policy that was created by instantiating a policy template.

            • policyTemplateIdrequired — (String)

              The unique identifier of the policy template used to create this policy.

            • principal — (map)

              The principal associated with this template-linked policy. Verified Permissions substitutes this principal for the ?principal placeholder in the policy template when it evaluates an authorization request.

              • entityTyperequired — (String)

                The type of an entity.

                Example: "entityType":"typeName"

              • entityIdrequired — (String)

                The identifier of an entity.

                "entityId":"identifier"

            • resource — (map)

              The resource associated with this template-linked policy. Verified Permissions substitutes this resource for the ?resource placeholder in the policy template when it evaluates an authorization request.

              • entityTyperequired — (String)

                The type of an entity.

                Example: "entityType":"typeName"

              • entityIdrequired — (String)

                The identifier of an entity.

                "entityId":"identifier"

        • createdDaterequired — (Date)

          The date and time the policy was created.

        • lastUpdatedDaterequired — (Date)

          The date and time the policy was most recently updated.

        • effect — (String)

          The effect of the decision that a policy returns to an authorization request. For example, "effect": "Permit".

          Possible values include:
          • "Permit"
          • "Forbid"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listPolicyStores(params = {}, callback) ⇒ AWS.Request

Returns a paginated list of all policy stores in the calling Amazon Web Services account.

Service Reference:

Examples:

Calling the listPolicyStores operation

var params = {
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
verifiedpermissions.listPolicyStores(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • nextToken — (String)

      Specifies that you want to receive the next page of results. Valid only if you received a NextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's NextToken response to request the next page of results.

    • maxResults — (Integer)

      Specifies the total number of results that you want included in each response. If additional items exist beyond the number you specify, the NextToken response element is returned with a value (not null). Include the specified value as the NextToken request parameter in the next call to the operation to get the next set of results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

      If you do not specify this parameter, the operation defaults to 10 policy stores per response. You can specify a maximum of 50 policy stores per response.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • nextToken — (String)

        If present, this value indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null. This indicates that this is the last page of results.

      • policyStores — (Array<map>)

        The list of policy stores in the account.

        • policyStoreIdrequired — (String)

          The unique identifier of the policy store.

        • arnrequired — (String)

          The Amazon Resource Name (ARN) of the policy store.

        • createdDaterequired — (Date)

          The date and time the policy was created.

        • lastUpdatedDate — (Date)

          The date and time the policy store was most recently updated.

        • description — (String)

          Descriptive text that you can provide to help with identification of the current policy store.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listPolicyTemplates(params = {}, callback) ⇒ AWS.Request

Returns a paginated list of all policy templates in the specified policy store.

Service Reference:

Examples:

Calling the listPolicyTemplates operation

var params = {
  policyStoreId: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
verifiedpermissions.listPolicyTemplates(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that contains the policy templates you want to list.

    • nextToken — (String)

      Specifies that you want to receive the next page of results. Valid only if you received a NextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's NextToken response to request the next page of results.

    • maxResults — (Integer)

      Specifies the total number of results that you want included in each response. If additional items exist beyond the number you specify, the NextToken response element is returned with a value (not null). Include the specified value as the NextToken request parameter in the next call to the operation to get the next set of results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

      If you do not specify this parameter, the operation defaults to 10 policy templates per response. You can specify a maximum of 50 policy templates per response.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • nextToken — (String)

        If present, this value indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null. This indicates that this is the last page of results.

      • policyTemplates — (Array<map>)

        The list of the policy templates in the specified policy store.

        • policyStoreIdrequired — (String)

          The unique identifier of the policy store that contains the template.

        • policyTemplateIdrequired — (String)

          The unique identifier of the policy template.

        • description — (String)

          The description attached to the policy template.

        • createdDaterequired — (Date)

          The date and time that the policy template was created.

        • lastUpdatedDaterequired — (Date)

          The date and time that the policy template was most recently updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putSchema(params = {}, callback) ⇒ AWS.Request

Creates or updates the policy schema in the specified policy store. The schema is used to validate any Cedar policies and policy templates submitted to the policy store. Any changes to the schema validate only policies and templates submitted after the schema change. Existing policies and templates are not re-evaluated against the changed schema. If you later update a policy, then it is evaluated against the new schema at that time.

Note: Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

Service Reference:

Examples:

Calling the putSchema operation

var params = {
  definition: { /* required */
    cedarJson: 'STRING_VALUE'
  },
  policyStoreId: 'STRING_VALUE' /* required */
};
verifiedpermissions.putSchema(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store in which to place the schema.

    • definition — (map)

      Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON.

      • cedarJson — (String)

        A JSON string representation of the schema supported by applications that use this policy store. For more information, see Policy store schema in the Amazon Verified Permissions User Guide.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyStoreId — (String)

        The unique ID of the policy store that contains the schema.

      • namespaces — (Array<String>)

        Identifies the namespaces of the entities referenced by this schema.

      • createdDate — (Date)

        The date and time that the schema was originally created.

      • lastUpdatedDate — (Date)

        The date and time that the schema was last updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateIdentitySource(params = {}, callback) ⇒ AWS.Request

Updates the specified identity source to use a new identity provider (IdP), or to change the mapping of identities from the IdP to a different principal entity type.

Note: Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

Service Reference:

Examples:

Calling the updateIdentitySource operation

var params = {
  identitySourceId: 'STRING_VALUE', /* required */
  policyStoreId: 'STRING_VALUE', /* required */
  updateConfiguration: { /* required */
    cognitoUserPoolConfiguration: {
      userPoolArn: 'STRING_VALUE', /* required */
      clientIds: [
        'STRING_VALUE',
        /* more items */
      ],
      groupConfiguration: {
        groupEntityType: 'STRING_VALUE' /* required */
      }
    },
    openIdConnectConfiguration: {
      issuer: 'STRING_VALUE', /* required */
      tokenSelection: { /* required */
        accessTokenOnly: {
          audiences: [
            'STRING_VALUE',
            /* more items */
          ],
          principalIdClaim: 'STRING_VALUE'
        },
        identityTokenOnly: {
          clientIds: [
            'STRING_VALUE',
            /* more items */
          ],
          principalIdClaim: 'STRING_VALUE'
        }
      },
      entityIdPrefix: 'STRING_VALUE',
      groupConfiguration: {
        groupClaim: 'STRING_VALUE', /* required */
        groupEntityType: 'STRING_VALUE' /* required */
      }
    }
  },
  principalEntityType: 'STRING_VALUE'
};
verifiedpermissions.updateIdentitySource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that contains the identity source that you want to update.

    • identitySourceId — (String)

      Specifies the ID of the identity source that you want to update.

    • updateConfiguration — (map)

      Specifies the details required to communicate with the identity provider (IdP) associated with this identity source.

      Note: At this time, the only valid member of this structure is a Amazon Cognito user pool configuration. You must specify a userPoolArn, and optionally, a ClientId.
      • cognitoUserPoolConfiguration — (map)

        Contains configuration details of a Amazon Cognito user pool.

        • userPoolArnrequired — (String)

          The Amazon Resource Name (ARN) of the Amazon Cognito user pool associated with this identity source.

        • clientIds — (Array<String>)

          The client ID of an app client that is configured for the specified Amazon Cognito user pool.

        • groupConfiguration — (map)

          The configuration of the user groups from an Amazon Cognito user pool identity source.

          • groupEntityTyperequired — (String)

            The name of the schema entity type that's mapped to the user pool group. Defaults to AWS::CognitoGroup.

      • openIdConnectConfiguration — (map)

        Contains configuration details of an OpenID Connect (OIDC) identity provider, or identity source, that Verified Permissions can use to generate entities from authenticated identities. It specifies the issuer URL, token type that you want to use, and policy store entity details.

        • issuerrequired — (String)

          The issuer URL of an OIDC identity provider. This URL must have an OIDC discovery endpoint at the path .well-known/openid-configuration.

        • entityIdPrefix — (String)

          A descriptive string that you want to prefix to user entities from your OIDC identity provider. For example, if you set an entityIdPrefix of MyOIDCProvider, you can reference principals in your policies in the format MyCorp::User::MyOIDCProvider|Carlos.

        • groupConfiguration — (map)

          The claim in OIDC identity provider tokens that indicates a user's group membership, and the entity type that you want to map it to. For example, this object can map the contents of a groups claim to MyCorp::UserGroup.

          • groupClaimrequired — (String)

            The token claim that you want Verified Permissions to interpret as group membership. For example, groups.

          • groupEntityTyperequired — (String)

            The policy store entity type that you want to map your users' group claim to. For example, MyCorp::UserGroup. A group entity type is an entity that can have a user entity type as a member.

        • tokenSelectionrequired — (map)

          The token type that you want to process from your OIDC identity provider. Your policy store can process either identity (ID) or access tokens from a given OIDC identity source.

          • accessTokenOnly — (map)

            The OIDC configuration for processing access tokens. Contains allowed audience claims, for example https://auth.example.com, and the claim that you want to map to the principal, for example sub.

            • principalIdClaim — (String)

              The claim that determines the principal in OIDC access tokens. For example, sub.

            • audiences — (Array<String>)

              The access token aud claim values that you want to accept in your policy store. For example, https://myapp.example.com, https://myapp2.example.com.

          • identityTokenOnly — (map)

            The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example 1example23456789, and the claim that you want to map to the principal, for example sub.

            • principalIdClaim — (String)

              The claim that determines the principal in OIDC access tokens. For example, sub.

            • clientIds — (Array<String>)

              The ID token audience, or client ID, claim values that you want to accept in your policy store from an OIDC identity provider. For example, 1example23456789, 2example10111213.

    • principalEntityType — (String)

      Specifies the data type of principals generated for identities authenticated by the identity source.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • createdDate — (Date)

        The date and time that the updated identity source was originally created.

      • identitySourceId — (String)

        The ID of the updated identity source.

      • lastUpdatedDate — (Date)

        The date and time that the identity source was most recently updated.

      • policyStoreId — (String)

        The ID of the policy store that contains the updated identity source.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updatePolicy(params = {}, callback) ⇒ AWS.Request

Modifies a Cedar static policy in the specified policy store. You can change only certain elements of the UpdatePolicyDefinition parameter. You can directly update only static policies. To change a template-linked policy, you must update the template instead, using UpdatePolicyTemplate.

Note:
  • If policy validation is enabled in the policy store, then updating a static policy causes Verified Permissions to validate the policy against the schema in the policy store. If the updated static policy doesn't pass validation, the operation fails and the update isn't stored.
  • When you edit a static policy, you can change only certain elements of a static policy:
    • The action referenced by the policy.
    • A condition clause, such as when and unless.
    You can't change these elements of a static policy:
    • Changing a policy from a static policy to a template-linked policy.
    • Changing the effect of a static policy from permit or forbid.
    • The principal referenced by a static policy.
    • The resource referenced by a static policy.
  • To update a template-linked policy, you must update the template instead.
Note: Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

Service Reference:

Examples:

Calling the updatePolicy operation

var params = {
  definition: { /* required */
    static: {
      statement: 'STRING_VALUE', /* required */
      description: 'STRING_VALUE'
    }
  },
  policyId: 'STRING_VALUE', /* required */
  policyStoreId: 'STRING_VALUE' /* required */
};
verifiedpermissions.updatePolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that contains the policy that you want to update.

    • policyId — (String)

      Specifies the ID of the policy that you want to update. To find this value, you can use ListPolicies.

    • definition — (map)

      Specifies the updated policy content that you want to replace on the specified policy. The content must be valid Cedar policy language text.

      You can change only the following elements from the policy definition:

      • The action referenced by the policy.

      • Any conditional clauses, such as when or unless clauses.

      You can't change the following elements:

      • Changing from static to templateLinked.

      • Changing the effect of the policy from permit or forbid.

      • The principal referenced by the policy.

      • The resource referenced by the policy.

      • static — (map)

        Contains details about the updates to be applied to a static policy.

        • description — (String)

          Specifies the description to be added to or replaced on the static policy.

        • statementrequired — (String)

          Specifies the Cedar policy language text to be added to or replaced on the static policy.

          You can change only the following elements from the original content:

          • The action referenced by the policy.

          • Any conditional clauses, such as when or unless clauses.

          You can't change the following elements:

          • Changing from StaticPolicy to TemplateLinkedPolicy.

          • The effect (permit or forbid) of the policy.

          • The principal referenced by the policy.

          • The resource referenced by the policy.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyStoreId — (String)

        The ID of the policy store that contains the policy that was updated.

      • policyId — (String)

        The ID of the policy that was updated.

      • policyType — (String)

        The type of the policy that was updated.

        Possible values include:
        • "STATIC"
        • "TEMPLATE_LINKED"
      • principal — (map)

        The principal specified in the policy's scope. This element isn't included in the response when Principal isn't present in the policy content.

        • entityTyperequired — (String)

          The type of an entity.

          Example: "entityType":"typeName"

        • entityIdrequired — (String)

          The identifier of an entity.

          "entityId":"identifier"

      • resource — (map)

        The resource specified in the policy's scope. This element isn't included in the response when Resource isn't present in the policy content.

        • entityTyperequired — (String)

          The type of an entity.

          Example: "entityType":"typeName"

        • entityIdrequired — (String)

          The identifier of an entity.

          "entityId":"identifier"

      • actions — (Array<map>)

        The action that a policy permits or forbids. For example, {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]}.

        • actionTyperequired — (String)

          The type of an action.

        • actionIdrequired — (String)

          The ID of an action.

      • createdDate — (Date)

        The date and time that the policy was originally created.

      • lastUpdatedDate — (Date)

        The date and time that the policy was most recently updated.

      • effect — (String)

        The effect of the decision that a policy returns to an authorization request. For example, "effect": "Permit".

        Possible values include:
        • "Permit"
        • "Forbid"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updatePolicyStore(params = {}, callback) ⇒ AWS.Request

Modifies the validation setting for a policy store.

Note: Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

Service Reference:

Examples:

Calling the updatePolicyStore operation

var params = {
  policyStoreId: 'STRING_VALUE', /* required */
  validationSettings: { /* required */
    mode: OFF | STRICT /* required */
  },
  description: 'STRING_VALUE'
};
verifiedpermissions.updatePolicyStore(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that you want to update

    • validationSettings — (map)

      A structure that defines the validation settings that want to enable for the policy store.

      • moderequired — (String)

        The validation mode currently configured for this policy store. The valid values are:

        • OFF – Neither Verified Permissions nor Cedar perform any validation on policies. No validation errors are reported by either service.

        • STRICT – Requires a schema to be present in the policy store. Cedar performs validation on all submitted new or updated static policies and policy templates. Any that fail validation are rejected and Cedar doesn't store them in the policy store.

        If Mode=STRICT and the policy store doesn't contain a schema, Verified Permissions rejects all static policies and policy templates because there is no schema to validate against.

        To submit a static policy or policy template without a schema, you must turn off validation.

        Possible values include:
        • "OFF"
        • "STRICT"
    • description — (String)

      Descriptive text that you can provide to help with identification of the current policy store.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyStoreId — (String)

        The ID of the updated policy store.

      • arn — (String)

        The Amazon Resource Name (ARN) of the updated policy store.

      • createdDate — (Date)

        The date and time that the policy store was originally created.

      • lastUpdatedDate — (Date)

        The date and time that the policy store was most recently updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updatePolicyTemplate(params = {}, callback) ⇒ AWS.Request

Updates the specified policy template. You can update only the description and the some elements of the policyBody.

Changes you make to the policy template content are immediately (within the constraints of eventual consistency) reflected in authorization decisions that involve all template-linked policies instantiated from this template.

Note: Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

Service Reference:

Examples:

Calling the updatePolicyTemplate operation

var params = {
  policyStoreId: 'STRING_VALUE', /* required */
  policyTemplateId: 'STRING_VALUE', /* required */
  statement: 'STRING_VALUE', /* required */
  description: 'STRING_VALUE'
};
verifiedpermissions.updatePolicyTemplate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • policyStoreId — (String)

      Specifies the ID of the policy store that contains the policy template that you want to update.

    • policyTemplateId — (String)

      Specifies the ID of the policy template that you want to update.

    • description — (String)

      Specifies a new description to apply to the policy template.

    • statement — (String)

      Specifies new statement content written in Cedar policy language to replace the current body of the policy template.

      You can change only the following elements of the policy body:

      • The action referenced by the policy template.

      • Any conditional clauses, such as when or unless clauses.

      You can't change the following elements:

      • The effect (permit or forbid) of the policy template.

      • The principal referenced by the policy template.

      • The resource referenced by the policy template.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • policyStoreId — (String)

        The ID of the policy store that contains the updated policy template.

      • policyTemplateId — (String)

        The ID of the updated policy template.

      • createdDate — (Date)

        The date and time that the policy template was originally created.

      • lastUpdatedDate — (Date)

        The date and time that the policy template was most recently updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

waitFor(state, params = {}, callback) ⇒ AWS.Request

Waits for a given VerifiedPermissions resource. The final callback or 'complete' event will be fired only when the resource is either in its final state or the waiter has timed out and stopped polling for the final state.

Parameters:

  • state (String)

    the resource state to wait for. Available states for this service are listed in "Waiter Resource States" below.

  • params (map) (defaults to: {})

    a list of parameters for the given state. See each waiter resource state for required parameters.

Callback (callback):

  • function(err, data) { ... }

    Callback containing error and data information. See the respective resource state for the expected error or data information.

    If the waiter times out its requests, it will return a ResourceNotReady error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.