Skip to content

Commit

Permalink
add allow_show_password
Browse files Browse the repository at this point in the history
  • Loading branch information
BeryJu committed Jul 17, 2024
1 parent 6ea4b21 commit 2ee1d37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/resources/stage_password.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ resource "authentik_stage_password" "test" {

### Optional

- `allow_show_password` (Boolean) Defaults to `false`.
- `configure_flow` (String)
- `failed_attempts_before_cancel` (Number) Defaults to `5`.

Expand Down
9 changes: 8 additions & 1 deletion internal/provider/resource_stage_password.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,19 @@ func resourceStagePassword() *schema.Resource {
Optional: true,
Default: 5,
},
"allow_show_password": {
Type: schema.TypeBool,
Default: false,
Optional: true,
},
},
}
}

func resourceStagePasswordSchemaToProvider(d *schema.ResourceData) *api.PasswordStageRequest {
r := api.PasswordStageRequest{
Name: d.Get("name").(string),
Name: d.Get("name").(string),
AllowShowPassword: api.PtrBool(d.Get("allow_show_password").(bool)),
}

if s, sok := d.GetOk("configure_flow"); sok && s.(string) != "" {
Expand Down Expand Up @@ -95,6 +101,7 @@ func resourceStagePasswordRead(ctx context.Context, d *schema.ResourceData, m in
setWrapper(d, "configure_flow", res.ConfigureFlow.Get())
}
setWrapper(d, "failed_attempts_before_cancel", res.FailedAttemptsBeforeCancel)
setWrapper(d, "allow_show_password", res.AllowShowPassword)
return diags
}

Expand Down

0 comments on commit 2ee1d37

Please sign in to comment.