-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap up max attempts and reads feature
- Loading branch information
1 parent
a26b57f
commit c832b95
Showing
6 changed files
with
272 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 34 additions & 10 deletions
44
lib/heimdall_web/controllers/secret_html/secret_404.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,106 @@ | ||
<div class="border rounded-xl px-6 py-8"> | ||
<div class="text-center text-xl mb-4"> | ||
Showing Secret: "<i><%= @secret.title %></i>" | ||
</div> | ||
<%= unless @redirect do %> | ||
<div class="border rounded-xl px-6 py-8"> | ||
<div class="text-center text-xl mb-4"> | ||
Showing Secret: "<i><%= @secret.title %></i>" | ||
</div> | ||
|
||
<%= if @decrypted_text do %> | ||
<div class="mt-2"> | ||
<.label for="decrypted_secret">Decrypted Secret</.label> | ||
<%= if @decrypted_text do %> | ||
<div class="mt-2"> | ||
<.label for="decrypted_secret">Decrypted Secret</.label> | ||
|
||
<.input type="textarea" name="key" value={@decrypted_text} readonly /> | ||
</div> | ||
<% else %> | ||
<div class="mt-2"> | ||
<.form for={%{}} phx-submit="decrypt"> | ||
<%= if @secret.encryption_algo == :rsa do %> | ||
<div x-data="{ show: false }"> | ||
<div class="grid grid-cols-4"> | ||
<div class="mt-0.5"> | ||
<.label for="decryption_key">RSA Private Key PEM</.label> | ||
</div> | ||
<.input type="textarea" name="key" value={@decrypted_text} readonly /> | ||
</div> | ||
<% else %> | ||
<div class="mt-2"> | ||
<.form for={%{}} phx-submit="decrypt"> | ||
<%= if @secret.encryption_algo == :rsa do %> | ||
<div x-data="{ show: false }"> | ||
<div class="grid grid-cols-4"> | ||
<div class="mt-0.5"> | ||
<.label for="decryption_key">RSA Private Key PEM</.label> | ||
</div> | ||
|
||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="!show" | ||
@click="show = true" | ||
> | ||
<.icon name="hero-eye" class="h-5 w-5" /> | ||
</div> | ||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="!show" | ||
@click="show = true" | ||
> | ||
<.icon name="hero-eye" class="h-5 w-5" /> | ||
</div> | ||
|
||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="show" | ||
@click="show = false" | ||
style="display: none;" | ||
> | ||
<.icon name="hero-eye-slash" class="h-5 w-5" /> | ||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="show" | ||
@click="show = false" | ||
style="display: none;" | ||
> | ||
<.icon name="hero-eye-slash" class="h-5 w-5" /> | ||
</div> | ||
</div> | ||
|
||
<.input | ||
type="textarea" | ||
autocomplete="off" | ||
name="key" | ||
spellcheck="false" | ||
value="" | ||
style="color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);" | ||
x-bind:style="!show && 'color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);'" | ||
/> | ||
</div> | ||
|
||
<.input | ||
type="textarea" | ||
autocomplete="off" | ||
name="key" | ||
spellcheck="false" | ||
value="" | ||
style="color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);" | ||
x-bind:style="!show && 'color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);'" | ||
/> | ||
</div> | ||
<br /> | ||
<% end %> | ||
|
||
<br /> | ||
<% end %> | ||
<%= if @secret.encryption_algo == :aes_gcm do %> | ||
<div x-data="{ show: false }"> | ||
<div class="grid grid-cols-4"> | ||
<div class="mt-0.5"> | ||
<.label for="decryption_key">Password</.label> | ||
</div> | ||
|
||
<%= if @secret.encryption_algo == :aes_gcm do %> | ||
<div x-data="{ show: false }"> | ||
<div class="grid grid-cols-4"> | ||
<div class="mt-0.5"> | ||
<.label for="decryption_key">Password</.label> | ||
</div> | ||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="!show" | ||
@click="show = true" | ||
> | ||
<.icon name="hero-eye" class="h-5 w-5" /> | ||
</div> | ||
|
||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="!show" | ||
@click="show = true" | ||
> | ||
<.icon name="hero-eye" class="h-5 w-5" /> | ||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="show" | ||
@click="show = false" | ||
style="display: none;" | ||
> | ||
<.icon name="hero-eye-slash" class="h-5 w-5" /> | ||
</div> | ||
</div> | ||
|
||
<div | ||
class="col-start-6 text-right rounded rounded-xl text-blue-800 hover:text-blue-400 cursor-pointer" | ||
x-show="show" | ||
@click="show = false" | ||
style="display: none;" | ||
> | ||
<.icon name="hero-eye-slash" class="h-5 w-5" /> | ||
</div> | ||
<.input | ||
autocomplete="off" | ||
name="key" | ||
spellcheck="false" | ||
value="" | ||
style="color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);" | ||
x-bind:style="!show && 'color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);'" | ||
/> | ||
</div> | ||
|
||
<.input | ||
autocomplete="off" | ||
name="key" | ||
spellcheck="false" | ||
value="" | ||
style="color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);" | ||
x-bind:style="!show && 'color: transparent;text-shadow: 0 0 8px rgba(0,0,0,0.5);'" | ||
/> | ||
</div> | ||
<br /> | ||
<% end %> | ||
|
||
<br /> | ||
<% end %> | ||
<%= if @secret.encryption_algo == :plaintext do %> | ||
<div class="hidden"> | ||
<.input name="key" value="plaintext" /> | ||
</div> | ||
<% end %> | ||
|
||
<%= if @secret.encryption_algo == :plaintext do %> | ||
<div class="hidden"> | ||
<.input name="key" value="plaintext" /> | ||
<div class="text-center"> | ||
<.button>Reveal Secret</.button> | ||
</div> | ||
<% end %> | ||
|
||
<div class="text-center"> | ||
<.button>Reveal Secret</.button> | ||
</div> | ||
</.form> | ||
</div> | ||
<% end %> | ||
</div> | ||
</.form> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.