Skip to content

Commit

Permalink
Fix gometalinter
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Jan 3, 2017
1 parent ef209dc commit 05ad838
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/apps/apps.go
Expand Up @@ -196,13 +196,13 @@ func (m *Manifest) BuildCtxToken(i *instance.Instance, ctx Context) string {
return ""
}
token, err := crypto.NewJWT(i.SessionSecret, permissions.Claims{
jwt.StandardClaims{
StandardClaims: jwt.StandardClaims{
Audience: permissions.ContextAudience,
Issuer: i.Domain,
IssuedAt: crypto.Timestamp(),
Subject: m.Slug,
},
"", // TODO scope
Scope: "", // TODO scope
})
if err != nil {
return ""
Expand Down
4 changes: 2 additions & 2 deletions pkg/oauth/client.go
Expand Up @@ -241,13 +241,13 @@ func (c *Client) AcceptRedirectURI(u string) bool {
// CreateJWT returns a new JSON Web Token for the given instance and audience
func (c *Client) CreateJWT(i *instance.Instance, audience, scope string) (string, error) {
token, err := crypto.NewJWT(i.OAuthSecret, permissions.Claims{
jwt.StandardClaims{
StandardClaims: jwt.StandardClaims{
Audience: audience,
Issuer: i.Domain,
IssuedAt: crypto.Timestamp(),
Subject: c.CouchID,
},
scope,
Scope: scope,
})
if err != nil {
log.Errorf("[oauth] Failed to create the %s token: %s", audience, err)
Expand Down
4 changes: 2 additions & 2 deletions web/auth/auth_test.go
Expand Up @@ -1061,13 +1061,13 @@ func TestRefreshTokenInvalidToken(t *testing.T) {

func TestRefreshTokenInvalidSigningMethod(t *testing.T) {
claims := permissions.Claims{
jwt.StandardClaims{
StandardClaims: jwt.StandardClaims{
Audience: "refresh",
Issuer: domain,
IssuedAt: crypto.Timestamp(),
Subject: clientID,
},
"files:write",
Scope: "files:write",
}
token := jwt.NewWithClaims(jwt.GetSigningMethod("none"), claims)
fakeToken, err := token.SignedString(jwt.UnsafeAllowNoneSignatureType)
Expand Down

0 comments on commit 05ad838

Please sign in to comment.