Resolved newline issues

This commit is contained in:
Andrew Block 2019-12-22 01:20:46 -05:00
parent db7711d72a
commit 02c8f85e4d
No known key found for this signature in database
GPG Key ID: 02DFE631AEF35EBC
2 changed files with 1 additions and 7 deletions

View File

@ -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)

View File

@ -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) {