Skip to content

Commit

Permalink
Replaced "codename" with "passphrase"
Browse files Browse the repository at this point in the history
- updated interface strings
- for consistency, updated CSS names as well
- updated session key name
  • Loading branch information
zenmonkeykstop committed Jun 17, 2022
1 parent 54fc832 commit fb12461
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
24 changes: 12 additions & 12 deletions securedrop/sass/source.sass
Original file line number Diff line number Diff line change
Expand Up @@ -458,18 +458,18 @@ mark
background: $passphrase_masked_color
clip-path: polygon(0% 0%, 0% 100%, 20% 100%, 20% 0%, 23% 0%, 23% 100%, 32% 100%, 32% 0%, 35% 0%, 35% 100%, 42% 100%, 42% 0%, 45% 0%, 45% 100%, 64% 100%, 64% 0%, 67% 0%, 67% 100%, 74% 100%, 74% 0%, 77% 0%, 77% 100%, 90% 100%, 90% 0%, 93% 0%, 93% 100%, 100% 100%, 100% 0%)

#codename-reminder
#passphrase-reminder
font-size: 18px
color: $heading_alt_color

#codename-show-checkbox
#passphrase-show-checkbox
position: absolute
@include ltr
left: -999rem
@include rtl
right: -999rem

&~ #codename-show
&~ #passphrase-show
font-size: 11px
line-height: 14px
margin-top: -2px
Expand All @@ -486,7 +486,7 @@ mark
border-color: $checkbox_hover_border
box-shadow: inset 0 0 0 1px $checkbox_hover_border_inside

@mixin codename-show-checkbox
@mixin passphrase-show-checkbox
content: ""
background: $body_bg
display: block
Expand All @@ -496,10 +496,10 @@ mark

&::before
@include ltr
@include codename-show-checkbox
@include passphrase-show-checkbox
&::after
@include rtl
@include codename-show-checkbox
@include passphrase-show-checkbox

&::before
@include ltr
Expand All @@ -510,7 +510,7 @@ mark
margin-left: 12px
float: right

&:focus-visible ~ #codename-show
&:focus-visible ~ #passphrase-show
box-shadow: 0 0 0 3px $focus_shadow

&:checked ~ mark > span
Expand All @@ -528,14 +528,14 @@ mark
height: 13px
border: 0

&:checked ~ #codename-show::before
&:checked ~ #passphrase-show::before
@include ltr
@include checked
&:checked ~ #codename-show::after
&:checked ~ #passphrase-show::after
@include rtl
@include checked

#codename-show
#passphrase-show
display: block

#upload
Expand Down Expand Up @@ -937,7 +937,7 @@ section[aria-labelledby="submit-heading"]
section[aria-labelledby="welcome-heading"]
margin-top: 50px

section[aria-labelledby="codename-reminder"] + section h2
section[aria-labelledby="passphrase-reminder"] + section h2
padding-top: 26px

#source-lookup main, #source-logout main
Expand Down Expand Up @@ -1128,7 +1128,7 @@ section[aria-labelledby="codename-reminder"] + section h2
.info
padding: 9px

#flashed + section, #codename-hint + section:not(#flashed)
#flashed + section, #passphrase-hint + section:not(#flashed)
margin-top: 3em

#source-lookup nav + section:not(#flashed)
Expand Down
2 changes: 1 addition & 1 deletion securedrop/source_app/session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SessionManager:
"""Helper to manage the user's session cookie accessible via flask.session."""

# The keys in flask.session for the user's passphrase and expiration date
_SESSION_COOKIE_KEY_FOR_CODENAME = "codename"
_SESSION_COOKIE_KEY_FOR_CODENAME = "passphrase"
_SESSION_COOKIE_KEY_FOR_EXPIRATION_DATE = "expires"

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion securedrop/source_templates/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ <h2>{{ gettext('Server error') }}</h2>

<p>{{ gettext('Sorry, the website encountered an error and was unable to complete your request.') }}</p>

<p><a href="{{ url_for('main.login') }}">{{ gettext('Look up a codename...') }}</a></p>
<p><a href="{{ url_for('main.login') }}">{{ gettext('Look up a passphrase...') }}</a></p>
{% endblock %}
2 changes: 1 addition & 1 deletion securedrop/source_templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h2 id="first-submission-heading">{{ gettext('First submission') }}</h2>

