Browse Source

[CLOUDTRUST-2764] Add a method to reset paper card failures

master
Francis PEROT 5 years ago
committed by sispeo
parent
commit
883b640393
  1. 7
      api/credentials.go

7
api/credentials.go

@ -14,6 +14,8 @@ const (
labelPath = credentialIDPath + "/label" labelPath = credentialIDPath + "/label"
moveFirstPath = credentialIDPath + "/moveToFirst" moveFirstPath = credentialIDPath + "/moveToFirst"
moveAfterPath = credentialIDPath + "/moveAfter/:previousCredentialID" moveAfterPath = credentialIDPath + "/moveAfter/:previousCredentialID"
// Paper card API
resetFailuresPath = "/auth/realms/:realm/papercard/users/:userId/credentials/:credentialId/resetFailures"
) )
// ResetPassword resets password of the user. // ResetPassword resets password of the user.
@ -64,3 +66,8 @@ func (c *Client) UpdatePassword(accessToken, realm, currentPassword, newPassword
var m = map[string]string{"currentPassword": currentPassword, "newPassword": newPassword, "confirmation": confirmPassword} var m = map[string]string{"currentPassword": currentPassword, "newPassword": newPassword, "confirmation": confirmPassword}
return c.post(accessToken, nil, url.Path(accountPasswordPath), url.Param("realm", realm), body.JSON(m)) return c.post(accessToken, nil, url.Path(accountPasswordPath), url.Param("realm", realm), body.JSON(m))
} }
// ResetPapercardFailures reset failures information in a paper card credential
func (c *Client) ResetPapercardFailures(accessToken, realmName, userID, credentialID string) error {
return c.put(accessToken, url.Path(resetFailuresPath), url.Param("realm", realmName), url.Param("userId", userID), url.Param("credentialId", credentialID))
}

Loading…
Cancel
Save