mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-26 21:21:12 +01:00
Fix a few quirks in the GCP auth backend's docs. (#3322)
This commit is contained in:
parent
96da396adf
commit
14714f399a
@ -146,7 +146,7 @@ entities attempting to login.
|
||||
|
||||
- `service_accounts` `(array: [])` - Required for `iam` roles.
|
||||
A comma-separated list of service account emails or ids.
|
||||
Defines the service accounts that login is restricted to. If set to `\*`, all
|
||||
Defines the service accounts that login is restricted to. If set to `*`, all
|
||||
service accounts are allowed (role will still be bound by project).
|
||||
|
||||
### Sample Payload
|
||||
|
||||
@ -75,7 +75,7 @@ curl -H "Authorization: Bearer $OAUTH_TOKEN" \
|
||||
|
||||
**Golang Example**
|
||||
|
||||
We use the Go OAuth2 libraries, GCP IAM API, and Vault API.
|
||||
We use the Go OAuth2 libraries, GCP IAM API, and Vault API. The example generates a token valid for the `dev-role` role (as indicated by the `aud` field of `jwtPayload`).
|
||||
|
||||
```go
|
||||
// Abbreviated imports to show libraries.
|
||||
@ -117,7 +117,7 @@ func main() {
|
||||
// 1. Generate signed JWT using IAM.
|
||||
resourceName := fmt.Sprintf("projects/%s/serviceAccounts/%s", project, serviceAccount)
|
||||
jwtPayload := map[string]interface{}{
|
||||
"aud": "auth/gcp/login",
|
||||
"aud": "vault/dev-role",
|
||||
"sub": serviceAccount,
|
||||
"exp": time.Now().Add(time.Minute * 10).Unix(),
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user