diff --git a/api/credentials.go b/api/credentials.go index fa7a4bf..6a3d463 100644 --- a/api/credentials.go +++ b/api/credentials.go @@ -14,6 +14,8 @@ const ( labelPath = credentialIDPath + "/label" moveFirstPath = credentialIDPath + "/moveToFirst" moveAfterPath = credentialIDPath + "/moveAfter/:previousCredentialID" + // Paper card API + resetFailuresPath = "/auth/realms/:realm/papercard/users/:userId/credentials/:credentialId/resetFailures" ) // 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} 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)) +}