Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/authz/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func JWTCmd(imsConfig *ims.Config) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true


resp, err := imsConfig.AuthorizeJWTExchange()
if err != nil {
return fmt.Errorf("error in jwt authorization: %w", err)
Expand All @@ -41,6 +40,8 @@ func JWTCmd(imsConfig *ims.Config) *cobra.Command {
cmd.Flags().StringVarP(&imsConfig.Account, "account", "A", "", "Technical Account ID.")
cmd.Flags().StringVarP(&imsConfig.PrivateKeyPath, "privateKey", "k", "", "Private Key file.")
cmd.Flags().StringSliceVarP(&imsConfig.Metascopes, "metascopes", "m", []string{}, "Metascopes to request.")
cmd.Flags().StringSliceVarP(&imsConfig.Resource, "resource", "r", nil,
"RFC 8707 resource indicator URI(s) for audience-restricted tokens.")

return cmd
}
3 changes: 0 additions & 3 deletions cmd/refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,5 @@ func refreshCmd(imsConfig *ims.Config) *cobra.Command {
"Scopes to request in the new token. Subset of the scopes of the original token. Optional value, if no "+
"scopes are requested the same scopes of the original token will be provided.")
cmd.Flags().BoolVarP(&imsConfig.FullOutput, "fullOutput", "F", false, "Output a JSON with access and refresh tokens.")
cmd.Flags().StringSliceVarP(&imsConfig.Resource, "resource", "r", nil,
"RFC 8707 resource indicator URI(s) for audience-restricted tokens.")

return cmd
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ go 1.23.0
toolchain go1.26.2

require (
github.com/adobe/ims-go v0.23.0
github.com/adobe/ims-go v0.24.0
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/spf13/cobra v1.10.2
github.com/spf13/viper v1.21.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/adobe/ims-go v0.23.0 h1:OYtCXoNJEAgG30CnLVd4PFvWN5Vv4u/Q72OZlGkfkEA=
github.com/adobe/ims-go v0.23.0/go.mod h1:zGpx0ylsumBjkgd8fYgzJ8+Ci/zFABiBTAxbCscsyR8=
github.com/adobe/ims-go v0.24.0 h1:GCChkRMHyAun419OmL/TqYX7WJ/9FZMn0ey3z/0K6Ow=
github.com/adobe/ims-go v0.24.0/go.mod h1:zGpx0ylsumBjkgd8fYgzJ8+Ci/zFABiBTAxbCscsyR8=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
6 changes: 3 additions & 3 deletions ims/jwt_exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ func (i Config) AuthorizeJWTExchange() (TokenInfo, error) {
}
}()

// Metascopes are passed as generic claims with the format map[string]any
// where the strings are in the form: baseIMSUrl/s/metascope
// and the value is 'true'
// Metascopes are passed as generic claims with the format map[string]any,
// where the strings are in the form: baseIMSUrl/s/metascope and the value is 'true'

baseURL := strings.TrimRight(i.URL, "/")
claims := make(map[string]any)
Expand All @@ -83,6 +82,7 @@ func (i Config) AuthorizeJWTExchange() (TokenInfo, error) {
ClientID: i.ClientID,
ClientSecret: i.ClientSecret,
Claims: claims,
Resources: i.Resource,
})
if err != nil {
return TokenInfo{}, fmt.Errorf("error exchanging JWT: %w", err)
Expand Down
1 change: 0 additions & 1 deletion ims/refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func (i Config) Refresh() (RefreshInfo, error) {
ClientSecret: i.ClientSecret,
RefreshToken: i.RefreshToken,
Scope: i.Scopes,
Resource: i.Resource,
})
if err != nil {
return RefreshInfo{}, fmt.Errorf("error during the token refresh: %w", err)
Expand Down
Loading