-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
ui/provide otp #8630
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
</h4> | ||
<code class="is-word-break">{{encoded_token}}</code> | ||
</div> | ||
|
@@ -23,20 +19,19 @@ | |
<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|}} | ||
{{#with (if otp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I read the documentation on these template helpers, but I'm unclear why it's better to use "with" here instead of "let". This is more of a clarity question as I'm not super familiar with these template helpers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is an excellent question! your instincts to use https://github.com/emberjs/rfcs/blob/master/text/0445-deprecate-with.md#motivation |
||
(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"> | ||
DR Operation Token Command | ||
</h4> | ||
<code class="is-word-break">{{cmd}}</code> | ||
</div> | ||
{{/let}} | ||
{{/with}} | ||
</div> | ||
{{/if}} | ||
</div> | ||
<div class="box is-marginless is-shadowless"> | ||
<button type="button" class="button" {{action 'reset'}}> | ||
|
@@ -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}} | ||
|
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.
Is there a difference here between encoded and encrypted? Is it important to keep the word encrypted on the refresh situation?
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.
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?
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 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.