Skip to content

[EventGrid] API design issues for the identity block #13340

Open
@tombuildsstuff

Description

@tombuildsstuff

👋

The Swagger definitions for Identities within the EventGrid API (this Swagger) appear to disregard the conventions used for identity blocks elsewhere in this codebase, such that a normal Identity block gets generated as:

// ManagedServiceIdentity managed service identity.
type ManagedServiceIdentity struct {
	// Type - Type of managed service identity. Possible values include: 'ManagedServiceIdentityTypeSystemAssigned', 'ManagedServiceIdentityTypeUserAssigned', 'ManagedServiceIdentityTypeSystemAssignedUserAssigned', 'ManagedServiceIdentityTypeNone'
	Type ManagedServiceIdentityType `json:"type,omitempty"`
	// TenantID - READ-ONLY; Tenant of managed service identity.
	TenantID *string `json:"tenantId,omitempty"`
	// PrincipalID - READ-ONLY; Principal Id of managed service identity.
	PrincipalID *string `json:"principalId,omitempty"`
	// UserAssignedIdentities - The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}
	UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"`
}

but EventGrid instead generates:

// EventSubscriptionIdentity the identity information with the event subscription.
type EventSubscriptionIdentity struct {
	// Type - The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity. Possible values include: 'SystemAssigned', 'UserAssigned'
	Type EventSubscriptionIdentityType `json:"type,omitempty"`
	// UserAssignedIdentity - The user identity associated with the resource.
	UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"`
}

it's also worth noting the value defined above "None" isn't present in as a Constant, even though it's mentioned above:

// EventSubscriptionIdentityType enumerates the values for event subscription identity type.
type EventSubscriptionIdentityType string

const (
	// SystemAssigned ...
	SystemAssigned EventSubscriptionIdentityType = "SystemAssigned"
	// UserAssigned ...
	UserAssigned EventSubscriptionIdentityType = "UserAssigned"
)

Would it be possible for this to be fixed to match other API's? This appears to be both a design issue (in the API) and a process issue (that this slipped through) - do common types not exist for the identity block?

cc @JeffreyRichter

Metadata

Metadata

Assignees

No one assigned

    Labels

    Event GridService AttentionWorkflow: This issue is responsible by Azure service team.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions