Azure / cadl-ranch

Cadl Scenarios for client generations
https://azure.github.io/cadl-ranch/
MIT License
8 stars 32 forks source link

Add default authentication validation for ARM cases in mockapi.ts #617

Open MaryGao opened 5 months ago

MaryGao commented 5 months ago

In typespec-azure-resource-manager it would directly add the defulat outh2 for ARM spec. It may introduce a token credential for some languages. We should validate this token for ARM cases in mockapi.ts.

https://github.com/Azure/typespec-azure/blob/54567f763257300e64603091659d282072631d2a/packages/typespec-azure-resource-manager/src/namespace.ts#L199-L213

tadelesh commented 5 months ago

i believe current test already use the decorator and has the auth definition: https://github.com/Azure/cadl-ranch/blob/e64514785094c3ef1722b164ba3cbc8e70e00c2c/packages/cadl-ranch-specs/http/azure/resource-manager/models/resources/main.tsp#L18

XiaofeiCao commented 3 months ago

Wonder if it's necessary. The acquired token can only be mocked by each client, not through normal flow(e.g. ClientSecret or Azure CLI).