@@ -14,7 +14,7 @@ import (
14
14
logrus "github.com/sirupsen/logrus"
15
15
)
16
16
17
- const gitlabSiginPath = "/users/sign_in"
17
+ const gitlabSignInPath = "/users/sign_in"
18
18
const gitlabPersonalAccessTokenURLPath = "/profile/personal_access_tokens"
19
19
20
20
// GitLabTokenRequest describes the token Request
@@ -38,7 +38,7 @@ func CreateToken(gr GitLabTokenRequest) (string, error) {
38
38
Jar : jar ,
39
39
}
40
40
41
- loginURL , err := url .Parse (gr .URL + gitlabSiginPath )
41
+ loginURL , err := url .Parse (gr .URL + gitlabSignInPath )
42
42
43
43
if err != nil {
44
44
return "" , err
@@ -66,7 +66,7 @@ func CreateToken(gr GitLabTokenRequest) (string, error) {
66
66
if err != nil {
67
67
return "" , err
68
68
}
69
- token , err := findPersonaAccessToken (responseBody )
69
+ token , err := findPersonalAccessToken (responseBody )
70
70
if err != nil {
71
71
return "" , err
72
72
}
@@ -121,18 +121,18 @@ func addExpiry(values url.Values, date string) (url.Values, error) {
121
121
}
122
122
dateparts := strings .Split (date , "-" )
123
123
if len (dateparts ) < 3 {
124
- return nil , errors .New ("Date is to short it should be formatted like this 2017-12-03" )
124
+ return nil , errors .New ("Date is too short it should be formatted like this 2017-12-03" )
125
125
}
126
126
127
127
if len (dateparts [0 ]) < 4 {
128
- return nil , errors .New ("Year is to short" )
128
+ return nil , errors .New ("Year is too short" )
129
129
}
130
130
131
131
if len (dateparts [1 ]) < 2 {
132
- return nil , errors .New ("Month is to short needs to be with zero digest" )
132
+ return nil , errors .New ("Month is too short needs to be with zero digest" )
133
133
}
134
134
if len (dateparts [2 ]) < 2 {
135
- return nil , errors .New ("Day is to short needs to be with zero digest" )
135
+ return nil , errors .New ("Day is too short needs to be with zero digest" )
136
136
}
137
137
values .Add ("personal_access_token[expires_at]" , date )
138
138
return values , nil
@@ -154,7 +154,7 @@ func findCSRFToken(htmlBody string) map[string]string {
154
154
return m
155
155
}
156
156
157
- func findPersonaAccessToken (htmlBody string ) (string , error ) {
157
+ func findPersonalAccessToken (htmlBody string ) (string , error ) {
158
158
doc := soup .HTMLParse (htmlBody )
159
159
found := doc .Find ("input" , "id" , "created-personal-access-token" )
160
160
if found .Pointer == nil {
0 commit comments