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
6 changes: 3 additions & 3 deletions ims/jwt_exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ func (i Config) AuthorizeJWTExchange() (TokenInfo, error) {
}
}()

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

baseURL := strings.TrimRight(i.URL, "/")
claims := make(map[string]interface{})
claims := make(map[string]any)
for _, metascope := range i.Metascopes {
claims[fmt.Sprintf("%s/s/%s", baseURL, metascope)] = true
}
Expand Down
8 changes: 4 additions & 4 deletions ims/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (i Config) GetProfile() (string, error) {

func decodeProfile(profile []byte) (string, error) {
// Parse the profile JSON
var p map[string]interface{}
var p map[string]any
err := json.Unmarshal(profile, &p)
if err != nil {
return "", fmt.Errorf("error parsing profile JSON: %w", err)
Expand All @@ -102,9 +102,9 @@ var fulfillableServiceCodes = map[string]bool{
"dx_genstudio": true,
}

func findFulfillableData(data interface{}) {
func findFulfillableData(data any) {
switch data := data.(type) {
case map[string]interface{}:
case map[string]any:
for key, value := range data {
if key == "fulfillable_data" {
serviceCode, ok := data["serviceCode"].(string)
Expand All @@ -126,7 +126,7 @@ func findFulfillableData(data interface{}) {
findFulfillableData(value)
}
}
case []interface{}:
case []any:
for _, item := range data {
findFulfillableData(item)
}
Expand Down
2 changes: 1 addition & 1 deletion ims/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (i Config) Register() (string, error) {
}

// Build the request payload using json.Marshal for proper escaping.
payload, err := json.Marshal(map[string]interface{}{
payload, err := json.Marshal(map[string]any{
"client_name": i.ClientName,
"redirect_uris": i.RedirectURIs,
})
Expand Down
Loading