Standardize how we format deprecated values in traditional path-help (#7007)
This commit is contained in:
parent
62e14c280d
commit
fe7bb0b630
|
@ -24,7 +24,7 @@ func pathConfig(b *backend) *framework.Path {
|
|||
Fields: map[string]*framework.FieldSchema{
|
||||
"organization": &framework.FieldSchema{
|
||||
Type: framework.TypeString,
|
||||
Description: "(DEPRECATED) Okta organization to authenticate against. Use org_name instead.",
|
||||
Description: "Use org_name instead.",
|
||||
Deprecated: true,
|
||||
},
|
||||
"org_name": &framework.FieldSchema{
|
||||
|
@ -36,7 +36,7 @@ func pathConfig(b *backend) *framework.Path {
|
|||
},
|
||||
"token": &framework.FieldSchema{
|
||||
Type: framework.TypeString,
|
||||
Description: "(DEPRECATED) Okta admin API token. Use api_token instead.",
|
||||
Description: "Use api_token instead.",
|
||||
Deprecated: true,
|
||||
},
|
||||
"api_token": &framework.FieldSchema{
|
||||
|
@ -55,7 +55,7 @@ func pathConfig(b *backend) *framework.Path {
|
|||
},
|
||||
"production": &framework.FieldSchema{
|
||||
Type: framework.TypeBool,
|
||||
Description: `(DEPRECATED) Use base_url.`,
|
||||
Description: `Use base_url instead.`,
|
||||
Deprecated: true,
|
||||
},
|
||||
"ttl": &framework.FieldSchema{
|
||||
|
|
|
@ -93,15 +93,14 @@ GetFederationToken API call, acting as a filter on permissions available.`,
|
|||
},
|
||||
|
||||
"arn": &framework.FieldSchema{
|
||||
Type: framework.TypeString,
|
||||
Description: `Deprecated; use role_arns or policy_arns instead. ARN Reference to a managed policy
|
||||
or IAM role to assume`,
|
||||
Deprecated: true,
|
||||
Type: framework.TypeString,
|
||||
Description: `Use role_arns or policy_arns instead.`,
|
||||
Deprecated: true,
|
||||
},
|
||||
|
||||
"policy": &framework.FieldSchema{
|
||||
Type: framework.TypeString,
|
||||
Description: "Deprecated; use policy_document instead. IAM policy document",
|
||||
Description: "Use policy_document instead.",
|
||||
Deprecated: true,
|
||||
},
|
||||
|
||||
|
|
|
@ -68,7 +68,8 @@ Defaults to 'client'.`,
|
|||
|
||||
"lease": &framework.FieldSchema{
|
||||
Type: framework.TypeDurationSecond,
|
||||
Description: "DEPRECATED: Use ttl.",
|
||||
Description: "Use ttl instead.",
|
||||
Deprecated: true,
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
@ -257,6 +257,7 @@ func (p *Path) helpCallback(b *Backend) OperationFunc {
|
|||
Key: k,
|
||||
Type: schema.Type.String(),
|
||||
Description: description,
|
||||
Deprecated: schema.Deprecated,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -286,6 +287,7 @@ type pathTemplateData struct {
|
|||
type pathTemplateFieldData struct {
|
||||
Key string
|
||||
Type string
|
||||
Deprecated bool
|
||||
Description string
|
||||
URL bool
|
||||
}
|
||||
|
@ -300,8 +302,11 @@ Matching Route: {{.RoutePattern}}
|
|||
## PARAMETERS
|
||||
{{range .Fields}}
|
||||
{{indent 4 .Key}} ({{.Type}})
|
||||
{{if .Deprecated}}
|
||||
{{printf "(DEPRECATED) %s" .Description | indent 8}}
|
||||
{{else}}
|
||||
{{indent 8 .Description}}
|
||||
{{end}}{{end}}
|
||||
{{end}}{{end}}{{end}}
|
||||
## DESCRIPTION
|
||||
|
||||
{{.Description}}
|
||||
|
|
|
@ -218,6 +218,10 @@ func (t *TokenParams) PopulateTokenAuth(auth *logical.Auth) {
|
|||
auth.NumUses = t.TokenNumUses
|
||||
}
|
||||
|
||||
func DeprecationText(param string) string {
|
||||
return fmt.Sprintf("Use %q instead. If this and %q are both specified, only %q will be used.", param, param, param)
|
||||
}
|
||||
|
||||
const (
|
||||
tokenPeriodHelp = `If set, tokens created via this role
|
||||
will have no max lifetime; instead, their
|
||||
|
|
|
@ -850,7 +850,7 @@ func (b *SystemBackend) capabilitiesPaths() []*framework.Path {
|
|||
},
|
||||
"path": &framework.FieldSchema{
|
||||
Type: framework.TypeCommaStringSlice,
|
||||
Description: "(DEPRECATED) Path on which capabilities are being queried. Use 'paths' instead.",
|
||||
Description: "Use 'paths' instead.",
|
||||
Deprecated: true,
|
||||
},
|
||||
"paths": &framework.FieldSchema{
|
||||
|
@ -877,7 +877,7 @@ func (b *SystemBackend) capabilitiesPaths() []*framework.Path {
|
|||
},
|
||||
"path": &framework.FieldSchema{
|
||||
Type: framework.TypeCommaStringSlice,
|
||||
Description: "(DEPRECATED) Path on which capabilities are being queried. Use 'paths' instead.",
|
||||
Description: "Use 'paths' instead.",
|
||||
Deprecated: true,
|
||||
},
|
||||
"paths": &framework.FieldSchema{
|
||||
|
@ -904,7 +904,7 @@ func (b *SystemBackend) capabilitiesPaths() []*framework.Path {
|
|||
},
|
||||
"path": &framework.FieldSchema{
|
||||
Type: framework.TypeCommaStringSlice,
|
||||
Description: "(DEPRECATED) Path on which capabilities are being queried. Use 'paths' instead.",
|
||||
Description: "Use 'paths' instead.",
|
||||
Deprecated: true,
|
||||
},
|
||||
"paths": &framework.FieldSchema{
|
||||
|
|
|
@ -371,7 +371,7 @@ func (ts *TokenStore) paths() []*framework.Path {
|
|||
|
||||
"period": &framework.FieldSchema{
|
||||
Type: framework.TypeDurationSecond,
|
||||
Description: "(DEPRECATED) Use 'token_period' instead. If this and 'token_period' are both specified only 'token_period' will be used.",
|
||||
Description: "Use 'token_period' instead.",
|
||||
Deprecated: true,
|
||||
},
|
||||
|
||||
|
@ -382,7 +382,7 @@ func (ts *TokenStore) paths() []*framework.Path {
|
|||
|
||||
"explicit_max_ttl": &framework.FieldSchema{
|
||||
Type: framework.TypeDurationSecond,
|
||||
Description: "(DEPRECATED) Use 'token_explicit_max_ttl' instead. If this and 'token_explicit_max_ttl' are both specified only 'token_explicit_max_ttl' will be used.",
|
||||
Description: "Use 'token_explicit_max_ttl' instead.",
|
||||
Deprecated: true,
|
||||
},
|
||||
|
||||
|
@ -394,7 +394,7 @@ func (ts *TokenStore) paths() []*framework.Path {
|
|||
|
||||
"bound_cidrs": &framework.FieldSchema{
|
||||
Type: framework.TypeCommaStringSlice,
|
||||
Description: "(DEPRECATED) Use 'token_bound_cidrs' instead. If this and 'token_bound_cidrs' are both specified only 'token_bound_cidrs' will be used.",
|
||||
Description: "Use 'token_bound_cidrs' instead.",
|
||||
Deprecated: true,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue