feat: improve navigation and add security scans
Security / Secrets (gitleaks) (push) Successful in 1m29s
Lint / Lint (push) Successful in 1m43s
Security / Dependencies (Trivy) (push) Successful in 1m59s
Security / Code (Semgrep) (push) Successful in 3m34s
Tests / Dashboard checks (push) Successful in 1m2s
Tests / Go backend (push) Successful in 3m13s
Docker / Docker Build & Push (push) Successful in 8m15s
Security / Secrets (gitleaks) (push) Successful in 1m29s
Lint / Lint (push) Successful in 1m43s
Security / Dependencies (Trivy) (push) Successful in 1m59s
Security / Code (Semgrep) (push) Successful in 3m34s
Tests / Dashboard checks (push) Successful in 1m2s
Tests / Go backend (push) Successful in 3m13s
Docker / Docker Build & Push (push) Successful in 8m15s
- Hide the lone navigation tab and show mobile menus as overlays - Add secret, code, and dependency scanning to CI - Update test workflows and remove an unused frontend dependency
This commit is contained in:
1 parent
85e6db67b5
commit
817236f349
23 files changed
+299
-74
No files matched your search
@@ -19,12 +19,12 @@ type authContract struct {
|
||||
Plaintext string `json:"plaintext"`
|
||||
WrongPassword string `json:"wrongPassword"`
|
||||
Hashes []struct {
|
||||
Name string `json:"name"`
|
||||
Hash string `json:"hash"`
|
||||
Password string `json:"password"`
|
||||
WrongPassword string `json:"wrongPassword"`
|
||||
Verifies map[string]bool `json:"verifies"`
|
||||
NeedsUpgrade map[string]bool `json:"needsUpgrade"`
|
||||
Name string `json:"name"`
|
||||
Hash string `json:"hash"`
|
||||
Password string `json:"password"`
|
||||
WrongPassword string `json:"wrongPassword"`
|
||||
Verifies map[string]bool `json:"verifies"`
|
||||
NeedsUpgrade map[string]bool `json:"needsUpgrade"`
|
||||
} `json:"hashes"`
|
||||
TooLongToHash struct {
|
||||
Bytes int `json:"bytes"`
|
||||
@@ -34,12 +34,12 @@ type authContract struct {
|
||||
TOTP struct {
|
||||
Secret string `json:"secret"`
|
||||
Cases []struct {
|
||||
Name string `json:"name"`
|
||||
Unix int64 `json:"unix"`
|
||||
Code string `json:"code"`
|
||||
Secret *string `json:"secret"`
|
||||
MatchedStep *int64 `json:"matchedStep"`
|
||||
Valid bool `json:"valid"`
|
||||
Name string `json:"name"`
|
||||
Unix int64 `json:"unix"`
|
||||
Code string `json:"code"`
|
||||
Secret *string `json:"secret"`
|
||||
MatchedStep *int64 `json:"matchedStep"`
|
||||
Valid bool `json:"valid"`
|
||||
} `json:"cases"`
|
||||
} `json:"totp"`
|
||||
ClientAddress struct {
|
||||
|
||||
@@ -26,7 +26,7 @@ const bcryptScheme = "bcrypt$"
|
||||
const bcryptSHA256Scheme = "bcrypt-sha256$"
|
||||
|
||||
const (
|
||||
maxPasswordBytes = 72
|
||||
maxPasswordBytes = 72
|
||||
legacyPBKDF2Iterations = 100000
|
||||
maxPBKDF2Iterations = 10000000
|
||||
)
|
||||
|
||||
@@ -291,10 +291,10 @@ type Service struct {
|
||||
// allowed email-only edits without the current password. Password changes
|
||||
// always require current credentials in UpdateMe.
|
||||
reauthenticateEmailChanges bool
|
||||
loginCacheMu sync.Mutex
|
||||
loginCacheValue bool
|
||||
loginCacheSet bool
|
||||
loginCacheExpires time.Time
|
||||
loginCacheMu sync.Mutex
|
||||
loginCacheValue bool
|
||||
loginCacheSet bool
|
||||
loginCacheExpires time.Time
|
||||
// Attempt counters for the credential endpoints; see ratelimit.go.
|
||||
loginAccountAttempts *attemptLimiter
|
||||
loginClientAttempts *attemptLimiter
|
||||
@@ -397,16 +397,16 @@ func NewWithStore(store ProxyStore, cookieName string, secureCookies bool, authG
|
||||
configurationError = errSecretNotUsable
|
||||
}
|
||||
return &Service{
|
||||
store: store,
|
||||
cookieName: cookieName,
|
||||
secureCookies: secureCookies,
|
||||
authGuard: client,
|
||||
configurationError: configurationError,
|
||||
store: store,
|
||||
cookieName: cookieName,
|
||||
secureCookies: secureCookies,
|
||||
authGuard: client,
|
||||
configurationError: configurationError,
|
||||
reauthenticateEmailChanges: options.reauthenticateEmailChanges,
|
||||
loginAccountAttempts: newAttemptLimiter(attemptWindow, loginAccountLimit),
|
||||
loginClientAttempts: newAttemptLimiter(attemptWindow, loginClientLimit),
|
||||
totpAttempts: newAttemptLimiter(attemptWindow, totpAttemptLimit),
|
||||
trustedProxies: options.trustedProxies,
|
||||
loginAccountAttempts: newAttemptLimiter(attemptWindow, loginAccountLimit),
|
||||
loginClientAttempts: newAttemptLimiter(attemptWindow, loginClientLimit),
|
||||
totpAttempts: newAttemptLimiter(attemptWindow, totpAttemptLimit),
|
||||
trustedProxies: options.trustedProxies,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -433,13 +433,13 @@ func TestUpdateMeValidatesAndForwardsToAuthGuard(t *testing.T) {
|
||||
t.Fatalf("ordinary user: status = %d, want 403", rec.Code)
|
||||
}
|
||||
for name, body := range map[string]string{
|
||||
"bad email": `{"email":"nope","username":"boss"}`,
|
||||
"at in username": `{"email":"a@b.com","username":"a@b.com"}`,
|
||||
"short password": `{"email":"a@b.com","username":"boss","password":"short"}`,
|
||||
"long password": `{"email":"a@b.com","username":"boss","password":"` + strings.Repeat("a", 73) + `"}`,
|
||||
"bad email": `{"email":"nope","username":"boss"}`,
|
||||
"at in username": `{"email":"a@b.com","username":"a@b.com"}`,
|
||||
"short password": `{"email":"a@b.com","username":"boss","password":"short"}`,
|
||||
"long password": `{"email":"a@b.com","username":"boss","password":"` + strings.Repeat("a", 73) + `"}`,
|
||||
"missing current password": `{"email":"a@b.com","username":"boss","password":"new-password"}`,
|
||||
"missing current totp": `{"email":"a@b.com","username":"boss","password":"new-password","currentPassword":"current-password"}`,
|
||||
"not JSON": `nope`,
|
||||
"missing current totp": `{"email":"a@b.com","username":"boss","password":"new-password","currentPassword":"current-password"}`,
|
||||
"not JSON": `nope`,
|
||||
} {
|
||||
if rec := update(manager, body); rec.Code != http.StatusBadRequest {
|
||||
t.Errorf("%s: status = %d, want 400", name, rec.Code)
|
||||
|
||||
@@ -16,10 +16,10 @@ import (
|
||||
|
||||
// TOTP follows RFC 6238's default interoperable profile.
|
||||
const (
|
||||
TOTPPeriod = 30 * time.Second
|
||||
TOTPDigits = 6
|
||||
TOTPSecretBytes = 20
|
||||
TOTPWindow = 1
|
||||
TOTPPeriod = 30 * time.Second
|
||||
TOTPDigits = 6
|
||||
TOTPSecretBytes = 20
|
||||
TOTPWindow = 1
|
||||
)
|
||||
|
||||
// GenerateTOTPSecret returns a base32 secret suitable for authenticator apps.
|
||||
|
||||
Reference in new issue
Block a user