Skip to content

Commit

Permalink
remove unnecessary public types
Browse files Browse the repository at this point in the history
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
  • Loading branch information
laurazard committed Aug 12, 2024
1 parent 6aedf2a commit 16bda05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
14 changes: 7 additions & 7 deletions cli/oauth/jwt.go → cli/internal/oauth/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,9 @@ type Source struct {
ID string `json:"id"`
}

// ParseSigned parses a JWT and returns the signature object or error. This does
// not verify the validity of the JWT.
func ParseSigned(token string) (*jwt.JSONWebToken, error) {
return jwt.ParseSigned(token)
}

// GetClaims returns claims from an access token without verification.
func GetClaims(accessToken string) (claims Claims, err error) {
token, err := ParseSigned(accessToken)
token, err := parseSigned(accessToken)
if err != nil {
return
}
Expand All @@ -97,3 +91,9 @@ func GetClaims(accessToken string) (claims Claims, err error) {

return
}

// parseSigned parses a JWT and returns the signature object or error. This does
// not verify the validity of the JWT.
func parseSigned(token string) (*jwt.JSONWebToken, error) {
return jwt.ParseSigned(token)
}
2 changes: 1 addition & 1 deletion cli/internal/oauth/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"github.com/docker/cli/cli/config/credentials"
"github.com/docker/cli/cli/config/types"
"github.com/docker/cli/cli/internal/oauth"
"github.com/docker/cli/cli/internal/oauth/api"
"github.com/docker/cli/cli/oauth"
"github.com/docker/docker/registry"

"github.com/pkg/browser"
Expand Down
11 changes: 0 additions & 11 deletions cli/oauth/manager.go

This file was deleted.

0 comments on commit 16bda05

Please sign in to comment.