Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Asking for credential during formula runtime #423

Conversation

henriquemoraes8
Copy link
Contributor

@henriquemoraes8 henriquemoraes8 commented Aug 13, 2020

Description

When a user executes a formula that requires credentials, it halts demanding her to set the credentials through the rit set credential command. This behavior may affect the user experience especially in case of custom credentials.
The idea is to detect the credential keys that have not been set and ask for them during runtime.

Discussion

A user may never require to understand how credentials work in Ritchie if he just fills correctly when required. This feature works as an abstraction for those who just want to use the cli without worrying too much about its mechanics.
This will work even for custom credentials or multi-field providers. It records the prompted value as if the user run rit set credential
It does not create the provider in case it does not exist. The user should manually set a custom provider.
This will record even if the config.json file has a typo on either the provider or the key

How to verify it

Run a formula that requires credentials without having them set

Description for the changelog

Credentials are asked during formula runtime in case they were not set

The example below shows the behavior running rit aws create bucket without previously having any credential set
Screen Shot 2020-08-12 at 22 03 15

Signed-off-by: Henrique Moraes <henrique.moraes@zup.com.br>

[Enhancement] Ask for credential during formula runtime#
@henriquemoraes8 henriquemoraes8 force-pushed the enhancement/credential-dynamic-prompt branch from 471902b to 44e0793 Compare August 13, 2020 00:44
Signed-off-by: Henrique Moraes <henrique.moraes@zup.com.br>
@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2020

Codecov Report

Merging #423 into master will increase coverage by 0.21%.
The diff coverage is 90.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #423      +/-   ##
==========================================
+ Coverage   65.62%   65.84%   +0.21%     
==========================================
  Files          80       81       +1     
  Lines        2720     2743      +23     
==========================================
+ Hits         1785     1806      +21     
  Misses        751      751              
- Partials      184      186       +2     
Impacted Files Coverage Δ
pkg/env/envcredential/env_credential.go 82.60% <90.00%> (ø)
pkg/credential/finder.go 68.42% <100.00%> (ø)
pkg/formula/watcher/watcher.go 76.47% <0.00%> (+5.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34832e7...244c6e6. Read the comment docs.

@henriquemoraeszup henriquemoraeszup added the 🔨 improvement Improvement in features label Aug 13, 2020
Signed-off-by: Henrique Moraes <henrique.moraes@zup.com.br>
@brunasilvazup brunasilvazup added this to the 2.0.4 milestone Aug 13, 2020
@brunasilvazup brunasilvazup changed the title [Enhancement] Asking for credential during formula runtime Asking for credential during formula runtime Aug 13, 2020
@brunasilvazup brunasilvazup added waiting reply Waiting for an answer to a comment and removed ✔️ ready-for-review ready for review labels Aug 13, 2020
Signed-off-by: Henrique Moraes <henrique.moraes@zup.com.br>
@henriquemoraeszup henriquemoraeszup removed the waiting reply Waiting for an answer to a comment label Aug 14, 2020
@brunasilvazup brunasilvazup removed this from the 2.0.4 milestone Aug 17, 2020
@brunasilvazup brunasilvazup added waiting reply Waiting for an answer to a comment and removed ✔️ ready-for-review ready for review labels Aug 18, 2020
Signed-off-by: Henrique Moraes <henrique.moraes@zup.com.br>

Actually removing test files
@henriquemoraes8 henriquemoraes8 force-pushed the enhancement/credential-dynamic-prompt branch from 0cc1b76 to fd3dd12 Compare August 18, 2020 19:34
@brunasilvazup brunasilvazup removed the waiting reply Waiting for an answer to a comment label Aug 18, 2020
@brunasilvazup brunasilvazup added this to the 2.0.5 milestone Aug 21, 2020
Signed-off-by: Henrique Moraes <henrique.rusca@gmail.com>
@victor-schumacher
Copy link
Contributor

/merge qa

@brunasilvazup
Copy link
Contributor

/merge qa

@ritchie-bot
Copy link
Contributor

ritchie-bot bot commented Aug 26, 2020

👌 Merged branch enhancement/credential-dynamic-prompt into qa

@victor-schumacher victor-schumacher merged commit 4896b22 into ZupIT:master Aug 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 improvement Improvement in features ✔️ ready-for-review ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create provider and credential automatically according to the executed formula
6 participants