Skip to content

Commit

Permalink
rename service config func
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmturner committed Aug 28, 2018
1 parent 91e2843 commit f9d0338
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/example-AD.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func httpServer() *httptest.Server {
b, _ := hex.DecodeString(testdata.SYSHTTP_KEYTAB)
kt, _ := keytab.Parse(b)
th := http.HandlerFunc(testAppHandler)
c := service.NewSPNEGOConfig(kt)
c := service.NewConfig(kt)
c.ServicePrincipal = "sysHTTP"
s := httptest.NewServer(service.SPNEGOKRB5Authenticate(th, c, l))
return s
Expand Down
2 changes: 1 addition & 1 deletion examples/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func httpServer() *httptest.Server {
b, _ := hex.DecodeString(testdata.HTTP_KEYTAB)
kt, _ := keytab.Parse(b)
th := http.HandlerFunc(testAppHandler)
c := service.NewSPNEGOConfig(kt)
c := service.NewConfig(kt)
s := httptest.NewServer(service.SPNEGOKRB5Authenticate(th, c, l))
return s
}
Expand Down
2 changes: 1 addition & 1 deletion examples/httpServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {

// Set up handler mappings wrapping in the SPNEGOKRB5Authenticate handler wrapper
mux := http.NewServeMux()
c := service.NewSPNEGOConfig(kt)
c := service.NewConfig(kt)
mux.Handle("/", service.SPNEGOKRB5Authenticate(th, c, l))

// Start up the web server
Expand Down
4 changes: 2 additions & 2 deletions service/authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ type Config struct {
}

func NewSPNEGOAuthenticator(kt keytab.Keytab) (a SPNEGOAuthenticator) {
a.Config = NewSPNEGOConfig(kt)
a.Config = NewConfig(kt)
return
}

func NewSPNEGOConfig(kt keytab.Keytab) *Config {
func NewConfig(kt keytab.Keytab) *Config {
return &Config{Keytab: kt}
}

Expand Down
2 changes: 1 addition & 1 deletion service/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func httpServer() *httptest.Server {
b, _ := hex.DecodeString(testdata.HTTP_KEYTAB)
kt, _ := keytab.Parse(b)
th := http.HandlerFunc(testAppHandler)
c := NewSPNEGOConfig(kt)
c := NewConfig(kt)
s := httptest.NewServer(SPNEGOKRB5Authenticate(th, c, l))
return s
}
Expand Down

0 comments on commit f9d0338

Please sign in to comment.