Fix renew and revoke calls
This commit is contained in:
parent
b7c3b4b0d7
commit
2fb6bf9882
|
@ -153,7 +153,7 @@ func (b *databaseBackend) pathRoleCreate(req *logical.Request, data *framework.F
|
|||
CreationStatements: creationStmts,
|
||||
RevocationStatements: revocationStmts,
|
||||
RollbackStatements: rollbackStmts,
|
||||
RenewStatements: rollbackStmts,
|
||||
RenewStatements: renewStmts,
|
||||
}
|
||||
|
||||
// TODO: Think about preparing the statments to test.
|
||||
|
|
|
@ -70,7 +70,7 @@ func (b *databaseBackend) secretCredsRenew(req *logical.Request, d *framework.Fi
|
|||
if expireTime := resp.Secret.ExpirationTime(); !expireTime.IsZero() {
|
||||
expiration := expireTime.Format("2006-01-02 15:04:05-0700")
|
||||
|
||||
err := db.RenewUser(username, expiration)
|
||||
err := db.RenewUser(role.Statements, username, expiration)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -87,7 +87,6 @@ func (b *databaseBackend) secretCredsRevoke(req *logical.Request, d *framework.F
|
|||
}
|
||||
username, ok := usernameRaw.(string)
|
||||
|
||||
var revocationSQL string
|
||||
var resp *logical.Response
|
||||
|
||||
roleNameRaw, ok := req.Secret.InternalData["role"]
|
||||
|
@ -129,7 +128,7 @@ func (b *databaseBackend) secretCredsRevoke(req *logical.Request, d *framework.F
|
|||
return nil, fmt.Errorf("Could not find database with name: %s", role.DBName)
|
||||
}
|
||||
|
||||
err = db.RevokeUser(username, revocationSQL)
|
||||
err = db.RevokeUser(role.Statements, username)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue