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

ui/provide otp #8630

Merged
merged 4 commits into from Mar 31, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 18 additions & 9 deletions ui/app/templates/components/shamir-flow.hbs
Expand Up @@ -4,11 +4,7 @@
<HoverCopyButton @copyValue={{encoded_token}} />
<div class="message-body">
<h4 class="title is-7 is-marginless">
{{#if otp}}
Encoded Operation Token
{{else}}
Encrypted Operation Token
{{/if}}
Encoded Operation Token
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a difference here between encoded and encrypted? Is it important to keep the word encrypted on the refresh situation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for this question! i wondered the same thing. all of the examples in this previous commit [1][2] made it sound like the resulting value is actually encoded -- i couldn't figure out why we ever referred to it as encrypted. @meirish do you know?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think originally this was meant to denote the difference between the PGP encrypted, and the OTP which does an XOR (https://en.wikipedia.org/wiki/XOR_cipher#Use_and_security) to decode the token, but I don't think it's important to keep. Looking at the wikipedia page, OTP stands for "one time pad" not "one time password" which I didn't realize when building this the first time.

</h4>
<code class="is-word-break">{{encoded_token}}</code>
</div>
Expand All @@ -23,10 +19,10 @@
<code class="is-word-break">{{otp}}</code>
</div>
</div>
{{/if}}
<div class="message is-list has-copy-button" tabindex="-1">
{{#let
(concat 'vault operator generate-root -dr-token -otp="' otp '" -decode="' encoded_token '"')
as |cmd|}}
{{#let (if otp
(concat 'vault operator generate-root -otp="' otp '" -decode="' encoded_token '"') (concat 'vault operator generate-root -otp="<enter your otp here>" -decode="' encoded_token '"') ) as |cmd|}}
<HoverCopyButton @copyValue={{cmd}} />
<div class="message-body">
<h4 class="title is-7 is-marginless">
Expand All @@ -36,7 +32,6 @@
</div>
{{/let}}
</div>
{{/if}}
</div>
<div class="box is-marginless is-shadowless">
<button type="button" class="button" {{action 'reset'}}>
Expand Down Expand Up @@ -131,6 +126,20 @@
</div>
{{/if}}
<div class="box is-shadowless is-marginless no-padding-top is-fullwidth" data-test-form-text>
{{#if otp}}
<p>
<AlertBanner @type="info" @message="Below is the generated OTP. This will be used to encode the generated Operation Token. Make sure to save this, as you will need it later to decode the Operation Token." />
</p>
<div class="message is-list has-copy-button" tabindex="-1">
<HoverCopyButton @copyValue={{otp}} />
<div class="message-body">
<h4 class="title is-7 is-marginless">
One Time Password (otp)
</h4>
<code class="is-word-break">{{otp}}</code>
</div>
</div>
{{/if}}
{{#if (has-block)}}
{{yield}}
{{else if formText}}
Expand Down