Skip to content

Commit

Permalink
Fix linting errors and Makefile sources to exclude /vendor
Browse files Browse the repository at this point in the history
Signed-off-by: Antonis Kalipetis <[email protected]>
  • Loading branch information
akalipetis committed Nov 7, 2016
1 parent bcdc9b2 commit 04e5d49
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all binary test image vet lint clean

SRCS = $(shell git ls-files '*.go' | grep -v '^Godeps/')
SRCS = $(shell git ls-files '*.go' | grep -v '^vendor/')
PKGS = ./core/. ./broker/. ./authz/.

default: binary
Expand Down
12 changes: 6 additions & 6 deletions authz/stolos.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
)

const (
// StolosUrl indicates which URL to use as base when connecting to the API
StolosUrl = "https://api.stolos.io"
// StolosURL indicates which URL to use as base when connecting to the API
StolosURL = "https://api.stolos.io"

// StolosToken indicates the token to use when connecting to the API
StolosToken = ""
Expand All @@ -22,13 +22,13 @@ type stolosAuthorizer struct {
settings *StolosAuthorizerSettings
}

// BasicAuthorizerSettings provides settings for the basic authoerizer flow
// StolosAuthorizerSettings provides settings for the basic authoerizer flow
type StolosAuthorizerSettings struct {
StolosUrl string // StolosUrl indicates which URL to use as base when connecting to the API
StolosURL string // StolosURL indicates which URL to use as base when connecting to the API
StolosToken string // StolosToken indicates the token to use when connecting to the API
}

// NewBasicAuthZAuthorizer creates a new basic authorizer
// NewStolosAuthZAuthorizer creates a new basic authorizer
func NewStolosAuthZAuthorizer(settings *StolosAuthorizerSettings) core.Authorizer {
return &stolosAuthorizer{settings: settings}
}
Expand All @@ -42,7 +42,7 @@ func (f *stolosAuthorizer) AuthZReq(authZReq *authorization.Request) *authorizat
if authZReq.User == "" || authZReq.User == "client" {
return &authorization.Response{Allow: true}
}
url := fmt.Sprintf("%s/api/a0.1/certs/%s/", f.settings.StolosUrl, authZReq.User)
url := fmt.Sprintf("%s/api/a0.1/certs/%s/", f.settings.StolosURL, authZReq.User)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", fmt.Sprintf("Token %s", f.settings.StolosToken))
client := &http.Client{}
Expand Down
6 changes: 3 additions & 3 deletions broker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
auditorHookFlag = "auditor-hook"
policyFileFlag = "policy-file"
stolosTokenFlag = "stolos-token"
stolosURLFlag = "stolos-url"
StolosURLFlag = "stolos-url"
)

const (
Expand Down Expand Up @@ -48,7 +48,7 @@ func main() {
authZHandler = authz.NewBasicAuthZAuthorizer(&authz.BasicAuthorizerSettings{PolicyPath: c.GlobalString(policyFileFlag)})
break
case authorizerStolos:
authZHandler = authz.NewStolosAuthZAuthorizer(&authz.StolosAuthorizerSettings{StolosToken: c.GlobalString(stolosTokenFlag), StolosUrl: c.GlobalString(stolosURLFlag)})
authZHandler = authz.NewStolosAuthZAuthorizer(&authz.StolosAuthorizerSettings{StolosToken: c.GlobalString(stolosTokenFlag), StolosURL: c.GlobalString(StolosURLFlag)})
break
default:
panic(fmt.Sprintf("Unknown authz handler %q", c.GlobalString(authorizerFlag)))
Expand Down Expand Up @@ -104,7 +104,7 @@ func main() {
},

cli.StringFlag{
Name: stolosURLFlag,
Name: StolosURLFlag,
Value: authz.AuditHookStdout,
EnvVar: "STOLOS_URL",
Usage: "The token to use for connecting to the Stolos API",
Expand Down

0 comments on commit 04e5d49

Please sign in to comment.