Class: Aws::VerifiedPermissions::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::VerifiedPermissions::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb
Overview
An API client for VerifiedPermissions. To construct a client, you need to configure a :region
and :credentials
.
client = Aws::VerifiedPermissions::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the developer guide.
See #initialize for a full list of supported configuration options.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
API Operations collapse
-
#batch_is_authorized(params = {}) ⇒ Types::BatchIsAuthorizedOutput
Makes a series of decisions about multiple authorization requests for one principal or resource.
-
#batch_is_authorized_with_token(params = {}) ⇒ Types::BatchIsAuthorizedWithTokenOutput
Makes a series of decisions about multiple authorization requests for one token.
-
#create_identity_source(params = {}) ⇒ Types::CreateIdentitySourceOutput
Adds an identity source to a policy store–an Amazon Cognito user pool or OpenID Connect (OIDC) identity provider (IdP).
-
#create_policy(params = {}) ⇒ Types::CreatePolicyOutput
Creates a Cedar policy and saves it in the specified policy store.
-
#create_policy_store(params = {}) ⇒ Types::CreatePolicyStoreOutput
Creates a policy store.
-
#create_policy_template(params = {}) ⇒ Types::CreatePolicyTemplateOutput
Creates a policy template.
-
#delete_identity_source(params = {}) ⇒ Struct
Deletes an identity source that references an identity provider (IdP) such as Amazon Cognito.
-
#delete_policy(params = {}) ⇒ Struct
Deletes the specified policy from the policy store.
-
#delete_policy_store(params = {}) ⇒ Struct
Deletes the specified policy store.
-
#delete_policy_template(params = {}) ⇒ Struct
Deletes the specified policy template from the policy store.
-
#get_identity_source(params = {}) ⇒ Types::GetIdentitySourceOutput
Retrieves the details about the specified identity source.
-
#get_policy(params = {}) ⇒ Types::GetPolicyOutput
Retrieves information about the specified policy.
-
#get_policy_store(params = {}) ⇒ Types::GetPolicyStoreOutput
Retrieves details about a policy store.
-
#get_policy_template(params = {}) ⇒ Types::GetPolicyTemplateOutput
Retrieve the details for the specified policy template in the specified policy store.
-
#get_schema(params = {}) ⇒ Types::GetSchemaOutput
Retrieve the details for the specified schema in the specified policy store.
-
#is_authorized(params = {}) ⇒ Types::IsAuthorizedOutput
Makes an authorization decision about a service request described in the parameters.
-
#is_authorized_with_token(params = {}) ⇒ Types::IsAuthorizedWithTokenOutput
Makes an authorization decision about a service request described in the parameters.
-
#list_identity_sources(params = {}) ⇒ Types::ListIdentitySourcesOutput
Returns a paginated list of all of the identity sources defined in the specified policy store.
-
#list_policies(params = {}) ⇒ Types::ListPoliciesOutput
Returns a paginated list of all policies stored in the specified policy store.
-
#list_policy_stores(params = {}) ⇒ Types::ListPolicyStoresOutput
Returns a paginated list of all policy stores in the calling Amazon Web Services account.
-
#list_policy_templates(params = {}) ⇒ Types::ListPolicyTemplatesOutput
Returns a paginated list of all policy templates in the specified policy store.
-
#put_schema(params = {}) ⇒ Types::PutSchemaOutput
Creates or updates the policy schema in the specified policy store.
-
#update_identity_source(params = {}) ⇒ Types::UpdateIdentitySourceOutput
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.
-
#update_policy(params = {}) ⇒ Types::UpdatePolicyOutput
Modifies a Cedar static policy in the specified policy store.
-
#update_policy_store(params = {}) ⇒ Types::UpdatePolicyStoreOutput
Modifies the validation setting for a policy store.
-
#update_policy_template(params = {}) ⇒ Types::UpdatePolicyTemplateOutput
Updates the specified policy template.
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
Methods included from ClientStubs
#api_requests, #stub_data, #stub_responses
Methods inherited from Seahorse::Client::Base
add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
447 448 449 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 447 def initialize(*args) super end |
Instance Method Details
#batch_is_authorized(params = {}) ⇒ Types::BatchIsAuthorizedOutput
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.
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.
568 569 570 571 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 568 def (params = {}, = {}) req = build_request(:batch_is_authorized, params) req.send_request() end |
#batch_is_authorized_with_token(params = {}) ⇒ Types::BatchIsAuthorizedWithTokenOutput
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.
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.
714 715 716 717 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 714 def (params = {}, = {}) req = build_request(:batch_is_authorized_with_token, params) req.send_request() end |
#create_identity_source(params = {}) ⇒ Types::CreateIdentitySourceOutput
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
Amazon Cognito user pool:
Namespace::[Entity type]::[User pool ID]|[user principal attribute]
, for exampleMyCorp::User::us-east-1_EXAMPLE|a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
.OpenID Connect (OIDC) provider:
Namespace::[Entity type]::[principalIdClaim]|[user principal attribute]
, for exampleMyCorp::User::MyOIDCProvider|a1b2c3d4-5678-90ab-cdef-EXAMPLE22222
.
856 857 858 859 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 856 def create_identity_source(params = {}, = {}) req = build_request(:create_identity_source, params) req.send_request() end |
#create_policy(params = {}) ⇒ Types::CreatePolicyOutput
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 thePolicyDefinition
.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 thePolicyDefinition
. If the policy template is ever updated, any policies linked to the policy template automatically use the updated template.
981 982 983 984 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 981 def create_policy(params = {}, = {}) req = build_request(:create_policy, params) req.send_request() end |
#create_policy_store(params = {}) ⇒ Types::CreatePolicyStoreOutput
Creates a policy store. A policy store is a container for policy resources.
1080 1081 1082 1083 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1080 def create_policy_store(params = {}, = {}) req = build_request(:create_policy_store, params) req.send_request() end |
#create_policy_template(params = {}) ⇒ Types::CreatePolicyTemplateOutput
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.
1165 1166 1167 1168 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1165 def create_policy_template(params = {}, = {}) req = build_request(:create_policy_template, params) req.send_request() end |
#delete_identity_source(params = {}) ⇒ Struct
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.
1200 1201 1202 1203 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1200 def delete_identity_source(params = {}, = {}) req = build_request(:delete_identity_source, params) req.send_request() end |
#delete_policy(params = {}) ⇒ Struct
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.
1231 1232 1233 1234 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1231 def delete_policy(params = {}, = {}) req = build_request(:delete_policy, params) req.send_request() end |
#delete_policy_store(params = {}) ⇒ Struct
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.
1257 1258 1259 1260 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1257 def delete_policy_store(params = {}, = {}) req = build_request(:delete_policy_store, params) req.send_request() end |
#delete_policy_template(params = {}) ⇒ Struct
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.
1289 1290 1291 1292 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1289 def delete_policy_template(params = {}, = {}) req = build_request(:delete_policy_template, params) req.send_request() end |
#get_identity_source(params = {}) ⇒ Types::GetIdentitySourceOutput
Retrieves the details about the specified identity source.
1352 1353 1354 1355 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1352 def get_identity_source(params = {}, = {}) req = build_request(:get_identity_source, params) req.send_request() end |
#get_policy(params = {}) ⇒ Types::GetPolicyOutput
Retrieves information about the specified policy.
1413 1414 1415 1416 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1413 def get_policy(params = {}, = {}) req = build_request(:get_policy, params) req.send_request() end |
#get_policy_store(params = {}) ⇒ Types::GetPolicyStoreOutput
Retrieves details about a policy store.
1451 1452 1453 1454 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1451 def get_policy_store(params = {}, = {}) req = build_request(:get_policy_store, params) req.send_request() end |
#get_policy_template(params = {}) ⇒ Types::GetPolicyTemplateOutput
Retrieve the details for the specified policy template in the specified policy store.
1496 1497 1498 1499 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1496 def get_policy_template(params = {}, = {}) req = build_request(:get_policy_template, params) req.send_request() end |
#get_schema(params = {}) ⇒ Types::GetSchemaOutput
Retrieve the details for the specified schema in the specified policy store.
1534 1535 1536 1537 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1534 def get_schema(params = {}, = {}) req = build_request(:get_schema, params) req.send_request() end |
#is_authorized(params = {}) ⇒ Types::IsAuthorizedOutput
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.
1638 1639 1640 1641 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1638 def (params = {}, = {}) req = build_request(:is_authorized, params) req.send_request() end |
#is_authorized_with_token(params = {}) ⇒ Types::IsAuthorizedWithTokenOutput
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
1779 1780 1781 1782 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1779 def (params = {}, = {}) req = build_request(:is_authorized_with_token, params) req.send_request() end |
#list_identity_sources(params = {}) ⇒ Types::ListIdentitySourcesOutput
Returns a paginated list of all of the identity sources defined in the specified policy store.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1870 1871 1872 1873 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1870 def list_identity_sources(params = {}, = {}) req = build_request(:list_identity_sources, params) req.send_request() end |
#list_policies(params = {}) ⇒ Types::ListPoliciesOutput
Returns a paginated list of all policies stored in the specified policy store.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1968 1969 1970 1971 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 1968 def list_policies(params = {}, = {}) req = build_request(:list_policies, params) req.send_request() end |
#list_policy_stores(params = {}) ⇒ Types::ListPolicyStoresOutput
Returns a paginated list of all policy stores in the calling Amazon Web Services account.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
2025 2026 2027 2028 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 2025 def list_policy_stores(params = {}, = {}) req = build_request(:list_policy_stores, params) req.send_request() end |
#list_policy_templates(params = {}) ⇒ Types::ListPolicyTemplatesOutput
Returns a paginated list of all policy templates in the specified policy store.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
2087 2088 2089 2090 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 2087 def list_policy_templates(params = {}, = {}) req = build_request(:list_policy_templates, params) req.send_request() end |
#put_schema(params = {}) ⇒ Types::PutSchemaOutput
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.
2143 2144 2145 2146 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 2143 def put_schema(params = {}, = {}) req = build_request(:put_schema, params) req.send_request() end |
#update_identity_source(params = {}) ⇒ Types::UpdateIdentitySourceOutput
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.
2235 2236 2237 2238 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 2235 def update_identity_source(params = {}, = {}) req = build_request(:update_identity_source, params) req.send_request() end |
#update_policy(params = {}) ⇒ Types::UpdatePolicyOutput
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.
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.
2366 2367 2368 2369 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 2366 def update_policy(params = {}, = {}) req = build_request(:update_policy, params) req.send_request() end |
#update_policy_store(params = {}) ⇒ Types::UpdatePolicyStoreOutput
Modifies the validation setting for a policy store.
2420 2421 2422 2423 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 2420 def update_policy_store(params = {}, = {}) req = build_request(:update_policy_store, params) req.send_request() end |
#update_policy_template(params = {}) ⇒ Types::UpdatePolicyTemplateOutput
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.
2500 2501 2502 2503 |
# File 'gems/aws-sdk-verifiedpermissions/lib/aws-sdk-verifiedpermissions/client.rb', line 2500 def update_policy_template(params = {}, = {}) req = build_request(:update_policy_template, params) req.send_request() end |