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
2 changes: 1 addition & 1 deletion cmd/authz/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func ServiceCmd(imsConfig *ims.Config) *cobra.Command {
cmd := &cobra.Command{
Use: "service",
Short: "Negotiate a service to service token.",
Long: "Perform the 'Client Credential Authorization Flow' to negotiate an access token for a service.'",
Long: "Perform the 'Authorization Code Exchange' to negotiate an access token for a service.",
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
cmd.SilenceErrors = true
Expand Down
5 changes: 2 additions & 3 deletions cmd/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ func decodeCmd(imsConfig *ims.Config) *cobra.Command {
return fmt.Errorf("error decoding the token: %w", err)
}

fmt.Println(pretty.JSON(decoded.Header))
fmt.Println()
fmt.Println(pretty.JSON(decoded.Payload))
output := fmt.Sprintf(`{"header":%s,"payload":%s}`, decoded.Header, decoded.Payload)
fmt.Println(pretty.JSON(output))

return nil
},
Expand Down
2 changes: 2 additions & 0 deletions cmd/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ func exchangeCmd(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.MarkFlagsMutuallyExclusive("organization", "userID")

return cmd
}
2 changes: 1 addition & 1 deletion cmd/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func profileCmd(imsConfig *ims.Config) *cobra.Command {

cmd := &cobra.Command{
Use: "profile",
Short: "Requests an user profile.",
Short: "Requests a user profile.",
Long: "Requests the user profile associated to the provided access token.",
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
Expand Down
2 changes: 1 addition & 1 deletion cmd/refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func refreshCmd(imsConfig *ims.Config) *cobra.Command {
if err != nil {
return fmt.Errorf("error marshalling full JSON response: %w", err)
}
fmt.Printf("%s", jsonData)
fmt.Printf("%s\n", jsonData)
return nil
}
fmt.Println(resp.AccessToken)
Expand Down
2 changes: 1 addition & 1 deletion ims/admin_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (i Config) validateGetAdminProfileConfig() error {
return nil
}

// GetAdminProfile requests the user profile using an access token.
// GetAdminProfile requests the user profile using a service token.
func (i Config) GetAdminProfile() (string, error) {

err := i.validateGetAdminProfileConfig()
Expand Down
2 changes: 1 addition & 1 deletion ims/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (i Config) validateDecodeTokenConfig() error {
func (i Config) DecodeToken() (*DecodedToken, error) {
err := i.validateDecodeTokenConfig()
if err != nil {
return nil, fmt.Errorf("incomplete parameters for token decodification: %w", err)
return nil, fmt.Errorf("incomplete parameters for token decoding: %w", err)
}
parts := strings.Split(i.Token, ".")

Expand Down
2 changes: 1 addition & 1 deletion ims/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func findFulfillableData(data interface{}) {
}
decodedFulfillableData, err := modifyFulfillableData(strValue)
if err != nil {
fmt.Printf("Error decoding fulfillable_data: %v", err)
log.Printf("Error decoding fulfillable_data: %v", err)
return
}
data["fulfillable_data"] = decodedFulfillableData
Expand Down