Azure / Azure/typespec-azure

[Feature Request] Document permissions needed to call APIs

Open
#76 4 comments 0 reactions 0 assignees View on GitHub
design:needed feature lib:azure-core
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

**Is your feature request related to a problem? Please describe.**
Many APIs require the caller to have different permissions e.g., RBAC actions or data actions, to call. We should document these both in REST API documentation, as well as client library documentation. See Azure/azure-sdk-for-net#8992 for more context.

**Describe the solution you'd like**
Define a `@permissions(...permissions: valueof string[])` decorator that documents the permissions required to call the API.

**Describe alternatives you've considered**
Some APIs like Key Vault already document these in their API docs e.g., `@doc("... Requires secrets/get permissions.")` but this is neither consistent across APIs or easily discernable in a way that APIs can call out explicitly. We should do this in a more general way and drive usage across APIs as appropriate. All language generators can then emit information in an idiomatic way. .NET docs used to list Code Access Security (CAS) required permissions in a separate section, for example.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.