-
Notifications
You must be signed in to change notification settings - Fork 741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Define security in autorest #4018
Conversation
"scopes": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"headerName": { | ||
"type": "string" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scopes we need only for token credential and header name we need only for key credential, so why not move these properties into their respective classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean have this instead of an array
interface SecuritySchemes {
aadToken?: AADTokenSecurityScheme;
azureKey?: AzureKeySecurityScheme;
}
The array worked great in typescript because you had unions but as can't use them this might be better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I meant why not move "scopes" property inside AADTokenSecurityScheme
and "headerName" inside AzureKeyScheme
?
Do we need "scopes" for AzureKeyScheme
and "headerName" for AADTokenSecurityScheme
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is already like that but how do you can't represent the union of those 2 types in csharp so I made the parent type include everything
You may test this build by running Add the following CLI flags
Or with all autorest --version:https://tinyurl.com/yg5rsmrn --use:https://tinyurl.com/yjua6nhb or use the following in your autorest configuration: # For changes to autorest core
version: "https://tinyurl.com/yg5rsmrn"
# For changes to modelerfour
use-extension:
"@autorest/modelerfour": "https://tinyurl.com/yjua6nhb" If this build is good for you, give this comment a thumbs up. (👍) And you should run `autorest --reset` again once you're finished testing to remove it. |
You may test this build by running Add the following CLI flags
Or with all autorest --version:https://tinyurl.com/yf79nxxu --use:https://tinyurl.com/yjtn8qpz or use the following in your autorest configuration: # For changes to autorest core
version: "https://tinyurl.com/yf79nxxu"
# For changes to modelerfour
use-extension:
"@autorest/modelerfour": "https://tinyurl.com/yjtn8qpz" If this build is good for you, give this comment a thumbs up. (👍) And you should run `autorest --reset` again once you're finished testing to remove it. |
You may test this build by running Add the following CLI flags
Or with all autorest --version:https://tinyurl.com/yg453w6a --use:https://tinyurl.com/yzramus5 or use the following in your autorest configuration: # For changes to autorest core
version: "https://tinyurl.com/yg453w6a"
# For changes to modelerfour
use-extension:
"@autorest/modelerfour": "https://tinyurl.com/yzramus5" If this build is good for you, give this comment a thumbs up. (👍) And you should run `autorest --reset` again once you're finished testing to remove it. |
You may test this build by running Add the following CLI flags
Or with all autorest --version:https://tinyurl.com/yfhyccns --use:https://tinyurl.com/yfratqhg or use the following in your autorest configuration: # For changes to autorest core
version: "https://tinyurl.com/yfhyccns"
# For changes to modelerfour
use-extension:
"@autorest/modelerfour": "https://tinyurl.com/yfratqhg" If this build is good for you, give this comment a thumbs up. (👍) And you should run `autorest --reset` again once you're finished testing to remove it. |
…re/m4-security
You may test this build by running Add the following CLI flags
Or with all autorest --version:https://tinyurl.com/yea49o87 --use:https://tinyurl.com/yf699jc6 or use the following in your autorest configuration: # For changes to autorest core
version: "https://tinyurl.com/yea49o87"
# For changes to modelerfour
use-extension:
"@autorest/modelerfour": "https://tinyurl.com/yf699jc6" If this build is good for you, give this comment a thumbs up. (👍) And you should run `autorest --reset` again once you're finished testing to remove it. |
resolves #3718
resolves #3719
Provide a standard way to define security model that generators can support. Documentation here
Todo: