diff --git a/connector/openshift/openshift.go b/connector/openshift/openshift.go index 69c88741..a19ae531 100644 --- a/connector/openshift/openshift.go +++ b/connector/openshift/openshift.go @@ -59,7 +59,6 @@ type user struct { // Open returns a connector which can be used to login users through an upstream // OpenShift OAuth2 provider. func (c *Config) Open(id string, logger log.Logger) (conn connector.Connector, err error) { - ctx, cancel := context.WithCancel(context.Background()) wellKnownURL := strings.TrimSuffix(c.Issuer, "/") + "/.well-known/oauth-authorization-server" @@ -91,7 +90,7 @@ func (c *Config) Open(id string, logger log.Logger) (conn connector.Connector, e if err != nil { cancel() - return nil, fmt.Errorf("Failed to query OpenShift Endpoint %v", err) + return nil, fmt.Errorf("failed to query OpenShift endpoint %v", err) } defer resp.Body.Close() @@ -211,7 +210,6 @@ func (c *openshiftConnector) user(ctx context.Context, client *http.Client) (u u } func validateRequiredGroups(userGroups, requiredGroups []string) bool { - matchingGroups := groups.Filter(userGroups, requiredGroups) return len(requiredGroups) == len(matchingGroups) diff --git a/connector/openshift/openshift_test.go b/connector/openshift/openshift_test.go index 5d489259..407531e7 100644 --- a/connector/openshift/openshift_test.go +++ b/connector/openshift/openshift_test.go @@ -80,7 +80,6 @@ func TestGetUser(t *testing.T) { expectEquals(t, u.Name, "jdoe") expectEquals(t, u.FullName, "John Doe") expectEquals(t, len(u.Groups), 1) - } func TestVerifyGroupFn(t *testing.T) { @@ -90,7 +89,6 @@ func TestVerifyGroupFn(t *testing.T) { validGroupMembership := validateRequiredGroups(groupMembership, requiredGroups) expectEquals(t, validGroupMembership, true) - } func TestVerifyGroup(t *testing.T) { @@ -122,7 +120,6 @@ func TestVerifyGroup(t *testing.T) { expectEquals(t, u.Name, "jdoe") expectEquals(t, u.FullName, "John Doe") expectEquals(t, len(u.Groups), 1) - } func TestCallbackIdentity(t *testing.T) { @@ -169,7 +166,6 @@ func TestCallbackIdentity(t *testing.T) { } func newTestServer(responses map[string]interface{}) *httptest.Server { - var s *httptest.Server s = httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {