Skip to content

Commit

Permalink
Re-ordered structs to put locale last
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-slowik committed Aug 28, 2019
1 parent becb3d2 commit 78ef63d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ type Identity struct {
Username string
Email string
EmailVerified bool
Locale string
Groups []string
Locale string

// ConnectorData holds data used by the connector for subsequent requests after initial
// authentication, such as access tokens for upstream provides.
Expand Down
2 changes: 1 addition & 1 deletion server/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ type idTokenClaims struct {

Email string `json:"email,omitempty"`
EmailVerified *bool `json:"email_verified,omitempty"`
Locale string `json:"locale,omitempty"`
Groups []string `json:"groups,omitempty"`
Locale string `json:"locale,omitempty"`

Name string `json:"name,omitempty"`

Expand Down
16 changes: 8 additions & 8 deletions storage/conformance/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func testAuthRequestCRUD(t *testing.T, s storage.Storage) {
Username: "jane",
Email: "[email protected]",
EmailVerified: true,
Locale: "en_US",
Groups: []string{"a", "b"},
Locale: "en_US",
},
}

Expand Down Expand Up @@ -130,8 +130,8 @@ func testAuthRequestCRUD(t *testing.T, s storage.Storage) {
Username: "john",
Email: "[email protected]",
EmailVerified: true,
Locale: "en_US",
Groups: []string{"a"},
Locale: "en_US",
},
}

Expand Down Expand Up @@ -180,8 +180,8 @@ func testAuthCodeCRUD(t *testing.T, s storage.Storage) {
Username: "jane",
Email: "[email protected]",
EmailVerified: true,
Locale: "en_US",
Groups: []string{"a", "b"},
Locale: "en_US",
},
}

Expand All @@ -203,8 +203,8 @@ func testAuthCodeCRUD(t *testing.T, s storage.Storage) {
Username: "john",
Email: "[email protected]",
EmailVerified: true,
Locale: "en_US",
Groups: []string{"a"},
Locale: "en_US",
},
}

Expand Down Expand Up @@ -325,8 +325,8 @@ func testRefreshTokenCRUD(t *testing.T, s storage.Storage) {
Username: "jane",
Email: "[email protected]",
EmailVerified: true,
Locale: "en_US",
Groups: []string{"a", "b"},
Locale: "en_US",
},
ConnectorData: []byte(`{"some":"data"}`),
}
Expand Down Expand Up @@ -380,8 +380,8 @@ func testRefreshTokenCRUD(t *testing.T, s storage.Storage) {
Username: "john",
Email: "[email protected]",
EmailVerified: true,
Locale: "en_US",
Groups: []string{"a", "b"},
Locale: "en_US",
},
ConnectorData: []byte(`{"some":"data"}`),
}
Expand Down Expand Up @@ -800,8 +800,8 @@ func testGC(t *testing.T, s storage.Storage) {
Username: "jane",
Email: "[email protected]",
EmailVerified: true,
Locale: "en_US",
Groups: []string{"a", "b"},
Locale: "en_US",
},
}

Expand Down Expand Up @@ -861,8 +861,8 @@ func testTimezones(t *testing.T, s storage.Storage) {
Username: "jane",
Email: "[email protected]",
EmailVerified: true,
Locale: "en_US",
Groups: []string{"a", "b"},
Locale: "en_US",
},
}
if err := s.CreateAuthCode(c); err != nil {
Expand Down
6 changes: 3 additions & 3 deletions storage/etcd/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ type Claims struct {
Username string `json:"username"`
Email string `json:"email"`
EmailVerified bool `json:"emailVerified"`
Locale string `json:"locale,omitempty"`
Groups []string `json:"groups,omitempty"`
Locale string `json:"locale,omitempty"`
}

func fromStorageClaims(i storage.Claims) Claims {
Expand All @@ -162,8 +162,8 @@ func fromStorageClaims(i storage.Claims) Claims {
Username: i.Username,
Email: i.Email,
EmailVerified: i.EmailVerified,
Locale: i.Locale,
Groups: i.Groups,
Locale: i.Locale,
}
}

Expand All @@ -173,8 +173,8 @@ func toStorageClaims(i Claims) storage.Claims {
Username: i.Username,
Email: i.Email,
EmailVerified: i.EmailVerified,
Locale: i.Locale,
Groups: i.Groups,
Locale: i.Locale,
}
}

Expand Down
6 changes: 3 additions & 3 deletions storage/kubernetes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ type Claims struct {
Username string `json:"username"`
Email string `json:"email"`
EmailVerified bool `json:"emailVerified"`
Locale string `json:"locale,omitempty"`
Groups []string `json:"groups,omitempty"`
Locale string `json:"locale,omitempty"`
}

func fromStorageClaims(i storage.Claims) Claims {
Expand All @@ -224,8 +224,8 @@ func fromStorageClaims(i storage.Claims) Claims {
Username: i.Username,
Email: i.Email,
EmailVerified: i.EmailVerified,
Locale: i.Locale,
Groups: i.Groups,
Locale: i.Locale,
}
}

Expand All @@ -235,8 +235,8 @@ func toStorageClaims(i Claims) storage.Claims {
Username: i.Username,
Email: i.Email,
EmailVerified: i.EmailVerified,
Locale: i.Locale,
Groups: i.Groups,
Locale: i.Locale,
}
}

Expand Down
2 changes: 1 addition & 1 deletion storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ type Claims struct {
Username string
Email string
EmailVerified bool
Locale string
Groups []string
Locale string
}

// AuthRequest represents a OAuth2 client authorization request. It holds the state
Expand Down

0 comments on commit 78ef63d

Please sign in to comment.