Skip to content

Commit 49c3a59

Browse files
committed
code style
1 parent 0c45668 commit 49c3a59

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

grantsSSH.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ func (s SSHGrantEndpoint) DoHTTPRequest(method string, req interface{}, resp int
2727
}
2828

2929
// DoHTTPRequestWithAuth performs an http request to the ssh grant endpoint
30-
func (s SSHGrantEndpoint) DoHTTPRequestWithAuth(method string, req interface{}, resp interface{}, mytoken string) error {
30+
func (s SSHGrantEndpoint) DoHTTPRequestWithAuth(
31+
method string, req interface{}, resp interface{}, mytoken string,
32+
) error {
3133
return doHTTPRequestWithAuth(method, s.endpoint, req, resp, mytoken)
3234
}
3335

@@ -86,7 +88,8 @@ func (s SSHGrantEndpoint) Remove(mytoken *string, keyFP, publicKey string) error
8688
// If the used mytoken changes (due to token rotation), the new mytoken is returned in the non-nil *api.MytokenResponse
8789
func (s SSHGrantEndpoint) APIAdd(
8890
mytoken, sshKey, name string, restrictions api.Restrictions, capabilities, subtokenCapabilities api.Capabilities,
89-
callbacks PollingCallbacks) (response api.SSHKeyAddFinalResponse, tokenUpdate *api.MytokenResponse, err error) {
91+
callbacks PollingCallbacks,
92+
) (response api.SSHKeyAddFinalResponse, tokenUpdate *api.MytokenResponse, err error) {
9093
initRes, err := s.APIInitAddSSHKey(mytoken, sshKey, name, restrictions, capabilities, subtokenCapabilities)
9194
tokenUpdate = initRes.TokenUpdate
9295
if err != nil {
@@ -113,8 +116,10 @@ func (s SSHGrantEndpoint) Add(
113116
mytoken *string, sshKey, name string, restrictions api.Restrictions, capabilities,
114117
subtokenCapabilities api.Capabilities, callbacks PollingCallbacks,
115118
) (api.SSHKeyAddFinalResponse, error) {
116-
resp, tokenUpdate, err := s.APIAdd(*mytoken, sshKey, name, restrictions, capabilities, subtokenCapabilities,
117-
callbacks)
119+
resp, tokenUpdate, err := s.APIAdd(
120+
*mytoken, sshKey, name, restrictions, capabilities, subtokenCapabilities,
121+
callbacks,
122+
)
118123
if tokenUpdate != nil {
119124
*mytoken = tokenUpdate.Mytoken
120125
}

http.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ func doHTTPRequest(method, url string, reqBody interface{}, responseData interfa
2121
return doHTTPRequestWithAuth(method, url, reqBody, responseData, "")
2222
}
2323

24-
func doHTTPRequestWithAuth(method, url string, reqBody interface{}, responseData interface{},
25-
bearerAuth string) error {
24+
func doHTTPRequestWithAuth(
25+
method, url string, reqBody interface{}, responseData interface{},
26+
bearerAuth string,
27+
) error {
2628
b := new(bytes.Buffer)
2729
if err := json.NewEncoder(b).Encode(reqBody); err != nil {
2830
return newMytokenErrorFromError(errEncodingRequest, err)

mytoken.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ func (my MytokenEndpoint) FromMytoken(
7171
mytoken *string, issuer string, restrictions api.Restrictions, capabilities,
7272
subtokenCapabilities api.Capabilities, rotation *api.Rotation, responseType, name string,
7373
) (string, error) {
74-
resp, err := my.APIFromMytoken(*mytoken, issuer, restrictions, capabilities, subtokenCapabilities,
75-
rotation, responseType, name)
74+
resp, err := my.APIFromMytoken(
75+
*mytoken, issuer, restrictions, capabilities, subtokenCapabilities,
76+
rotation, responseType, name,
77+
)
7678
if err != nil {
7779
return "", err
7880
}
@@ -128,7 +130,9 @@ func (my MytokenEndpoint) FromAuthorizationFlow(
128130
issuer string, restrictions api.Restrictions, capabilities, subtokenCapabilities api.Capabilities,
129131
rotation *api.Rotation, responseType, name string, callbacks PollingCallbacks,
130132
) (string, error) {
131-
resp, err := my.APIFromAuthorizationFlow(issuer, restrictions, capabilities, subtokenCapabilities, rotation, responseType, name, callbacks)
133+
resp, err := my.APIFromAuthorizationFlow(
134+
issuer, restrictions, capabilities, subtokenCapabilities, rotation, responseType, name, callbacks,
135+
)
132136
return resp.Mytoken, err
133137
}
134138

0 commit comments

Comments
 (0)