> For the complete documentation index, see [llms.txt](https://docs.enclaive.cloud/nitride/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enclaive.cloud/nitride/api/policies.md).

# Policies

## Update policy

> Updates an existing policy configuration

```json
{"openapi":"3.0.2","info":{"title":"Enclaive auth-ratls API","version":"0.0.0-0"},"servers":[{"url":"http://localhost:8200","description":"Local development server"}],"paths":{"/v1/auth/ratls/policies":{"post":{"tags":["Policies"],"summary":"Update policy","description":"Updates an existing policy configuration","operationId":"updatePolicy","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoliciesUpdate_policiesRequest"}}}},"responses":{"200":{"description":"Policy updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoliciesUpdate_policiesResponse"}}}},"400":{"description":"Invalid request body or policy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoliciesUpdate_policiesResponse"}}}}}}}},"components":{"schemas":{"PoliciesUpdate_policiesRequest":{"type":"object","properties":{"created":{"type":"integer","description":"Creation timestamp, set by the plugin","format":"int64"},"identities":{"type":"object","description":"A map of all identity types with their respective selector","format":"map","default":{"provider":"azure-sev-snp-vtpm","platform":null,"firmware":[{"name":"azure-dc2asv5","policy":null},{"name":"azure-dc4asv5","policy":null}],"workload":{"name":"azure-ubuntu","policy":{"pcrs.0":false}},"metadata":null}},"name":{"type":"string","description":"Name of the policy"}},"required":["created","identities","name"]},"PoliciesUpdate_policiesResponse":{"type":"object","properties":{"auth":{"type":"object"},"data":{"type":"object","properties":{"created":{"type":"integer","description":"Creation timestamp, set by the plugin","format":"int64"},"identities":{"type":"object","description":"A map of all identity types with their respective selector","format":"map","default":{"provider":"azure-sev-snp-vtpm","platform":null,"firmware":[{"name":"azure-dc2asv5","policy":null},{"name":"azure-dc4asv5","policy":null}],"workload":{"name":"azure-ubuntu","policy":{"pcrs.0":false}},"metadata":null}},"name":{"type":"string","description":"Name of the policy"}}}}}}}}
```

## Create policy

> Creates a new policy configuration

```json
{"openapi":"3.0.2","info":{"title":"Enclaive auth-ratls API","version":"0.0.0-0"},"servers":[{"url":"http://localhost:8200","description":"Local development server"}],"paths":{"/v1/auth/ratls/policies":{"put":{"tags":["Policies"],"summary":"Create policy","description":"Creates a new policy configuration","operationId":"createPolicy","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoliciesCreate_policiesRequest"}}}},"responses":{"200":{"description":"Policy created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoliciesCreate_policiesResponse"}}}},"400":{"description":"Invalid request body"}}}}},"components":{"schemas":{"PoliciesCreate_policiesRequest":{"type":"object","properties":{"created":{"type":"integer","description":"Creation timestamp, set by the plugin","format":"int64"},"identities":{"type":"object","description":"A map of all identity types with their respective selector","format":"map","default":{"provider":"azure-sev-snp-vtpm","platform":null,"firmware":[{"name":"azure-dc2asv5","policy":null},{"name":"azure-dc4asv5","policy":null}],"workload":{"name":"azure-ubuntu","policy":{"pcrs.0":false}},"metadata":null}},"name":{"type":"string","description":"Name of the policy"}},"required":["created","identities","name"]},"PoliciesCreate_policiesResponse":{"type":"object","properties":{"auth":{"type":"object"},"data":{"type":"object","properties":{"created":{"type":"integer","description":"Creation timestamp, set by the plugin","format":"int64"},"identities":{"type":"object","description":"A map of all identity types with their respective selector","format":"map","default":{"provider":"azure-sev-snp-vtpm","platform":null,"firmware":[{"name":"azure-dc2asv5","policy":null},{"name":"azure-dc4asv5","policy":null}],"workload":{"name":"azure-ubuntu","policy":{"pcrs.0":false}},"metadata":null}},"name":{"type":"string","description":"Name of the policy"}}}}}}}}
```

## List all policies

> Retrieves a list of all policy configurations

```json
{"openapi":"3.0.2","info":{"title":"Enclaive auth-ratls API","version":"0.0.0-0"},"servers":[{"url":"http://localhost:8200","description":"Local development server"}],"paths":{"/v1/auth/ratls/policies/":{"get":{"tags":["Policies"],"summary":"List all policies","description":"Retrieves a list of all policy configurations","operationId":"listPolicies","parameters":[{"name":"list","description":"Must be set to 'true' to retrieve the list","in":"query","schema":{"type":"string","enum":["true"]},"required":true}],"responses":{"200":{"description":"Policy list retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoliciesList_policiesResponse"}}}}}}}},"components":{"schemas":{"PoliciesList_policiesResponse":{"type":"object","properties":{"request_id":{"type":"string"},"lease_id":{"type":"string"},"renewable":{"type":"boolean"},"lease_duration":{"type":"integer"},"data":{"type":"object","properties":{"keys":{"type":"array","description":"List of policy names","items":{"type":"string"}}}},"wrap_info":{"type":"null"},"warnings":{"type":"null"},"auth":{"type":"null"}}}}}}
```

## Get policy details

> Retrieves detailed information about a specific policy

```json
{"openapi":"3.0.2","info":{"title":"Enclaive auth-ratls API","version":"0.0.0-0"},"servers":[{"url":"http://localhost:8200","description":"Local development server"}],"paths":{"/v1/auth/ratls/policies/{name}":{"get":{"tags":["Policies"],"summary":"Get policy details","description":"Retrieves detailed information about a specific policy","operationId":"getPolicy","responses":{"200":{"description":"Policy details retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoliciesRead_policiesNameResponse"}}}},"400":{"description":"Policy not found"}}}}},"components":{"schemas":{"PoliciesRead_policiesNameResponse":{"type":"object","properties":{"request_id":{"type":"string"},"lease_id":{"type":"string"},"renewable":{"type":"boolean"},"lease_duration":{"type":"integer"},"data":{"type":"object","properties":{"created":{"type":"integer","description":"Creation timestamp, set by the plugin","format":"int64"},"identities":{"type":"object","description":"A map of all identity types with their respective selector","properties":{"firmware":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"policy":{"type":"object","additionalProperties":{"type":"boolean"}}}}},"metadata":{"type":"object","properties":{"name":{"type":"string"},"policy":{"type":["object","null"],"additionalProperties":{"type":"boolean"}}}},"platform":{"type":["object","null"]},"provider":{"type":"string"},"workload":{"type":"object","properties":{"name":{"type":"string"},"policy":{"type":"object","additionalProperties":{"type":"boolean"}}}}}},"name":{"type":"string","description":"Name of the policy"}}},"wrap_info":{"type":"null"},"warnings":{"type":"null"},"auth":{"type":"null"}}}}}}
```

## Delete policy

> Removes a specific policy configuration

```json
{"openapi":"3.0.2","info":{"title":"Enclaive auth-ratls API","version":"0.0.0-0"},"servers":[{"url":"http://localhost:8200","description":"Local development server"}],"paths":{"/v1/auth/ratls/policies/{name}":{"delete":{"tags":["Policies"],"summary":"Delete policy","description":"Removes a specific policy configuration","operationId":"deletePolicy","responses":{"200":{"description":"Policy deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoliciesDelete_Response"}}}},"400":{"description":"Policy not found or invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoliciesDelete_Response"}}}}}}}},"components":{"schemas":{"PoliciesDelete_Response":{"type":"object","properties":{"request_id":{"type":"string"},"lease_id":{"type":"string"},"renewable":{"type":"boolean"},"lease_duration":{"type":"integer"},"data":{"type":"object"},"wrap_info":{"type":"null"},"warnings":{"type":"null"},"auth":{"type":"null"}}}}}}
```
