Skip to content

Commit

Permalink
Update vault_jwt_auth_backend_role
Browse files Browse the repository at this point in the history
  • Loading branch information
lawliet89 committed Jul 31, 2019
1 parent bb45a4b commit f5ad93b
Show file tree
Hide file tree
Showing 3 changed files with 464 additions and 260 deletions.
23 changes: 13 additions & 10 deletions vault/auth_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ func commonTokenFields() []string {
}

type addTokenFieldsConfig struct {
TokenMaxTTLConflict []string
TokenPoliciesConflict []string
TokenPeriodConflict []string
TokenTTLConflict []string
TokenBoundCidrsConflict []string
TokenMaxTTLConflict []string
TokenNumUsesConflict []string
TokenPeriodConflict []string
TokenPoliciesConflict []string
TokenTTLConflict []string
}

// Common field schemas for Auth Backends
Expand Down Expand Up @@ -67,7 +69,7 @@ func addTokenFields(fields map[string]*schema.Schema, config *addTokenFieldsConf
Description: "Generated Token's Period",
Optional: true,
Computed: true,
ConflictsWith: config.TokenPeriodConflict,
ConflictsWith: append(config.TokenPeriodConflict, []string{"token_ttl"}...),
}

fields["token_policies"] = &schema.Schema{
Expand All @@ -93,14 +95,15 @@ func addTokenFields(fields map[string]*schema.Schema, config *addTokenFieldsConf
Description: "The initial ttl of the token to generate in seconds",
Optional: true,
Computed: true,
ConflictsWith: config.TokenTTLConflict,
ConflictsWith: append(config.TokenTTLConflict, []string{"token_period"}...),
}

fields["token_num_uses"] = &schema.Schema{
Type: schema.TypeInt,
Description: "The maximum number of times a token may be used, a value of zero means unlimited",
Optional: true,
Computed: true,
Type: schema.TypeInt,
Description: "The maximum number of times a token may be used, a value of zero means unlimited",
Optional: true,
Computed: true,
ConflictsWith: config.TokenNumUsesConflict,
}
}

Expand Down
Loading

0 comments on commit f5ad93b

Please sign in to comment.