-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update sidebar structure (#203)
- Loading branch information
Showing
17 changed files
with
161 additions
and
154 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Create Your First Appeal | ||
# Create an appeal | ||
|
||
**Note:** | ||
|
||
1. Get the `resource_id` of Playground dataset in our example ([Steps](./update-resource#getting-the-resourceid-for-the-resource)) | ||
2. Currently we support creating an Appeal via the API only | ||
|
||
|
@@ -20,70 +21,67 @@ $ curl --request POST '{{HOST}}/api/v1beta1/appeals' \ | |
] | ||
}' | ||
``` | ||
|
||
**Note:** Refer to the [Appeal Request](../reference/api#appeal-request-config) Configurations for more details | ||
|
||
**The Response after creating the appeal is as follows:** | ||
|
||
```json | ||
{ | ||
"appeals": [ | ||
"appeals": [ | ||
{ | ||
"id": "<< appeal id >>", | ||
"resource_id": "<< playground resource id >>", | ||
"policy_id": "my-first-policy", | ||
"policy_version": 1, | ||
"status": "pending", | ||
"account_id": "[email protected]", | ||
"role": "viewer", | ||
"resource": { | ||
"id": "<< playground resource id >>", | ||
"provider_type": "bigquery", | ||
"provider_urn": "my-first-bigquery-provider", | ||
"type": "dataset", | ||
"urn": "<<my-bq-project-id>>:playground", | ||
"name": "playground", | ||
"details": { | ||
"owner": "[email protected]" | ||
}, | ||
"created_at": "2022-06-30T10:46:03.608245Z", | ||
"updated_at": "2022-06-30T10:50:22.966110Z" | ||
}, | ||
"approvals": [ | ||
{ | ||
"id": "<< approval id 1 >>", | ||
"name": "resource_owner_approval", | ||
"appeal_id": "<< appeal id >>", | ||
"status": "pending", | ||
"policy_id": "my-first-policy", | ||
"policy_version": 1, | ||
"approvers": ["[email protected]"], | ||
"created_at": "2022-06-30T10:55:48.712177Z", | ||
"updated_at": "2022-06-30T10:55:48.712177Z" | ||
}, | ||
{ | ||
"id": "<< appeal id >>", | ||
"resource_id": "<< playground resource id >>", | ||
"policy_id": "my-first-policy", | ||
"policy_version": 1, | ||
"status": "pending", | ||
"account_id": "[email protected]", | ||
"role": "viewer", | ||
"resource": { | ||
"id": "<< playground resource id >>", | ||
"provider_type": "bigquery", | ||
"provider_urn": "my-first-bigquery-provider", | ||
"type": "dataset", | ||
"urn": "<<my-bq-project-id>>:playground", | ||
"name": "playground", | ||
"details": { | ||
"owner": "[email protected]" | ||
}, | ||
"created_at": "2022-06-30T10:46:03.608245Z", | ||
"updated_at": "2022-06-30T10:50:22.966110Z" | ||
}, | ||
"approvals": [ | ||
{ | ||
"id": "<< approval id 1 >>", | ||
"name": "resource_owner_approval", | ||
"appeal_id": "<< appeal id >>", | ||
"status": "pending", | ||
"policy_id": "my-first-policy", | ||
"policy_version": 1, | ||
"approvers": [ | ||
"[email protected]" | ||
], | ||
"created_at": "2022-06-30T10:55:48.712177Z", | ||
"updated_at": "2022-06-30T10:55:48.712177Z" | ||
}, | ||
{ | ||
"id": "<< approval id 2 >>", | ||
"name": "admin_approval", | ||
"appeal_id": "<< appeal id >>", | ||
"status": "blocked", | ||
"policy_id": "my-first-policy", | ||
"policy_version": 1, | ||
"approvers": [ | ||
"[email protected]" | ||
], | ||
"created_at": "2022-06-30T10:55:48.712177Z", | ||
"updated_at": "2022-06-30T10:55:48.712177Z" | ||
} | ||
], | ||
"created_at": "2022-06-30T10:55:48.704006Z", | ||
"updated_at": "2022-06-30T10:55:48.704006Z", | ||
"revoked_at": "0001-01-01T00:00:00Z", | ||
"details": {}, | ||
"account_type": "user", | ||
"created_by": "[email protected]", | ||
"creator": null | ||
"id": "<< approval id 2 >>", | ||
"name": "admin_approval", | ||
"appeal_id": "<< appeal id >>", | ||
"status": "blocked", | ||
"policy_id": "my-first-policy", | ||
"policy_version": 1, | ||
"approvers": ["[email protected]"], | ||
"created_at": "2022-06-30T10:55:48.712177Z", | ||
"updated_at": "2022-06-30T10:55:48.712177Z" | ||
} | ||
] | ||
], | ||
"created_at": "2022-06-30T10:55:48.704006Z", | ||
"updated_at": "2022-06-30T10:55:48.704006Z", | ||
"revoked_at": "0001-01-01T00:00:00Z", | ||
"details": {}, | ||
"account_type": "user", | ||
"created_by": "[email protected]", | ||
"creator": null | ||
} | ||
] | ||
} | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,41 @@ | ||
import Tabs from "@theme/Tabs"; | ||
import TabItem from "@theme/TabItem"; | ||
|
||
# Create Your First Policy | ||
# Create a policy | ||
|
||
### Pre-Requisites | ||
### Pre-Requisites | ||
|
||
1. [Setting up server](../getting_started/configuration.md#starting-the-server) | ||
2. [Setting up the CLI](../getting_started/configuration.md#client-configuration) (if you want to create policy using CLI) | ||
1. [Setting up server](./configuration.md#starting-the-server) | ||
2. [Setting up the CLI](./configuration.md#client-configuration) (if you want to create policy using CLI) | ||
|
||
### Example Policy | ||
|
||
```yaml | ||
id: my-first-policy | ||
steps: | ||
- name: resource_owner_approval | ||
description: approval from resource owner | ||
strategy: manual | ||
approvers: | ||
- $appeal.resource.details.owner | ||
- name: admin_approval | ||
description: approval from admin (John Doe) | ||
strategy: manual | ||
approvers: | ||
- [email protected] | ||
- name: resource_owner_approval | ||
description: approval from resource owner | ||
strategy: manual | ||
approvers: | ||
- $appeal.resource.details.owner | ||
- name: admin_approval | ||
description: approval from admin (John Doe) | ||
strategy: manual | ||
approvers: | ||
- [email protected] | ||
``` | ||
Check [policy reference](../reference/policy.md) for more details on the policy configuration.<br/> | ||
**Explanation of this Policy example**<br/> | ||
When a Guardian user creates an appeal to the BigQuery resource (Playground here), this policy will applied, and the approvals required to approve that appeal are in the order as follows: <br/> | ||
When a Guardian user creates an appeal to the BigQuery resource (Playground here), this policy will applied, and the approvals required to approve that appeal are in the order as follows: <br/> | ||
1. Approval from the resource owner ( this information is contained in the resource details object), and | ||
2. Approval from John Doe as an admin | ||
#### Policies can be created in the following ways: | ||
1. Using `guardian policy create` CLI command | ||
1. Using `guardian policy create` CLI command | ||
2. Calling to `POST /api/v1beta1/policies` API | ||
|
||
<Tabs groupId="api"> | ||
|
@@ -75,4 +77,4 @@ $ curl --request POST '{{HOST}}/api/v1beta1/policies' \ | |
</TabItem> | ||
</Tabs> | ||
|
||
**Note** : For using the CLI tool, create a Policy.yaml file using the example configurations shown above and provide the path to it here. | ||
**Note** : For using the CLI tool, create a Policy.yaml file using the example configurations shown above and provide the path to it here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import Tabs from "@theme/Tabs"; | ||
import TabItem from "@theme/TabItem"; | ||
|
||
# Update Resource Metadata | ||
# Update resource | ||
|
||
We will try to update a resource information in this example exercise. Let's say we want to add owner's information to the `playground` dataset. | ||
|
||
|
@@ -49,10 +49,12 @@ $ guardian resource view {{resource_id}} | |
```bash | ||
$ curl --request GET '{{HOST}}/api/v1beta1/resources/{{resource_id}}' | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
To update the resource metadata with this information add this to the resource file or request body | ||
|
||
```yaml | ||
details: | ||
owner: [email protected] | ||
|
@@ -84,4 +86,4 @@ $ curl --request PUT '{{HOST}}/api/v1beta1/resources/{{resource_id}}' \ | |
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
</Tabs> |
File renamed without changes.
Oops, something went wrong.