-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Adding custom token support #5272
Adding custom token support #5272
Conversation
Fixed container status check
Co-Authored-By: Shashank Barsin <[email protected]>
Co-Authored-By: Shashank Barsin <[email protected]>
Co-Authored-By: Shashank Barsin <[email protected]>
Co-Authored-By: Shashank Barsin <[email protected]>
Co-Authored-By: Shashank Barsin <[email protected]>
Co-Authored-By: Shashank Barsin <[email protected]>
Co-Authored-By: Shashank Barsin <[email protected]>
Co-Authored-By: Shashank Barsin <[email protected]>
Co-Authored-By: Shashank Barsin <[email protected]>
Co-Authored-By: Shashank Barsin <[email protected]>
Just out of curiosity, may I ask is it safe to put tokens into the environment variables? + CLI Authentication expert @jiasli help review this PR |
@zhoxing-ms , wanted to clarify one thing from our side. the custom token support in connectedk8s CLI will only be consumed by internal partners. They have a use case where they want to use the managed identity token for executing the connectedk8s operations. Also, in these scenarios, the connectedk8s CLI will be running inside a container and not on user's machine, so we're fine with setting it as environment variable |
@akashkeshari Got it, thanks~ |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
def signed_session(self, session=None): | ||
session = session or requests.Session() | ||
header = "{} {}".format('Bearer', self.access_token) | ||
session.headers['Authorization'] = header | ||
return session |
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.
This is only for Track 1 SDK. Most likely you won't need it. :)
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.
I think we require this since the 'GraphRbacManagementClient' still calls this function. When this function was not implemented , I saw the following error : ''AccessTokenCredential' object has no attribute 'signed_session''
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.
GraphRbacManagementClient
is the old Track 1 SDK for AD Graph. Consider using MS Graph client: https://github.com/Azure/azure-cli/blob/dev/doc/microsoft_graph_client.md
[Release] Update index.json for extension [ connectedk8s ] : https://dev.azure.com/azclitools/internal/_build/results?buildId=32118&view=results |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.json
automatically.The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify
src/index.json
.Changes in the PR: