rules
Creates, updates, deletes, gets or lists a rules resource.
Overview​
| Name | rules |
| Type | Resource |
| Id | okta.authorizationservers.rules |
Fields​
The following fields are returned by SELECT queries:
- get_authorization_server_policy_rule
- list_authorization_server_policy_rules
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier of the rule |
name | string | Name of the rule |
_links | object | Specifies link relations (see Web Linking) available using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations. |
actions | string | (opaque JSON object) |
conditions | object | |
created | string (date-time) | Timestamp when the rule was created |
lastUpdated | string (date-time) | Timestamp when the rule was last modified |
priority | integer | Priority of the rule |
status | string | Status of the rule (ACTIVE, INACTIVE) |
system | boolean | Set to true for system rules. You can't delete system rules. |
type | string | Rule type (RESOURCE_ACCESS) |
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier of the rule |
name | string | Name of the rule |
_links | object | Specifies link relations (see Web Linking) available using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations. |
actions | string | (opaque JSON object) |
conditions | object | |
created | string (date-time) | Timestamp when the rule was created |
lastUpdated | string (date-time) | Timestamp when the rule was last modified |
priority | integer | Priority of the rule |
status | string | Status of the rule (ACTIVE, INACTIVE) |
system | boolean | Set to true for system rules. You can't delete system rules. |
type | string | Rule type (RESOURCE_ACCESS) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_authorization_server_policy_rule | select | authServerId, policyId, ruleId, subdomain | Retrieves a policy rule by ruleId | |
list_authorization_server_policy_rules | select | authServerId, policyId, subdomain | Lists all policy rules for the specified Custom Authorization Server and Policy | |
create_authorization_server_policy_rule | insert | authServerId, policyId, subdomain, name, conditions, type | Creates a policy rule for the specified Custom Authorization Server and Policy | |
replace_authorization_server_policy_rule | replace | authServerId, policyId, ruleId, subdomain, name, conditions, type | Replaces the configuration of the Policy Rule defined in the specified Custom Authorization Server and Policy | |
delete_authorization_server_policy_rule | delete | authServerId, policyId, ruleId, subdomain | Deletes a Policy Rule defined in the specified Custom Authorization Server and Policy | |
activate_authorization_server_policy_rule | exec | authServerId, policyId, ruleId, subdomain | Activates an authorization server policy rule | |
deactivate_authorization_server_policy_rule | exec | authServerId, policyId, ruleId, subdomain | Deactivates an authorization server policy rule |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
authServerId | string | id of the Authorization Server |
policyId | string | id of the policy |
ruleId | string | id of the policy rule |
subdomain | string | (default: my-org) |
SELECT examples​
- get_authorization_server_policy_rule
- list_authorization_server_policy_rules
Retrieves a policy rule by ruleId
SELECT
id,
name,
_links,
actions,
conditions,
created,
lastUpdated,
priority,
status,
system,
type
FROM okta.authorizationservers.rules
WHERE authServerId = '{{ authServerId }}' -- required
AND policyId = '{{ policyId }}' -- required
AND ruleId = '{{ ruleId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;
Lists all policy rules for the specified Custom Authorization Server and Policy
SELECT
id,
name,
_links,
actions,
conditions,
created,
lastUpdated,
priority,
status,
system,
type
FROM okta.authorizationservers.rules
WHERE authServerId = '{{ authServerId }}' -- required
AND policyId = '{{ policyId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;
INSERT examples​
- create_authorization_server_policy_rule
- Manifest
Creates a policy rule for the specified Custom Authorization Server and Policy
INSERT INTO okta.authorizationservers.rules (
actions,
conditions,
name,
priority,
status,
system,
type,
authServerId,
policyId,
subdomain
)
SELECT
'{{ actions }}',
'{{ conditions }}' /* required */,
'{{ name }}' /* required */,
{{ priority }},
'{{ status }}',
{{ system }},
'{{ type }}' /* required */,
'{{ authServerId }}',
'{{ policyId }}',
'{{ subdomain }}'
RETURNING
id,
name,
_links,
actions,
conditions,
created,
lastUpdated,
priority,
status,
system,
type
;
# Description fields are for documentation purposes
- name: rules
props:
- name: authServerId
value: "{{ authServerId }}"
description: Required parameter for the rules resource.
- name: policyId
value: "{{ policyId }}"
description: Required parameter for the rules resource.
- name: subdomain
value: "{{ subdomain }}"
description: Required parameter for the rules resource.
- name: actions
value: "{{ actions }}"
description: |
(opaque JSON object)
- name: conditions
value:
grantTypes:
include:
- "{{ include }}"
people:
groups:
include:
- "{{ include }}"
users:
include:
- "{{ include }}"
scopes:
include:
- "{{ include }}"
- name: name
value: "{{ name }}"
description: |
Name of the rule
- name: priority
value: {{ priority }}
description: |
Priority of the rule
- name: status
value: "{{ status }}"
description: |
Status of the rule
valid_values: ['ACTIVE', 'INACTIVE']
- name: system
value: {{ system }}
description: |
Set to `true` for system rules. You can't delete system rules.
- name: type
value: "{{ type }}"
description: |
Rule type
valid_values: ['RESOURCE_ACCESS']
REPLACE examples​
- replace_authorization_server_policy_rule
Replaces the configuration of the Policy Rule defined in the specified Custom Authorization Server and Policy
REPLACE okta.authorizationservers.rules
SET
actions = '{{ actions }}',
conditions = '{{ conditions }}',
name = '{{ name }}',
priority = {{ priority }},
status = '{{ status }}',
system = {{ system }},
type = '{{ type }}'
WHERE
authServerId = '{{ authServerId }}' --required
AND policyId = '{{ policyId }}' --required
AND ruleId = '{{ ruleId }}' --required
AND subdomain = '{{ subdomain }}' --required
AND name = '{{ name }}' --required
AND conditions = '{{ conditions }}' --required
AND type = '{{ type }}' --required
RETURNING
id,
name,
_links,
actions,
conditions,
created,
lastUpdated,
priority,
status,
system,
type;
DELETE examples​
- delete_authorization_server_policy_rule
Deletes a Policy Rule defined in the specified Custom Authorization Server and Policy
DELETE FROM okta.authorizationservers.rules
WHERE authServerId = '{{ authServerId }}' --required
AND policyId = '{{ policyId }}' --required
AND ruleId = '{{ ruleId }}' --required
AND subdomain = '{{ subdomain }}' --required
;
Lifecycle Methods​
- activate_authorization_server_policy_rule
- deactivate_authorization_server_policy_rule
Activates an authorization server policy rule
EXEC okta.authorizationservers.rules.activate_authorization_server_policy_rule
@authServerId='{{ authServerId }}' --required,
@policyId='{{ policyId }}' --required,
@ruleId='{{ ruleId }}' --required,
@subdomain='{{ subdomain }}' --required
;
Deactivates an authorization server policy rule
EXEC okta.authorizationservers.rules.deactivate_authorization_server_policy_rule
@authServerId='{{ authServerId }}' --required,
@policyId='{{ policyId }}' --required,
@ruleId='{{ ruleId }}' --required,
@subdomain='{{ subdomain }}' --required
;