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

Add WebAuthn support to GUI #9175

Open
wants to merge 87 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
1b5dd84
Fix indentation
emlun Oct 8, 2023
8a51efe
Allow unsetting password
emlun Oct 8, 2023
7f17953
Add WebAuthn authentication
emlun Oct 8, 2023
40274e7
Add option to require UV per credential
emlun Aug 26, 2023
d965882
Move config.Wrapper.Finish() back to api.configMuxBuilder.finish()
emlun Oct 14, 2023
eb2d616
Use WebAuthn credential ID when Nickname is not set
emlun Oct 14, 2023
6c66916
Track creation and last use time of WebAuthn credentials
emlun Oct 14, 2023
47ba3fd
Remove unnecessary argument
emlun Oct 14, 2023
86fd758
Extract function webauthnReady
emlun Oct 14, 2023
1ac6ce9
Move methods {start,finish}WebauthnRegistration to api.webauthnService
emlun Oct 15, 2023
a0b8407
Support explicit translation ID in translation extraction
emlun Oct 15, 2023
5eeae91
Save new WebAuthn credentials when config is saved, not immediately
emlun Oct 15, 2023
39699c3
Extract file api_auth_webauthn.go
emlun Oct 15, 2023
648554e
Merge file config/webauthn.go into api/api_auth_webauthn.go
emlun Oct 15, 2023
de3f323
Keep WebAuthn engine as webauthnService field
emlun Oct 15, 2023
c6757e7
Rearrange webauthnService fields to have changing state later
emlun Oct 15, 2023
9e7a8d3
Move WebAuthn methods from GUIConfiguration to webauthnService
emlun Oct 15, 2023
abbeaa2
Set random WebAuthn user handle on startup if not set
emlun Oct 15, 2023
f4a0d6f
Use updatedCred.Flags.UserVerified shortcut
emlun Oct 15, 2023
530cb4a
Enforce user verification for credentials with RequireUV set
emlun Oct 15, 2023
42fc63b
Don't show no-auth when WebAuthn credentials are enrolled
emlun Oct 15, 2023
a643041
Fix translation interpolation in button to reload WebAuthn address
emlun Oct 15, 2023
cbf2fd1
Fix columns in WebAuthn credentials table
emlun Oct 15, 2023
1c131a3
Use namespaced translation key for Actions heading of WebAuthn creden…
emlun Oct 24, 2023
1c5e4ba
Use English as fallback language for missing translation keys
emlun Oct 24, 2023
384a514
Remove isNamespacedTranslationId heuristic
emlun Nov 5, 2023
832849d
Revert to using translated text as translation ID
emlun Nov 5, 2023
909fdb9
Remove WebAuthn RP ID and origin settings from GUI
emlun Nov 5, 2023
782ba88
Omit WebAuthn Credentials from advanced settings
emlun Nov 5, 2023
3d04e78
Fix exclusion of skip elements in GUI advanced settings
emlun Nov 5, 2023
99690e7
Set explicit defaults for WebAuthn RP ID and origin
emlun Nov 5, 2023
22b5b2e
Merge branch 'main' into webauthn
emlun Nov 19, 2023
2dc0046
Use namespaced translation IDs for some ambiguous strings
emlun Nov 19, 2023
bfda3e3
Reduce margins between Actions buttons in WebAuthn Credentials table
emlun Nov 19, 2023
400ef34
Use <button> instead of <a> for WebAuthn Credential actions
emlun Nov 19, 2023
8c3564a
Disable instead of hide Rename button while renaming
emlun Nov 19, 2023
2d16cfa
Record RP ID when creating WebAuthn credential
emlun Nov 19, 2023
6cd22b5
Split WebAuthn credentials by matching RP ID or not
emlun Nov 19, 2023
9135b7d
Always show ineligible credentials, if any
emlun Nov 19, 2023
4da0eba
Merge branch 'main' into webauthn
emlun Nov 22, 2023
f3d8182
Ignore ineligible WebAuthn credentials in GUIConfiguration.WebauthnRe…
emlun Nov 22, 2023
353d1cf
Remove redundant comment
emlun Nov 22, 2023
cb1ca3c
Extract session store
emlun Jan 7, 2024
4da8a10
Collect sessionStore methods near struct definition
emlun Jan 7, 2024
6c8e0af
Merge branch 'session-store' into webauthn
emlun Feb 18, 2024
a61d08a
Merge branch 'main' into webauthn
emlun Feb 18, 2024
fab687c
Add cookies parameter to httpPost
emlun Feb 18, 2024
c63b9a8
Test that logout removes the session cookie
emlun Feb 18, 2024
e9c95a1
Test that session cookie is rejected after logout
emlun Feb 18, 2024
85e4b3c
gofmt -w -s lib/
emlun Feb 18, 2024
0871890
Move sessionStore to tokenmanager.go
emlun Mar 10, 2024
442f78f
Harmonize signatures of sessionStore methods
emlun Mar 10, 2024
65f2612
Merge remote-tracking branch 'upstream/main' into session-store
emlun Mar 10, 2024
785b876
Rename sessionStore to tokenCookieManager
emlun Mar 10, 2024
b2b9428
gofmt -w -s lib/
emlun Mar 10, 2024
db6a0f6
Merge branch 'session-store' into webauthn
emlun Mar 10, 2024
b671a9a
Merge branch 'main' into webauthn
emlun Mar 31, 2024
01b8d76
Fall back to default WebauthnRpId and WebauthnOrigin in newWebauthnEn…
emlun Mar 31, 2024
ae15072
Fix TestConfigChanges
emlun Mar 31, 2024
551918d
Deep-copy WebauthnCredential
emlun Mar 31, 2024
ac8a48c
Use field RPOrigins instead of deprecated RPOrigin
emlun Mar 31, 2024
774f1f9
Merge remote-tracking branch 'upstream/main' into webauthn
emlun Apr 6, 2024
2fe6f04
Add tests of WebAuthn registration
emlun Apr 6, 2024
bcd8b7a
Fix test of RP ID in newly registered credential
emlun Apr 6, 2024
2ae7bf2
Fix tests of rejecting duplicate WebAuthn credentials
emlun Apr 6, 2024
b41da4e
Add tests of updating WebAuthn config
emlun Apr 6, 2024
e6505e7
Apply WebAuthn config update logic in both adjustConfig and adjustGUI
emlun Apr 6, 2024
fc778e8
Use testing.T.Cleanup() instead of defer
emlun Apr 7, 2024
3110830
Add tests of updating advanced WebAuthn config
emlun Apr 7, 2024
9201aee
Fix DeepSource lint
emlun Apr 7, 2024
7775b04
Extract test helpers
emlun Apr 7, 2024
57fea60
fixup! Extract test helpers
emlun Apr 7, 2024
984ca37
Remove commented-out code
emlun Apr 7, 2024
9ce6562
Add tests of WebAuthn authentication
emlun Apr 7, 2024
a6f0d41
Fix RP ID comparison in EligibleWebAuthnCredentials()
emlun Apr 7, 2024
1057fd6
Fix nil dereference in finishWebauthnAuthentication
emlun Apr 7, 2024
3251370
Fix DeepSource lint
emlun Apr 7, 2024
9c00ab7
Remove commented-out code
emlun Apr 7, 2024
1ef0656
Mark HTTP help functions with t.Helper()
emlun Apr 14, 2024
8851819
Merge branch 'main' into webauthn
emlun Apr 14, 2024
689f3c5
fixup! Mark HTTP help functions with t.Helper()
emlun Apr 14, 2024
796e90a
Don't use slices.Concat yet
emlun Apr 14, 2024
462238a
Change test value
emlun Apr 14, 2024
0e2c0b2
Fix name of testutil.AssertLessThan
emlun Apr 14, 2024
b5c4142
Fix failure message in testutil.AssertPredicate
emlun Apr 14, 2024
78a72a1
Include t.Name() in testutil.FatailIfErr message
emlun Apr 14, 2024
2c747b4
Use testutil.FatalIfErr instead of panic
emlun Apr 14, 2024
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
25 changes: 18 additions & 7 deletions go.mod
Expand Up @@ -8,19 +8,25 @@ require (
github.com/calmh/incontainer v1.0.0
github.com/calmh/xdr v1.1.0
github.com/ccding/go-stun v0.1.4
github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chmduquesne/rollinghash v4.0.0+incompatible
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/d4l3k/messagediff v1.2.1
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568
github.com/getsentry/raven-go v0.2.0
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
github.com/go-ldap/ldap/v3 v3.4.6
github.com/gobwas/glob v0.2.3
github.com/gogo/protobuf v1.3.2
github.com/golang/snappy v0.0.4 // indirect
github.com/greatroar/blobloom v0.7.2
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/jackpal/gateway v1.0.14
github.com/jackpal/go-nat-pmp v1.0.2
github.com/julienschmidt/httprouter v1.3.0
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/lib/pq v1.10.9
github.com/maruel/panicparse/v2 v2.3.1
github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1
Expand Down Expand Up @@ -48,30 +54,34 @@ require (
google.golang.org/protobuf v1.33.0
)

require (
github.com/go-webauthn/webauthn v0.8.6
github.com/google/go-cmp v0.6.0
)

require (
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/go-webauthn/x v0.1.4 // indirect
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
github.com/google/go-tpm v0.9.0 // indirect
github.com/google/pprof v0.0.0-20240402174815-29b9bb013b0f // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nxadm/tail v1.4.11 // indirect
github.com/onsi/ginkgo/v2 v2.17.1 // indirect
github.com/onsi/gomega v1.31.1 // indirect
github.com/oschwald/maxminddb-golang v1.12.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/errors v0.8.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
Expand All @@ -82,6 +92,7 @@ require (
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.uber.org/mock v0.4.0 // indirect
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect
Expand Down
21 changes: 17 additions & 4 deletions go.sum
Expand Up @@ -48,6 +48,8 @@ github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmV
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/fxamacker/cbor/v2 v2.4.0 h1:ri0ArlOR+5XunOP8CRUowT0pSJOwhW098ZCUyskZD88=
github.com/fxamacker/cbor/v2 v2.4.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo=
github.com/getsentry/raven-go v0.2.0 h1:no+xWJRb5ZI7eE8TWgIq1jLulQiIoLG0IfYxv5JYMGs=
github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
github.com/go-asn1-ber/asn1-ber v1.5.5 h1:MNHlNMBDgEKD4TcKr36vQN68BA00aDfjIt3/bD50WnA=
Expand All @@ -62,8 +64,14 @@ github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/go-webauthn/webauthn v0.8.6 h1:bKMtL1qzd2WTFkf1mFTVbreYrwn7dsYmEPjTq6QN90E=
github.com/go-webauthn/webauthn v0.8.6/go.mod h1:emwVLMCI5yx9evTTvr0r+aOZCdWJqMfbRhF0MufyUog=
github.com/go-webauthn/x v0.1.4 h1:sGmIFhcY70l6k7JIDfnjVBiAAFEssga5lXIUXe0GtAs=
github.com/go-webauthn/x v0.1.4/go.mod h1:75Ug0oK6KYpANh5hDOanfDI+dvPWHk788naJVG/37H8=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE=
github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
Expand All @@ -86,6 +94,8 @@ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-tpm v0.9.0 h1:sQF6YqWMi+SCXpsmS3fd21oPy/vSddwZry4JnmltHVk=
github.com/google/go-tpm v0.9.0/go.mod h1:FkNVkc6C+IsvDI9Jw1OveJmxGZUUaKxtrpOS47QWKfU=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20240402174815-29b9bb013b0f h1:f00RU+zOX+B3rLAmMMkzHUF2h1z4DeYR9tTCvEq2REY=
github.com/google/pprof v0.0.0-20240402174815-29b9bb013b0f/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
Expand Down Expand Up @@ -116,8 +126,8 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand All @@ -136,6 +146,8 @@ github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dz
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
github.com/miscreant/miscreant.go v0.0.0-20200214223636-26d376326b75 h1:cUVxyR+UfmdEAZGJ8IiKld1O0dbGotEnkMolG5hfMSY=
github.com/miscreant/miscreant.go v0.0.0-20200214223636-26d376326b75/go.mod h1:pBbZyGwC5i16IBkjVKoy/sznA8jPD/K9iedwe1ESE6w=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
Expand All @@ -160,9 +172,8 @@ github.com/oschwald/maxminddb-golang v1.12.0 h1:9FnTOD0YOhP7DGxGsq4glzpGy5+w7pq5
github.com/oschwald/maxminddb-golang v1.12.0/go.mod h1:q0Nob5lTCqyQ8WT6FYgS1L7PXKVVbgiymefNwIjPzgY=
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo=
Expand Down Expand Up @@ -225,6 +236,8 @@ github.com/vitrun/qart v0.0.0-20160531060029-bf64b92db6b0 h1:okhMind4q9H1OxF44gN
github.com/vitrun/qart v0.0.0-20160531060029-bf64b92db6b0/go.mod h1:TTbGUfE+cXXceWtbTHq6lqcTvYPBKLNejBEbnUsQJtU=
github.com/willabides/kongplete v0.4.0 h1:eivXxkp5ud5+4+NVN9e4goxC5mSh3n1RHov+gsblM2g=
github.com/willabides/kongplete v0.4.0/go.mod h1:0P0jtWD9aTsqPSUAl4de35DLghrr57XcayPyvqSi2X8=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Expand Down
12 changes: 12 additions & 0 deletions gui/default/assets/css/overrides.css
Expand Up @@ -102,10 +102,18 @@ ul+h5 {
/*padding-left: 20px !important;*/
}

.table td.button-cell {
padding: 0;
}

.table td.small-data {
white-space: nowrap;
}

.table td.stretch {
width: 100%;
}

/* Removing text decoration on anchor link hover pull request: #4135 */
.table td.small-data span a:hover {
text-decoration: none;
Expand Down Expand Up @@ -560,3 +568,7 @@ html[lang|="ko"] i {
-webkit-user-select: all;
user-select: all;
}

.webauthn-credentials table.table > tbody > tr > td {
vertical-align: middle;
}
69 changes: 66 additions & 3 deletions gui/default/index.html
Expand Up @@ -155,9 +155,9 @@ <h3 class="panel-title">
</div>
<div class="panel-body">
<p>
<span translate>The Syncthing admin interface is configured to allow remote access without a password.</span>
<span translate>The Syncthing admin interface is configured to allow remote access without authentication.</span>
<b><span translate>This can easily give hackers access to read and change any files on your computer.</span></b>
<span translate>Please set a GUI Authentication User and Password in the Settings dialog.</span>
<span translate>Please set a GUI Authentication User and Password in the Settings dialog, or enroll a WebAuthn credential.</span>
</p>
</div>
<div class="panel-footer">
Expand Down Expand Up @@ -348,7 +348,7 @@ <h3 class="panel-title">
<div ng-if="!authenticated" class="center-block">
<h3 translate>Authentication Required</h3>

<form ng-submit="authenticatePassword()">
<form ng-submit="authenticatePassword()" class="col-md-6">
<div class="form-group">
<label for="user" translate>User</label>
<input id="user" class="form-control" type="text" name="user" ng-model="login.username" autofocus required autocomplete="username" />
Expand Down Expand Up @@ -379,6 +379,68 @@ <h3 translate>Authentication Required</h3>
</div>
</div>
</form>

<div class="col-md-6" style="text-align: center">
<p translate>
Or...
</p>
<div class="form-group">
<label>
<input type="checkbox" ng-model="login.stayLoggedIn" >&nbsp;<span translate>Stay logged in</span>
</label>
</div>
<button
type="button"
class="btn btn-primary"
style="margin-bottom: 0.5em;"
ng-click="authenticateWebauthnFinish()"
ng-disabled="login.inProgress || webauthn.errors.noCredentials || webauthn.errors.initFailed || locationDoesNotMatchWebauthnRpId() || isLocationInsecure()"
tabindex="3">
<span translate>Log in with WebAuthn</span>
</button>

<p class="text-info" ng-if="!webauthnAvailable()" translate>
Your browser does not support WebAuthn.
</p>
<p class="text-info" ng-if="locationDoesNotMatchWebauthnRpId()" translate>
Current location does not match WebAuthn configuration.
</p>
<p class="text-info" ng-if="isLocationInsecure()" translate>
WebAuthn requires HTTPS.
</p>
<p class="text-danger" ng-if="webauthn.errors.notRegistered" translate>
This device or security key is not registered. Please try a different one.
</p>
<p class="text-info" ng-if="webauthn.errors.aborted" translate>
Authentication aborted by user.
</p>
<p class="text-danger" ng-if="webauthn.errors.notAllowed" translate>
Authentication failed, please try again.
</p>
<p class="text-danger" ng-if="webauthn.errors.initFailed" translate>
Initialization failed, see Syncthing logs for details.
</p>
<p class="text-danger" ng-if="webauthn.errors.authenticationFailed" translate>
Authentication failed, see Syncthing logs for details.
</p>
<p class="text-info" ng-if="webauthn.errors.noCredentials" translate>
User has not configured any WebAuthn credentials.
</p>
<p class="text-danger" ng-if="webauthn.errors.uvRequired" translate>
User verification is required, but was not performed.
</p>

<button
ng-if="inferWebauthnAddress() && (isLocationInsecure() || locationDoesNotMatchWebauthnRpId())"
type="button"
class="btn btn-primary"
ng-click="reloadLoginAtWebauthnAddress()"
translate
translate-value-webauthn-address="{{ inferWebauthnAddress() }}"
>
Reload page at {%webauthnAddress%}
</button>
</div>
</div>

<!-- First regular row -->
Expand Down Expand Up @@ -1051,6 +1113,7 @@ <h4 class="panel-title">
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="vendor/daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="vendor/fancytree/jquery.fancytree-all-deps.js"></script>
<script type="text/javascript" src="vendor/webauthn-json-1.0.3/webauthn-json.browser-global.js"></script>
<!-- / vendor scripts -->

<!-- gui application code -->
Expand Down