From fce15599646c9a9ce009ff00564715afe586059c Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Fri, 11 Sep 2020 15:45:18 -0400 Subject: [PATCH 1/6] Move realm selection to login package --- cmd/server/assets/{realms/select.html => login/select-realm.html} | 0 pkg/controller/{realm/index.go => login/select.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename cmd/server/assets/{realms/select.html => login/select-realm.html} (100%) rename pkg/controller/{realm/index.go => login/select.go} (100%) diff --git a/cmd/server/assets/realms/select.html b/cmd/server/assets/login/select-realm.html similarity index 100% rename from cmd/server/assets/realms/select.html rename to cmd/server/assets/login/select-realm.html diff --git a/pkg/controller/realm/index.go b/pkg/controller/login/select.go similarity index 100% rename from pkg/controller/realm/index.go rename to pkg/controller/login/select.go From cd4a018bdbfb3c85e4e2be1ae8f134338dad2496 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Fri, 11 Sep 2020 16:31:56 -0400 Subject: [PATCH 2/6] Use a pill instead of changing the background --- cmd/server/assets/login/select-realm.html | 56 ++++++++++++++--------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/cmd/server/assets/login/select-realm.html b/cmd/server/assets/login/select-realm.html index cbd45c4ee..f79245d71 100644 --- a/cmd/server/assets/login/select-realm.html +++ b/cmd/server/assets/login/select-realm.html @@ -17,30 +17,42 @@ {{template "flash" .}}

Select your realm

-

- You are a member of multiple realms - please select one to continue. You - can switch to another realm at any time. -

+ {{if $realms}} +

+ You are a member of multiple realms - please select one to continue. You + can switch to another realm at any time. +

-
- {{range $realm := $realms}} -
- {{$csrfField}} - - -
-
{{$realm.Name}}
- {{if $realm.RegionCode}} -

{{$realm.RegionCode}}

- {{end}} -
-
- -
-
-
+ + {{else}} +

+ You are not a member of any realms. Contact your realm administrator for + assistance. +

{{end}} -
{{template "scripts" .}} From b918665fc93b197eb9d948b6b35879a37a7875fa Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Fri, 11 Sep 2020 16:33:01 -0400 Subject: [PATCH 3/6] Rename verify email --- cmd/server/assets/login/{verifyemail.html => verify-email.html} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cmd/server/assets/login/{verifyemail.html => verify-email.html} (100%) diff --git a/cmd/server/assets/login/verifyemail.html b/cmd/server/assets/login/verify-email.html similarity index 100% rename from cmd/server/assets/login/verifyemail.html rename to cmd/server/assets/login/verify-email.html From 66ea845e98de6cafadcd32a142df1a8f190550bd Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Fri, 11 Sep 2020 16:34:41 -0400 Subject: [PATCH 4/6] Rename register phone --- .../assets/login/{registerphone.html => register-phone.html} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cmd/server/assets/login/{registerphone.html => register-phone.html} (100%) diff --git a/cmd/server/assets/login/registerphone.html b/cmd/server/assets/login/register-phone.html similarity index 100% rename from cmd/server/assets/login/registerphone.html rename to cmd/server/assets/login/register-phone.html From 1b49ae4c16ff224e3a67deff49c0c8ac9df5853c Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Fri, 11 Sep 2020 16:35:26 -0400 Subject: [PATCH 5/6] Rename reset password --- .../assets/login/{resetpassword.html => reset-password.html} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cmd/server/assets/login/{resetpassword.html => reset-password.html} (100%) diff --git a/cmd/server/assets/login/resetpassword.html b/cmd/server/assets/login/reset-password.html similarity index 100% rename from cmd/server/assets/login/resetpassword.html rename to cmd/server/assets/login/reset-password.html From d9a37cead5fb037cb06f063e13f852765231dec3 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Fri, 11 Sep 2020 18:45:35 -0400 Subject: [PATCH 6/6] Standardize a bunch of UX and file structures --- cmd/server/assets/admin/new.html | 143 +++++++++--------- cmd/server/assets/admin/realms.html | 4 +- cmd/server/assets/apikeys/edit.html | 55 +++---- cmd/server/assets/apikeys/index.html | 4 +- cmd/server/assets/apikeys/new.html | 50 +++--- cmd/server/assets/apikeys/show.html | 8 +- cmd/server/assets/codestatus/index.html | 10 +- cmd/server/assets/codestatus/show.html | 81 +++++----- cmd/server/assets/header.html | 5 +- cmd/server/assets/home.html | 12 +- cmd/server/assets/login/_loginscripts.html | 2 +- cmd/server/assets/login/login.html | 2 +- cmd/server/assets/login/register-phone.html | 76 +++++----- cmd/server/assets/login/reset-password.html | 2 +- cmd/server/assets/login/select-realm.html | 86 ++++++----- cmd/server/assets/login/signout.html | 7 +- cmd/server/assets/login/verify-email.html | 38 ++--- cmd/server/assets/realm.html | 12 +- cmd/server/assets/realmkeys.html | 11 +- cmd/server/assets/realmstats.html | 7 +- cmd/server/assets/users/_form.html | 67 ++++---- cmd/server/assets/users/edit.html | 5 +- cmd/server/assets/users/index.html | 4 +- cmd/server/assets/users/new.html | 4 +- cmd/server/assets/users/show.html | 8 +- cmd/server/main.go | 56 +++---- pkg/controller/controller.go | 4 +- pkg/controller/login/register.go | 2 +- .../{resetpassword.go => reset_password.go} | 2 +- pkg/controller/login/select.go | 76 +++++++--- .../login/{verifyemail.go => verify_email.go} | 2 +- pkg/controller/middleware/emailverified.go | 2 +- pkg/controller/realm/realm.go | 47 ------ pkg/controller/realm/select.go | 70 --------- 34 files changed, 424 insertions(+), 540 deletions(-) rename pkg/controller/login/{resetpassword.go => reset_password.go} (95%) rename pkg/controller/login/{verifyemail.go => verify_email.go} (95%) delete mode 100644 pkg/controller/realm/realm.go delete mode 100644 pkg/controller/realm/select.go diff --git a/cmd/server/assets/admin/new.html b/cmd/server/assets/admin/new.html index 6939cfa2f..5f55a042d 100644 --- a/cmd/server/assets/admin/new.html +++ b/cmd/server/assets/admin/new.html @@ -6,9 +6,10 @@ {{template "head" .}} + {{template "floatingform" .}} - + {{template "navbar" .}}
@@ -19,98 +20,90 @@

New realm

Use the form below to create a new realm.

-
+
Details
{{ .csrfField }} -
- -
- - {{if $realm.ErrorsFor "name"}} -
- {{joinStrings ($realm.ErrorsFor "name") ", "}} -
- {{end}} +
+ + + {{if $realm.ErrorsFor "name"}} +
+ {{joinStrings ($realm.ErrorsFor "name") ", "}}
+ {{end}} + + The realm name should be descriptive. It must also be globally + unique. +
-
- -
- - {{if $realm.ErrorsFor "regionCode"}} -
- {{joinStrings ($realm.ErrorsFor "regionCode") ", "}} -
- {{end}} - - Used in creating deep link SMS for multi-helath authority apps. Region should - be ISO 3166-1 country codes and ISO 3166-2 subdivision codes where applicable. - For example, Washington State would be US-WA. - +
+ + + {{if $realm.ErrorsFor "regionCode"}} +
+ {{joinStrings ($realm.ErrorsFor "regionCode") ", "}}
+ {{end}} + + Used in creating deep link SMS for multi-helath authority apps. Region should + be ISO 3166-1 country codes and ISO 3166-2 subdivision codes where applicable. + For example, Washington State would be US-WA. +
{{if .supportsPerRealmSigning}} -
- -
- - {{if $realm.ErrorsFor "UseRealmCertificateKey"}} -
- {{joinStrings ($realm.ErrorsFor "UseRealmCertificateKey") ", "}} -
- {{end}} - - It is recommended that you create a realm specific signing key when creating a new realm. However, it - is important to note that this once a realm is created, you cannot switch back to using the system - signing key. - +
+ + {{if $realm.ErrorsFor "UseRealmCertificateKey"}} +
+ {{joinStrings ($realm.ErrorsFor "UseRealmCertificateKey") ", "}}
+ {{end}} + + It is recommended that you create a realm-specific signing key when creating a new realm. However, it + is important to note that this once a realm is created, you cannot switch back to using the system + signing key. +
- -
- -
- - {{if $realm.ErrorsFor "certificateIssuer"}} -
- {{joinStrings ($realm.ErrorsFor "certificateIssuer") ", "}} -
- {{end}} - - This value is specific to the health authority.
After created using realm specific keys, this field cannot be changed. -
-
+ +
+ + + {{if $realm.ErrorsFor "certificateIssuer"}} +
+ {{joinStrings ($realm.ErrorsFor "certificateIssuer") ", "}} +
+ {{end}} + + This value is specific to the health authority. After created + using realm-specific keys, this field cannot be changed. +
-
- -
- - {{if $realm.ErrorsFor "certificateAudience"}} -
- {{joinStrings ($realm.ErrorsFor "certificateAudience") ", "}} -
- {{end}} - - The audience (aud) value is provided the key server operator.
- After upgrading to use realm specific keys, this field cannot be changed. -
-
+ +
+ + + {{if $realm.ErrorsFor "certificateAudience"}} +
+ {{joinStrings ($realm.ErrorsFor "certificateAudience") ", "}} +
+ {{end}} + + The audience (aud) value is provided the key + server operator. After upgrading to use realm-specific keys, + this field cannot be changed. +
{{end}} -
-
- -
-
+
diff --git a/cmd/server/assets/admin/realms.html b/cmd/server/assets/admin/realms.html index c62e846f7..adcf97cfe 100644 --- a/cmd/server/assets/admin/realms.html +++ b/cmd/server/assets/admin/realms.html @@ -6,7 +6,7 @@ {{template "head" .}} - + {{template "navbar" .}}
@@ -19,7 +19,7 @@

Realms

{{if .realms}}
- +
diff --git a/cmd/server/assets/apikeys/edit.html b/cmd/server/assets/apikeys/edit.html index dbb875aa1..b35ca3cea 100644 --- a/cmd/server/assets/apikeys/edit.html +++ b/cmd/server/assets/apikeys/edit.html @@ -6,9 +6,10 @@ {{template "head" .}} + {{template "floatingform" .}} - + {{template "navbar" .}}
@@ -19,46 +20,38 @@

Edit API key

Use the form below to edit the API key.

-
+
Details
{{ .csrfField }} -
- -
- - {{if $authApp.ErrorsFor "name"}} -
- {{joinStrings ($authApp.ErrorsFor "name") ", "}} -
- {{end}} -
-
-
- -
- +
+ + + {{if $authApp.ErrorsFor "name"}} +
+ {{joinStrings ($authApp.ErrorsFor "name") ", "}}
+ {{end}}
-
-
- -
+
+
+ +
diff --git a/cmd/server/assets/apikeys/index.html b/cmd/server/assets/apikeys/index.html index 078c1e409..d2d4b900b 100644 --- a/cmd/server/assets/apikeys/index.html +++ b/cmd/server/assets/apikeys/index.html @@ -8,7 +8,7 @@ {{template "head" .}} - + {{template "navbar" .}}
@@ -22,7 +22,7 @@

API keys

{{if .apps}}
-
Name
+
diff --git a/cmd/server/assets/apikeys/new.html b/cmd/server/assets/apikeys/new.html index 4e7d574ec..85609f4bd 100644 --- a/cmd/server/assets/apikeys/new.html +++ b/cmd/server/assets/apikeys/new.html @@ -6,9 +6,10 @@ {{template "head" .}} + {{template "floatingform" .}} - + {{template "navbar" .}}
@@ -19,45 +20,36 @@

New API key

Use the form below to create a new API key.

-
+
Details
{{ .csrfField }} -
- -
- - {{if $authApp.ErrorsFor "name"}} -
- {{joinStrings ($authApp.ErrorsFor "name") ", "}} -
- {{end}} +
+ + + {{if $authApp.ErrorsFor "name"}} +
+ {{joinStrings ($authApp.ErrorsFor "name") ", "}}
+ {{end}}
-
- -
- - {{if $authApp.ErrorsFor "type"}} -
- {{joinStrings ($authApp.ErrorsFor "type") ", "}} -
- {{end}} +
+ + {{if $authApp.ErrorsFor "type"}} +
+ {{joinStrings ($authApp.ErrorsFor "type") ", "}}
+ {{end}}
-
-
- -
-
+
diff --git a/cmd/server/assets/apikeys/show.html b/cmd/server/assets/apikeys/show.html index 5a9d8e8cc..ecafefaf7 100644 --- a/cmd/server/assets/apikeys/show.html +++ b/cmd/server/assets/apikeys/show.html @@ -11,7 +11,7 @@ {{template "head" .}} - + {{template "navbar" .}}
@@ -26,7 +26,7 @@

{{$authApp.Name}} API key

{{if $apiKey}} -
+
API key
{{end}} -
+
Details
App name @@ -60,7 +60,7 @@

{{$authApp.Name}} API key

-
+
Statistics
{{if $stats}} diff --git a/cmd/server/assets/codestatus/index.html b/cmd/server/assets/codestatus/index.html index a6c981851..1d1d061d7 100644 --- a/cmd/server/assets/codestatus/index.html +++ b/cmd/server/assets/codestatus/index.html @@ -21,7 +21,7 @@

Verification code status

Use an identifier to check the status of a code previously shared with your patient.

-
+
Code status
@@ -30,7 +30,7 @@

Verification code status

+ value="{{$code.UUID}}" placeholder="UUID" autocomplete="off" required autofocus> {{if $code.ErrorsFor "uuid"}}
@@ -43,11 +43,7 @@

Verification code status

-
-
- -
-
+
diff --git a/cmd/server/assets/codestatus/show.html b/cmd/server/assets/codestatus/show.html index f9e5f2841..ce762cc19 100644 --- a/cmd/server/assets/codestatus/show.html +++ b/cmd/server/assets/codestatus/show.html @@ -18,41 +18,44 @@

Verification code status

Status of a verification code previously shared with your patient.

-
+
Code status
-
-
UUID
-

{{.code.UUID}}

-
-
-
{{.code.IssuerType}}
-

{{.code.Issuer}}

-
-
-
Test type
-

{{.code.TestType}}

-
-
-
Status
-

{{.code.Status}}

-
-
-
Expiry
- -
- {{if .code.HasLongExpires}} -
-
SMS link expiry
- -
- {{end}} -
- - - +
+
+
UUID
+

{{.code.UUID}}

+
+
+
{{.code.IssuerType}}
+

{{.code.Issuer}}

+
+
+
Test type
+

{{.code.TestType}}

+
+
+
Status
+

{{.code.Status}}

+
+
+
Expiry
+   +
+ {{if .code.HasLongExpires}} +
+
SMS link expiry
+   +
+ {{end}} + {{if .code.Expires}} + + {{end}}
@@ -65,23 +68,15 @@
SMS link expiry
diff --git a/cmd/server/assets/header.html b/cmd/server/assets/header.html index 833d8a7e8..04f57a985 100644 --- a/cmd/server/assets/header.html +++ b/cmd/server/assets/header.html @@ -34,7 +34,6 @@ cursor: pointer; text-decoration: none; } - {{end}} @@ -43,8 +42,6 @@ .floating-form { width: 100%; height: 100%; - max-width: 420px; - padding: 15px; margin: auto; } @@ -212,7 +209,7 @@ {{if gt (len .currentUser.Realms) 1}} - Change realm + Change realm {{end}} Sign out
diff --git a/cmd/server/assets/home.html b/cmd/server/assets/home.html index bbc579ad6..b57570314 100644 --- a/cmd/server/assets/home.html +++ b/cmd/server/assets/home.html @@ -48,7 +48,7 @@

Create verification code

-
+
Diagnosis
@@ -97,7 +97,7 @@

Create verification code

-
+
Dates
@@ -128,7 +128,7 @@

Create verification code

{{ if $hasSMSConfig }} -
+
Notification
@@ -156,7 +156,7 @@

Create verification code

-
+
SMS verification link @@ -169,7 +169,7 @@

Create verification code

-
+
Generated short code @@ -184,7 +184,7 @@

Create verification code

-
+
Unique identifier

diff --git a/cmd/server/assets/login/_loginscripts.html b/cmd/server/assets/login/_loginscripts.html index 9f149f172..dc2c0e40b 100644 --- a/cmd/server/assets/login/_loginscripts.html +++ b/cmd/server/assets/login/_loginscripts.html @@ -22,7 +22,7 @@ contentType: 'application/x-www-form-urlencoded', success: function(returnData) { // The user successfully signed in, redirect to realm selection. - window.location.assign('/realm'); + window.location.assign('/login/select-realm'); }, error: function(xhr, status, e) { // There was an error finding the user. Redirect to the diff --git a/cmd/server/assets/login/login.html b/cmd/server/assets/login/login.html index 0aaf9e846..bdb042b3a 100644 --- a/cmd/server/assets/login/login.html +++ b/cmd/server/assets/login/login.html @@ -35,7 +35,7 @@

diff --git a/cmd/server/assets/login/register-phone.html b/cmd/server/assets/login/register-phone.html index 5b75fc03b..dd6633c82 100644 --- a/cmd/server/assets/login/register-phone.html +++ b/cmd/server/assets/login/register-phone.html @@ -1,57 +1,59 @@ -{{define "login/register"}} +{{define "login/register-phone"}} + +{{$currentRealm := .currentRealm}} + {{template "head" .}} - + {{template "floatingform" .}} {{template "firebase" .}} - + {{template "navbar" .}}
{{template "flash" .}} -

SMS auth registration

-

Use this page to register a phone number for 2-factor authentication.

+

Configure enhanced security

+

+ Use the form below to configure advanced security settings for your + account on {{$currentRealm.Name}}. +

-
+
+
Multi-factor authentication
-
-
- -
-
- -
- - Display name for this phone number - -
-
-
- -
-
- -
- - Fully qualified phone number beginning with '+'. Standard SMS rates may apply. - -
+

+ {{$currentRealm.Name}} {{if eq .currentRealm.MFAModeString "required"}}requires{{else}}recommends{{end}} + enhanced security via SMS-based 2-factor authentication. Please + provide your information below. +

+ + +
+ + + + Fully qualified phone number beginning with '+'. Standard SMS rates may apply. +
-
-
- -
+
+ + + + Name for this phone. +
+ + {{if ne .currentRealm.MFAModeString "required"}} - + {{end}}
@@ -62,9 +64,9 @@

SMS auth registration

{{template "scripts" .}}
App