Skip to content

Commit 8731f68

Browse files
author
Piotr Andruszkiewicz
committed
Refactor user path generation: replace generateUserPath with assembleUserPath for readabilty
1 parent 8e97375 commit 8731f68

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/user_manager.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const (
2020
)
2121

2222
func (um *UserManager) KeystoreStatus(scope, id string) (*keystore.Status, error) {
23-
userKeystorePath := generateUserPath(scope, id) + ".ks.json"
23+
userKeystorePath := assembleUserPath(scope, id) + ".ks.json"
2424

2525
response, err := um.instance.http.Request().Get(userKeystorePath)
2626

@@ -58,7 +58,7 @@ func (um *UserManager) KeystoreCreate(scope, id, keystorePassword string) (bool,
5858
":operation": "createStore",
5959
}
6060

61-
userKeystoreCreatePath := generateUserPath(scope, id) + ".ks.html"
61+
userKeystoreCreatePath := assembleUserPath(scope, id) + ".ks.html"
6262
postResponse, postError := um.instance.http.Request().SetQueryParams(pathParams).Post(userKeystoreCreatePath)
6363

6464
if postError != nil {
@@ -73,7 +73,7 @@ func (um *UserManager) KeystoreCreate(scope, id, keystorePassword string) (bool,
7373
}
7474

7575
func (um *UserManager) ReadState(scope string, id string) (*user.Status, error) {
76-
userPath := generateUserPath(scope, id)
76+
userPath := assembleUserPath(scope, id)
7777

7878
response, err := um.instance.http.Request().Get(userPath + ".json")
7979

@@ -100,7 +100,7 @@ func (um *UserManager) SetPassword(scope string, id string, password string) (bo
100100
return false, err
101101
}
102102

103-
userPath := generateUserPath(scope, id)
103+
userPath := assembleUserPath(scope, id)
104104

105105
passwordCheckResponse, err := um.instance.http.Request().
106106
SetBasicAuth(userStatus.AuthorizableID, password).
@@ -129,7 +129,7 @@ func (um *UserManager) SetPassword(scope string, id string, password string) (bo
129129
return true, nil
130130
}
131131

132-
func generateUserPath(scope string, id string) string {
132+
func assembleUserPath(scope string, id string) string {
133133
if scope == "" {
134134
return UsersPath + "/" + id
135135
}

0 commit comments

Comments
 (0)