Skip to content
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

{Core} Expose public interface for SecretStore #22372

Merged
merged 3 commits into from
May 16, 2022
Merged

Conversation

jiasli
Copy link
Member

@jiasli jiasli commented May 12, 2022

Description

Expose public interface for using encrypted SecretStore so that command modules or extensions (such as calvinsID/azure-cli-extensions#97) can leverage msal-extensions to save custom data such as tokens.

Testing Guide

On Windows:

> az demo secret-store save "name=Johann Sebastian Bach" job=musician
Data written to C:\Users\username\.azure\secret_store_demo.bin: {'name': 'Johann Sebastian Bach', 'job': 'musician'}

> az demo secret-store load
{
  "job": "musician",
  "name": "Johann Sebastian Bach"
}

Turn off token encryption:

> az config set core.encrypt_token_cache=False

> az demo secret-store save "name=Johann Sebastian Bach" job=musician
Data written to C:\Users\username\.azure\secret_store_demo.json: {'name': 'Johann Sebastian Bach', 'job': 'musician'}

> az demo secret-store load
{
  "job": "musician",
  "name": "Johann Sebastian Bach"
}

@ghost ghost added Auto-Assign Auto assign by bot Core CLI core infrastructure labels May 12, 2022
@ghost ghost requested a review from yonzhan May 12, 2022 10:57
@ghost ghost assigned jiasli May 12, 2022
@ghost ghost added this to the May 2022 (2022-05-24) - For Build milestone May 12, 2022
@jiasli jiasli marked this pull request as draft May 12, 2022 10:58
@yonzhan
Copy link
Collaborator

yonzhan commented May 12, 2022

A good solution for SecretStore

@jiasli jiasli requested a review from StrawnSC May 12, 2022 11:08
Copy link
Contributor

@StrawnSC StrawnSC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works as expected when I try with our setup here (caching GitHub credentials for the containerapp extension). Thanks!

@jiasli jiasli marked this pull request as ready for review May 13, 2022 09:45
@jiasli
Copy link
Member Author

jiasli commented May 13, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@jiasli jiasli requested a review from rayluo May 16, 2022 07:34
@jiasli
Copy link
Member Author

jiasli commented May 16, 2022

@rayluo, CLI is helping msal-extensions have more users! 🤣

@jiasli jiasli merged commit 397db42 into Azure:dev May 16, 2022
@jiasli jiasli deleted the secret-store branch May 16, 2022 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Core CLI core infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants