vault/ui/tests/helpers/secret-engine/policy-generator.ts
Angel Garbarino 2c3c585d70
Add identity_token_key to Azure and GCP secret engines (#28822)
* changes then onto tests

* fix wif test failures

* changelog

* clean up

* address pr comments

* only test one wif engine for relevant tests

* add back engine loop for tests that depend on type
2024-11-08 16:32:05 +00:00

37 lines
1.0 KiB
TypeScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
// This policy can mount a secret engine
// and list and create oidc keys, relevant for setting identity_key_token for WIF
export const adminOidcCreateRead = (mountPath: string) => {
return `
path "sys/mounts/*" {
capabilities = ["create", "read", "update", "delete", "list"]
},
path "identity/oidc/key/*" {
capabilities = ["create", "read", "update", "delete", "list"]
},
path "${mountPath}/*" {
capabilities = ["create", "read", "update", "delete", "list"]
},
`;
};
// This policy can mount the engine
// But does not have access to oidc/key list or read
export const adminOidcCreate = (mountPath: string) => {
return `
path "sys/mounts/*" {
capabilities = ["create", "read", "update", "delete", "list"]
},
path "${mountPath}/*" {
capabilities = ["create", "read", "update", "delete", "list"]
},
path "identity/oidc/key/*" {
capabilities = ["create", "update"]
},
`;
};