Azure / Azure/azure-rest-api-specs

[BUG] Spec for ManagedIdentityToken

Open
#33,691 1 comment 0 reactions 0 assignees View on GitHub
bug customer-reported Managed Identity question Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

### API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/166c3a2ace3d2511cbdeeada95826cd67a45895e/specification/solutions/resource-manager/Microsoft.Solutions/preview/2023-12-01-preview/managedapplications.json#L2849-L2881

### API Spec version

2023-12-01-preview (also present in 2018-09-01-preview...so since forever)

### Describe the bug

Calling listTokens, only the `authorizationAudience` and `resourceId` fields are in camel case, the others fields are all implemented as snake case. The spec has this all fields formatted as camel case meaning downstream users of these specs cannot decode the token.

Documentation matching reality: https://learn.microsoft.com/en-us/azure/azure-resource-manager/managed-applications/publish-managed-identity#accessing-the-managed-identity-token

### Expected behavior

Downstream library users can decode the response correctly, https://github.com/Azure/azure-sdk-for-python/pull/40268

### Actual behavior

`azure.mgmt.managedapplications.models.ManagedIdentityToken` returns most of its attributes as `None`

### Reproduction Steps

By doing a listTokens, you will receive:
```{"value":[{"authorizationAudience":"https://management.azure.com/","resourceId":"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applications/{applicationName}","access_token":"...","expires_in":"86399","expires_on":"1743242070","not_before":"1743155371","token_type":"Bearer"}]}```

Note the formatting of the fields does not match the spec.

### Environment

Python 3.11 and https://learn.microsoft.com/en-us/python/api/azure-mgmt-managedapplications/azure.mgmt.managedapplications?view=azure-python-preview (version 1.0.0b1, the latest)

Contributor guide

Open the contributing guide

Research direction

Inspect specification/solutions/resource-manager/Microsoft.Solutions/preview/2023-12-01-preview/managedapplications.json at lines 2849-2881, starting with the ManagedIdentityToken schema and the listTokens response. Compare its property names with the documented response and the reproduced payload; done means the schema represents the returned token fields so downstream SDK users can decode them correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.