Fix renew and revoke calls

This commit is contained in:
Brian Kassouf 2017-03-07 17:21:44 -08:00
parent b7c3b4b0d7
commit 2fb6bf9882
2 changed files with 3 additions and 4 deletions

View file

@ -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.

View file

@ -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
}