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
11 changes: 11 additions & 0 deletions models/app-fic.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ type AppFICs struct {
TenantName string `json:"tenantName"`
}

// MarshalJSON uppercases the AppId, TenantId, and TenantName identifiers; each
// FIC entry is marshaled through its own MarshalJSON. Non-mutating.
func (s AppFICs) MarshalJSON() ([]byte, error) {
type Alias AppFICs
a := Alias(s)
a.AppId = strings.ToUpper(a.AppId)
a.TenantId = strings.ToUpper(a.TenantId)
a.TenantName = strings.ToUpper(a.TenantName)
return json.Marshal(a)
}

type FICData struct {
Audiences []string `json:"audiences"`
ID string `json:"id"`
Expand Down
1 change: 1 addition & 0 deletions models/app-role-assignments.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func (s AppRoleAssignment) MarshalJSON() ([]byte, error) {
type Alias AppRoleAssignment
a := Alias(s)
a.ResourceId = strings.ToUpper(a.ResourceId)
a.AppId = strings.ToUpper(a.AppId)
a.TenantId = strings.ToUpper(a.TenantId)

// PrincipalId is a uuid.UUID and cannot hold an uppercased string, so emit
Expand Down
2 changes: 2 additions & 0 deletions models/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func (s App) MarshalJSON() ([]byte, error) {
a := Alias(s)
a.Id = strings.ToUpper(a.Id)
a.AppId = strings.ToUpper(a.AppId)
a.DisplayName = strings.ToUpper(a.DisplayName)
a.TenantId = strings.ToUpper(a.TenantId)
a.TenantName = strings.ToUpper(a.TenantName)
return json.Marshal(a)
}
1 change: 1 addition & 0 deletions models/automation-account.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (s AutomationAccount) MarshalJSON() ([]byte, error) {
a.Id = strings.ToUpper(a.Id)
a.SubscriptionId = strings.ToUpper(a.SubscriptionId)
a.ResourceGroupId = strings.ToUpper(a.ResourceGroupId)
a.ResourceGroupName = strings.ToUpper(a.ResourceGroupName)
a.TenantId = strings.ToUpper(a.TenantId)
a.Identity = UpperManagedIdentity(a.Identity)
return json.Marshal(a)
Expand Down
1 change: 1 addition & 0 deletions models/azure/descendant-info.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@ func (s DescendantInfo) MarshalJSON() ([]byte, error) {
a := Alias(s)
a.Id = strings.ToUpper(a.Id)
a.Properties.Parent.Id = strings.ToUpper(a.Properties.Parent.Id)
a.Properties.DisplayName = strings.ToUpper(a.Properties.DisplayName)
return json.Marshal(a)
}
1 change: 1 addition & 0 deletions models/container-registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (s ContainerRegistry) MarshalJSON() ([]byte, error) {
a.Id = strings.ToUpper(a.Id)
a.SubscriptionId = strings.ToUpper(a.SubscriptionId)
a.ResourceGroupId = strings.ToUpper(a.ResourceGroupId)
a.ResourceGroupName = strings.ToUpper(a.ResourceGroupName)
a.TenantId = strings.ToUpper(a.TenantId)
a.Identity = UpperManagedIdentity(a.Identity)
return json.Marshal(a)
Expand Down
3 changes: 3 additions & 0 deletions models/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ func (s Device) MarshalJSON() ([]byte, error) {
type Alias Device
a := Alias(s)
a.Id = strings.ToUpper(a.Id)
a.DeviceId = strings.ToUpper(a.DeviceId)
a.DisplayName = strings.ToUpper(a.DisplayName)
a.TenantId = strings.ToUpper(a.TenantId)
a.TenantName = strings.ToUpper(a.TenantName)
return json.Marshal(a)
}
1 change: 1 addition & 0 deletions models/function-app.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (s FunctionApp) MarshalJSON() ([]byte, error) {
a.Id = strings.ToUpper(a.Id)
a.SubscriptionId = strings.ToUpper(a.SubscriptionId)
a.ResourceGroupId = strings.ToUpper(a.ResourceGroupId)
a.ResourceGroupName = strings.ToUpper(a.ResourceGroupName)
a.TenantId = strings.ToUpper(a.TenantId)
a.Identity = UpperManagedIdentity(a.Identity)
return json.Marshal(a)
Expand Down
2 changes: 2 additions & 0 deletions models/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@ func (s Group) MarshalJSON() ([]byte, error) {
a.Id = strings.ToUpper(a.Id)
a.TenantId = strings.ToUpper(a.TenantId)
a.OnPremisesSecurityIdentifier = strings.ToUpper(a.OnPremisesSecurityIdentifier)
a.DisplayName = strings.ToUpper(a.DisplayName)
a.TenantName = strings.ToUpper(a.TenantName)
return json.Marshal(a)
}
11 changes: 11 additions & 0 deletions models/key-vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,16 @@ func (s KeyVault) MarshalJSON() ([]byte, error) {
a.SubscriptionId = strings.ToUpper(a.SubscriptionId)
a.ResourceGroup = strings.ToUpper(a.ResourceGroup)
a.TenantId = strings.ToUpper(a.TenantId)
a.Properties.TenantId = strings.ToUpper(a.Properties.TenantId)
if s.Properties.AccessPolicies != nil {
policies := make([]azure.AccessPolicyEntry, len(s.Properties.AccessPolicies))
for i, policy := range s.Properties.AccessPolicies {
policy.ObjectId = strings.ToUpper(policy.ObjectId)
policy.ApplicationId = strings.ToUpper(policy.ApplicationId)
policy.TenantId = strings.ToUpper(policy.TenantId)
policies[i] = policy
}
a.Properties.AccessPolicies = policies
}
return json.Marshal(a)
}
1 change: 1 addition & 0 deletions models/logic-app.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (s LogicApp) MarshalJSON() ([]byte, error) {
a.Id = strings.ToUpper(a.Id)
a.SubscriptionId = strings.ToUpper(a.SubscriptionId)
a.ResourceGroupId = strings.ToUpper(a.ResourceGroupId)
a.ResourceGroupName = strings.ToUpper(a.ResourceGroupName)
a.TenantId = strings.ToUpper(a.TenantId)
a.Identity = UpperManagedIdentity(a.Identity)
return json.Marshal(a)
Expand Down
2 changes: 2 additions & 0 deletions models/managed-cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ func (s ManagedCluster) MarshalJSON() ([]byte, error) {
a.SubscriptionId = strings.ToUpper(a.SubscriptionId)
a.ResourceGroupId = strings.ToUpper(a.ResourceGroupId)
a.TenantId = strings.ToUpper(a.TenantId)
a.Properties.NodeResourceGroup = strings.ToUpper(a.Properties.NodeResourceGroup)
a.Identity = UpperManagedIdentity(a.Identity)
return json.Marshal(a)
}
Loading
Loading