Skip to content

Commit 6917e33

Browse files
committed
update linting
1 parent 22c218a commit 6917e33

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

auth/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
type SessionCheck struct {
1313
SessionManager session.Manager
1414
AuthURL string
15-
AclHandler func(events.Request, session.Session) (bool, error)
15+
ACLHandler func(events.Request, session.Session) (bool, error)
1616
}
1717

1818
// AuthFunc checks for valid auth using GitHub OAuth
@@ -40,7 +40,7 @@ func (sc *SessionCheck) AuthFunc(req events.Request) (events.Response, error) {
4040
return events.Redirect(authURL.String(), 303)
4141
}
4242

43-
allowed, err := sc.AclHandler(req, sess)
43+
allowed, err := sc.ACLHandler(req, sess)
4444
if err != nil {
4545
return events.Fail("failed to authenticate request")
4646
}

custom.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
set -xeuo pipefail
44

5-
go get github.com/omeid/go-resources/cmd/resources
5+
go get github.com/akerl/go-resources/cmd/resources
66
go generate

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ module github.com/akerl/github-auth-lambda
22

33
require (
44
github.com/akerl/go-lambda v0.1.0
5+
github.com/akerl/go-resources v0.0.0-20190324001828-2629d65f497f // indirect
56
github.com/google/go-github/v24 v24.0.1
67
github.com/google/uuid v1.1.1
78
github.com/gorilla/securecookie v1.1.1
8-
github.com/omeid/go-resources v0.0.0-20171025031226-ca9993b7d1a4 // indirect
99
github.com/osteele/liquid v1.2.4 // indirect
1010
github.com/osteele/tuesday v1.0.3 // indirect
1111
golang.org/x/oauth2 v0.0.0-20190319182350-c85d3e98c914

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
22
github.com/akerl/go-lambda v0.1.0 h1:znaUi5ghiIRtnEcVY4zUZhW7tz7IxxVjRgwFWkFTMbY=
33
github.com/akerl/go-lambda v0.1.0/go.mod h1:vyT/70Td9NXHw2U6y+FELwC4r1gZLlt3VwQfmLOoG+c=
4+
github.com/akerl/go-resources v0.0.0-20190324001828-2629d65f497f h1:U8/oCo1gQlDOHnmAtc91QrPetZl70xuRzlSqOICtbFo=
5+
github.com/akerl/go-resources v0.0.0-20190324001828-2629d65f497f/go.mod h1:kTD1nW2bNr87kMBl4Q/4tmKjb/C04vybCy0Wtgixk6M=
46
github.com/aws/aws-lambda-go v1.8.1 h1:nHBpP6XC30bwF6qWKrw/BrK2A8i4GKmSZzajTBIJS4A=
57
github.com/aws/aws-lambda-go v1.8.1/go.mod h1:zUsUQhAUjYzR8AuduJPCfhBuKWUaDbQiPOG+ouzmE1A=
68
github.com/aws/aws-sdk-go-v2 v0.7.0 h1:a5xRI/tBmUFKuAA0SOyEY2P1YhQb+jVOEI9P/7KfrP0=
@@ -25,8 +27,6 @@ github.com/gucumber/gucumber v0.0.0-20180127021336-7d5c79e832a2/go.mod h1:YbdHRK
2527
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
2628
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
2729
github.com/nlopes/slack v0.5.0/go.mod h1:jVI4BBK3lSktibKahxBF74txcK2vyvkza1z/+rRnVAM=
28-
github.com/omeid/go-resources v0.0.0-20171025031226-ca9993b7d1a4 h1:Uv6HZs0LhOEByIbxsZ+Ph0hMAfrv+aCkqhZpKVCY5wU=
29-
github.com/omeid/go-resources v0.0.0-20171025031226-ca9993b7d1a4/go.mod h1:SIESmZeFlCKsQZcd2NEiX8spNNmCWB1V/RbM/eBKDfo=
3030
github.com/osteele/liquid v1.2.4 h1:ydm/FoHn/cStyN7Fpar4L/ClyRKc9rZ+Qzb+S3OMOT4=
3131
github.com/osteele/liquid v1.2.4/go.mod h1:jhgMyQFVoV0grH2MKvpMbgxFSBezOoXUbgiwnYrKJ2c=
3232
github.com/osteele/tuesday v1.0.3 h1:SrCmo6sWwSgnvs1bivmXLvD7Ko9+aJvvkmDjB5G4FTU=

router.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ func success(req events.Request, sess session.Session) (events.Response, error)
3333
}
3434

3535
func redirect(req events.Request, sess session.Session, target string) (events.Response, error) {
36-
if target == "" {
37-
target = "https://" + req.Headers["Host"]
36+
respTarget := target
37+
if respTarget == "" {
38+
respTarget = "https://" + req.Headers["Host"]
3839
}
3940

4041
cookie, err := sm.Write(sess)
@@ -45,7 +46,7 @@ func redirect(req events.Request, sess session.Session, target string) (events.R
4546
return events.Response{
4647
StatusCode: 303,
4748
Headers: map[string]string{
48-
"Location": target,
49+
"Location": respTarget,
4950
"Set-Cookie": cookie,
5051
},
5152
}, nil

static.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (f *File) Close() error {
7676
}
7777

7878
// Readdir implements http.File.Readdir
79-
func (f *File) Readdir(count int) ([]os.FileInfo, error) {
79+
func (f *File) Readdir(_ int) ([]os.FileInfo, error) {
8080
return nil, os.ErrNotExist
8181
}
8282

@@ -123,7 +123,7 @@ func (f *FileInfo) IsDir() bool {
123123
}
124124

125125
// Readdir implements os.FileInfo.Readdir
126-
func (f *FileInfo) Readdir(count int) ([]os.FileInfo, error) {
126+
func (f *FileInfo) Readdir(_ int) ([]os.FileInfo, error) {
127127
return f.files, nil
128128
}
129129

0 commit comments

Comments
 (0)