Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Config Refactor Round 2. #2771

Merged

Conversation

nharper285
Copy link
Contributor

@nharper285 nharper285 commented Jan 24, 2023

Summary of the Pull Request

What is this about?
Currently, a number of parameters and arguments must be specified when a user configures their endpoint to an instance.
ex.
onefuzz config --endpoint https://[endpoint].azurewebsites.net/ --authority https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47 --client_id 72f1562a-8c0c-41ea-beb9-fa2b71c80134

These parameters - authority, client_id, tenant_domain, etc. - are used to authenticate to the instance when a user runs a CLI command. They are stored on the local machine, as well.

Proposal
Refactor the CLI config command such that it does not require these parameters and only asks the user to specify the endpoint. Instead, store the additional config params on the instance - to be set at deployment time - and pull them down every time a user makes a request.

PR Checklist

Validation Steps Performed

How does someone test & validate?

  • Single-tenant deployment w/ ms tenant
  • Single-tenant deployment w/ secure tenant
  • Multi-tenant deployment
  • Run command against ms tenant instance
  • Run command against secure tenant instance
  • Run command against multi-tenant instance
  • Run command w/ service prinicpal
  • Deploy upgrade using existing service principal

@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2023

Codecov Report

Merging #2771 (e5d1e2c) into main (3d2fb65) will decrease coverage by 0.02%.
The diff coverage is 3.84%.

@@            Coverage Diff             @@
##             main    #2771      +/-   ##
==========================================
- Coverage   29.16%   29.14%   -0.02%     
==========================================
  Files         321      322       +1     
  Lines       38583    38607      +24     
==========================================
  Hits        11252    11252              
- Misses      27331    27355      +24     
Impacted Files Coverage Δ
src/ApiService/ApiService/Functions/Config.cs 0.00% <0.00%> (ø)
...rc/ApiService/ApiService/OneFuzzTypes/Responses.cs 72.29% <0.00%> (-2.01%) ⬇️
src/ApiService/ApiService/ServiceConfiguration.cs 0.00% <0.00%> (ø)
src/ApiService/ApiService/UserCredentials.cs 32.35% <0.00%> (ø)
...iService/ApiService/onefuzzlib/ConfigOperations.cs 32.35% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@nharper285 nharper285 marked this pull request as ready for review January 25, 2023 19:50
src/cli/onefuzz/api.py Outdated Show resolved Hide resolved
src/cli/onefuzz/api.py Outdated Show resolved Hide resolved
src/cli/onefuzz/backend.py Outdated Show resolved Hide resolved
src/cli/onefuzz/backend.py Outdated Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants