Skip to content

Commit 7175022

Browse files
committed
rename a few "password"s to "TOTP"s (PR feedback)
1 parent fc12725 commit 7175022

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

apikey_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ func (ms *MfaSuite) TestAppRotateApiKey() {
346346
key := user.ApiKey
347347
must(db.Store(config.ApiKeyTable, key))
348348

349-
totp := ms.newPassword(key)
349+
totp := ms.newTOTP(key)
350350

351351
newKey := newTestKey()
352352
must(db.Store(config.ApiKeyTable, newKey))
@@ -508,7 +508,7 @@ func (ms *MfaSuite) TestApiKey_ReEncryptTOTPs() {
508508
must(newKey.Activate())
509509
must(ms.app.GetDB().Store(ms.app.GetConfig().ApiKeyTable, newKey))
510510

511-
_ = ms.newPassword(oldKey)
511+
_ = ms.newTOTP(oldKey)
512512

513513
complete, incomplete, err := newKey.ReEncryptTOTPs(storage, oldKey)
514514
ms.NoError(err)

totp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func newTOTP(db *Storage, apiKey ApiKey, issuer, name string) (TOTP, error) {
175175
return t, nil
176176
}
177177

178-
// DeleteTOTP is the http handler to delete a password.
178+
// DeleteTOTP is the http handler to delete a TOTP.
179179
func (a *App) DeleteTOTP(w http.ResponseWriter, r *http.Request) {
180180
id := r.PathValue(UUIDParam)
181181

@@ -213,7 +213,7 @@ func (a *App) DeleteTOTP(w http.ResponseWriter, r *http.Request) {
213213
jsonResponse(w, nil, http.StatusNoContent)
214214
}
215215

216-
// ValidateTOTP is the http handler to validate a password.
216+
// ValidateTOTP is the http handler to validate a TOTP.
217217
func (a *App) ValidateTOTP(w http.ResponseWriter, r *http.Request) {
218218
requestBody, err := parseValidateTOTPRequestBody(r.Body)
219219
if err != nil {

totp_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func (ms *MfaSuite) TestNewTOTP() {
119119
func (ms *MfaSuite) TestAppDeleteTOTP() {
120120
key := newTestKey()
121121
otherKey := newTestKey()
122-
testTOTP := ms.newPassword(key)
122+
testTOTP := ms.newTOTP(key)
123123

124124
ctxWithAPIKey := context.WithValue(context.Background(), UserContextKey, key)
125125
ctxWithOtherAPIKey := context.WithValue(context.Background(), UserContextKey, otherKey)
@@ -273,7 +273,7 @@ func (ms *MfaSuite) newRequest(ctx context.Context, method, path, body string) *
273273
return r.WithContext(ctx)
274274
}
275275

276-
func (ms *MfaSuite) newPassword(key ApiKey) TOTP {
276+
func (ms *MfaSuite) newTOTP(key ApiKey) TOTP {
277277
t := TOTP{
278278
UUID: NewUUID(),
279279
ApiKey: key.Key,

0 commit comments

Comments
 (0)