diff --git a/changelog/16938.txt b/changelog/16938.txt new file mode 100644 index 000000000..6fb00bfdf --- /dev/null +++ b/changelog/16938.txt @@ -0,0 +1,3 @@ +```release-note:bug +auth/token: Fix ignored parameter warnings for valid parameters on token create +``` diff --git a/vault/token_store.go b/vault/token_store.go index 0a922dcf0..f1dfb1145 100644 --- a/vault/token_store.go +++ b/vault/token_store.go @@ -157,6 +157,70 @@ func (ts *TokenStore) paths() []*framework.Path { { Pattern: "create-orphan$", + Fields: map[string]*framework.FieldSchema{ + "role_name": { + Type: framework.TypeString, + Description: "Name of the role", + }, + "display_name": { + Type: framework.TypeString, + Description: "Name to associate with this token", + }, + "explicit_max_ttl": { + Type: framework.TypeString, + Description: "Explicit Max TTL of this token", + }, + "entity_alias": { + Type: framework.TypeString, + Description: "Name of the entity alias to associate with this token", + }, + "num_uses": { + Type: framework.TypeInt, + Description: "Max number of uses for this token", + }, + "period": { + Type: framework.TypeString, + Description: "Renew period", + }, + "renewable": { + Type: framework.TypeBool, + Description: "Allow token to be renewed past its initial TTL up to system/mount maximum TTL", + }, + "ttl": { + Type: framework.TypeString, + Description: "Time to live for this token", + }, + "type": { + Type: framework.TypeString, + Description: "Token type", + }, + "no_default_policy": { + Type: framework.TypeBool, + Description: "Do not include default policy for this token", + }, + "id": { + Type: framework.TypeString, + Description: "Value for the token", + }, + "metadata": { + Type: framework.TypeMap, + Description: "Arbitrary key=value metadata to associate with the token", + }, + "no_parent": { + Type: framework.TypeBool, + Description: "Create the token with no parent", + }, + "policies": { + Type: framework.TypeStringSlice, + Description: "List of policies for the token", + }, + "format": { + Type: framework.TypeString, + Query: true, + Description: "Return json formatted output", + }, + }, + Callbacks: map[logical.Operation]framework.OperationFunc{ logical.UpdateOperation: ts.handleCreateOrphan, }, @@ -173,6 +237,63 @@ func (ts *TokenStore) paths() []*framework.Path { Type: framework.TypeString, Description: "Name of the role", }, + "display_name": { + Type: framework.TypeString, + Description: "Name to associate with this token", + }, + "explicit_max_ttl": { + Type: framework.TypeString, + Description: "Explicit Max TTL of this token", + }, + "entity_alias": { + Type: framework.TypeString, + Description: "Name of the entity alias to associate with this token", + }, + "num_uses": { + Type: framework.TypeInt, + Description: "Max number of uses for this token", + }, + "period": { + Type: framework.TypeString, + Description: "Renew period", + }, + "renewable": { + Type: framework.TypeBool, + Description: "Allow token to be renewed past its initial TTL up to system/mount maximum TTL", + }, + "ttl": { + Type: framework.TypeString, + Description: "Time to live for this token", + }, + "type": { + Type: framework.TypeString, + Description: "Token type", + }, + "no_default_policy": { + Type: framework.TypeBool, + Description: "Do not include default policy for this token", + }, + "id": { + Type: framework.TypeString, + Description: "Value for the token", + }, + "metadata": { + Type: framework.TypeMap, + Description: "Arbitrary key=value metadata to associate with the token", + }, + "no_parent": { + Type: framework.TypeBool, + Description: "Create the token with no parent", + }, + "policies": { + Type: framework.TypeStringSlice, + Description: "List of policies for the token", + }, + "format": { + Type: framework.TypeString, + Query: true, + Description: "Return json formatted output", + }, }, Callbacks: map[logical.Operation]framework.OperationFunc{ @@ -186,6 +307,66 @@ func (ts *TokenStore) paths() []*framework.Path { { Pattern: "create$", + Fields: map[string]*framework.FieldSchema{ + "display_name": { + Type: framework.TypeString, + Description: "Name to associate with this token", + }, + "explicit_max_ttl": { + Type: framework.TypeString, + Description: "Explicit Max TTL of this token", + }, + "entity_alias": { + Type: framework.TypeString, + Description: "Name of the entity alias to associate with this token", + }, + "num_uses": { + Type: framework.TypeInt, + Description: "Max number of uses for this token", + }, + "period": { + Type: framework.TypeString, + Description: "Renew period", + }, + "renewable": { + Type: framework.TypeBool, + Description: "Allow token to be renewed past its initial TTL up to system/mount maximum TTL", + }, + "ttl": { + Type: framework.TypeString, + Description: "Time to live for this token", + }, + "type": { + Type: framework.TypeString, + Description: "Token type", + }, + "no_default_policy": { + Type: framework.TypeBool, + Description: "Do not include default policy for this token", + }, + "id": { + Type: framework.TypeString, + Description: "Value for the token", + }, + "metadata": { + Type: framework.TypeMap, + Description: "Arbitrary key=value metadata to associate with the token", + }, + "no_parent": { + Type: framework.TypeBool, + Description: "Create the token with no parent", + }, + "policies": { + Type: framework.TypeStringSlice, + Description: "List of policies for the token", + }, + "format": { + Type: framework.TypeString, + Query: true, + Description: "Return json formatted output", + }, + }, + Callbacks: map[logical.Operation]framework.OperationFunc{ logical.UpdateOperation: ts.handleCreate, },