<section id="return-visit" aria-labelledby="return-visit-heading">
<h2 id="return-visit-heading">{{ gettext('Return visit') }}</h2>
<p>{{ gettext('Already have a codename? Check for replies or submit something new.') }}</p>
<p>{{ gettext('Already have a passphrase? Check for replies or submit something new.') }}</p>
<a href="{{ url_for('main.login') }}" class="btn secondary"
aria-label="{{ gettext('Log In') }}">
{{ gettext('LOG IN') }}
Expand Down
10 changes: 5 additions & 5 deletions securedrop/source_templates/lookup.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ <h2 id="welcome-heading">{{ gettext('Welcome!') }}</h2>
<section aria-labelledby="keep-in-touch-heading">
<h2 id="keep-in-touch-heading">{{ gettext('Keep In Touch') }}</h2>

<p id="codename-explanation">{{ gettext('A <em>codename</em> in SecureDrop functions as both your username and your password.') }}</p>
<p>{{ gettext('You will need this codename to log into our SecureDrop later:') }}</p>
<p id="passphrase-explanation">{{ gettext('A <em>passphrase</em> in SecureDrop functions as both your username and your password.') }}</p>
<p>{{ gettext('You will need this passphrase to log into our SecureDrop later:') }}</p>

{{ utils.codename(new_user_passphrase) }}
{{ utils.passphrase(new_user_passphrase) }}

<ul id="codename-instructions">
<ul id="passphrase-instructions">
<li>{{ gettext('<strong>Keep it secret.</strong> Do not share it with anyone.') }}</li>
<li>{{ gettext('<strong>Keep it safe.</strong> There is no account recovery option.') }}</li>
</ul>
Expand All @@ -38,7 +38,7 @@ <h2 id="replies-heading">{{ gettext('Replies') }}</h2>
<div id="replies">
{% if replies %}
<p class="info">
{{ gettext("You have received a reply. To protect your identity in the unlikely event someone learns your codename, please delete all replies when you're done with them. This also lets us know that you are aware of our reply. You can respond by submitting new files and messages above.") }}
{{ gettext("You have received a reply. To protect your identity in the unlikely event someone learns your passphrase, please delete all replies when you're done with them. This also lets us know that you are aware of our reply. You can respond by submitting new files and messages above.") }}
</p>
{% for reply in replies %}
{%- set timestamp = utils.relative_time(reply.date) -%}
Expand Down
2 changes: 1 addition & 1 deletion securedrop/source_templates/notfound.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ <h2>{{ gettext('Page not found') }}</h2>

<p id="page-not-found">{{ gettext("Sorry, we couldn't locate what you requested.") }}</p>

<p><a href="{{ url_for('main.login') }}">{{ gettext('Look up a codename...') }}</a></p>
<p><a href="{{ url_for('main.login') }}">{{ gettext('Look up a passphrase...') }}</a></p>
{% endblock %}
18 changes: 9 additions & 9 deletions securedrop/source_templates/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
datetime="{{ date|html_datetime_format }}">{{ date|rel_datetime_format(relative=True) }}</time>
{%- endmacro -%}

{%- macro codename(codename, new=True) -%}
<div aria-labelledby="codename-heading">
<h3 id="codename-heading" hidden>{{ gettext('Codename') }}</h3>
{%- macro passphrase(passphrase, new=True) -%}
<div aria-labelledby="passphrase-heading">
<h3 id="passphrase-heading" hidden>{{ gettext('Passphrase') }}</h3>

<input id="codename-show-checkbox" type="checkbox" role="button"{% if new %} checked {% endif -%}
aria-label="{{ gettext('Show Codename') }}" aria-controls="codename">
<input id="passphrase-show-checkbox" type="checkbox" role="button"{% if new %} checked {% endif -%}
aria-label="{{ gettext('Show Passphrase') }}" aria-controls="passphrase">

<mark id="codename" lang="en-US" dir="ltr"
aria-describedby="codename-instructions codename-explanation"><span>{{ codename }}</span></mark>
<mark id="passphrase" lang="en-US" dir="ltr"
aria-describedby="passphrase-instructions passphrase-explanation"><span>{{ passphrase }}</span></mark>

<label for="codename-show-checkbox" id="codename-show"
<label for="passphrase-show-checkbox" id="passphrase-show"
aria-hidden="true">
{{ gettext('Show Codename') }}
{{ gettext('Show Passphrase') }}
</label>

</div>
Expand Down

0 comments on commit fb12461

Please sign in to comment.