Skip to content

Commit

Permalink
OIDC provider: show success message in CLI (#12574)
Browse files Browse the repository at this point in the history
  • Loading branch information
fairclothjm committed Sep 17, 2021
1 parent b882b8c commit 703638f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions vault/identity_store_oidc_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ func (i *IdentityStore) pathOIDCClientExistenceCheck(ctx context.Context, req *l

// pathOIDCCreateUpdateProvider is used to create a new named provider or update an existing one
func (i *IdentityStore) pathOIDCCreateUpdateProvider(ctx context.Context, req *logical.Request, d *framework.FieldData) (*logical.Response, error) {
resp := &logical.Response{}
var resp logical.Response
name := d.Get("name").(string)

var provider provider
Expand Down Expand Up @@ -1141,7 +1141,15 @@ func (i *IdentityStore) pathOIDCCreateUpdateProvider(ctx context.Context, req *l
return nil, err
}

return resp, req.Storage.Put(ctx, entry)
if err := req.Storage.Put(ctx, entry); err != nil {
return nil, err
}

if len(resp.Warnings) == 0 {
return nil, nil
}

return &resp, nil
}

// pathOIDCListProvider is used to list named providers
Expand Down

0 comments on commit 703638f

Please sign in to comment.