mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-11 16:24:11 +01:00
Pkg: Apply "golangci-lint" recommendations to authn & dsn packages #5330
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -81,7 +81,7 @@ var (
|
||||
ErrInvalidPassword = errors.New("invalid password")
|
||||
ErrPasswordRequired = errors.New("password required")
|
||||
ErrPasswordTooShort = errors.New("password is too short")
|
||||
ErrPasswordTooLong = errors.New(fmt.Sprintf("password must have less than %d characters", txt.ClipPassword))
|
||||
ErrPasswordTooLong = fmt.Errorf("password must have less than %d characters", txt.ClipPassword)
|
||||
ErrPasswordsDoNotMatch = errors.New("passwords do not match")
|
||||
)
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ const (
|
||||
GrantShareToken GrantType = "share_token"
|
||||
GrantRefreshToken GrantType = "refresh_token"
|
||||
GrantAuthorizationCode GrantType = "authorization_code"
|
||||
GrantJwtBearer GrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer"
|
||||
GrantSamlBearer GrantType = "urn:ietf:params:oauth:grant-type:saml2-bearer"
|
||||
GrantTokenExchange GrantType = "urn:ietf:params:oauth:grant-type:token-exchange"
|
||||
GrantJwtBearer GrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer" // #nosec G101 grant type identifier, not a secret
|
||||
GrantSamlBearer GrantType = "urn:ietf:params:oauth:grant-type:saml2-bearer" // #nosec G101 grant type identifier, not a secret
|
||||
GrantTokenExchange GrantType = "urn:ietf:params:oauth:grant-type:token-exchange" // #nosec G101 grant type identifier, not a secret
|
||||
)
|
||||
|
||||
// Grant casts a string to a normalized grant type.
|
||||
|
||||
@@ -6,6 +6,7 @@ import "github.com/photoprism/photoprism/pkg/clean"
|
||||
type IssuerUri = string
|
||||
|
||||
const (
|
||||
// IssuerDefault represents the empty issuer URI.
|
||||
IssuerDefault IssuerUri = ""
|
||||
)
|
||||
|
||||
|
||||
@@ -10,9 +10,13 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
ErrEmpty = errors.New("empty")
|
||||
ErrTooLong = errors.New("too long")
|
||||
ErrInvalid = errors.New("invalid")
|
||||
// ErrEmpty indicates the username was not provided.
|
||||
ErrEmpty = errors.New("empty")
|
||||
// ErrTooLong indicates the username exceeds the allowed length.
|
||||
ErrTooLong = errors.New("too long")
|
||||
// ErrInvalid indicates the username failed basic validation.
|
||||
ErrInvalid = errors.New("invalid")
|
||||
// ErrReserved indicates the username is reserved for system use.
|
||||
ErrReserved = errors.New("reserved")
|
||||
)
|
||||
|
||||
|
||||
@@ -117,8 +117,7 @@ func (d *DSN) Host() string {
|
||||
|
||||
// Port the database server port.
|
||||
func (d *DSN) Port() int {
|
||||
switch d.Driver {
|
||||
case DriverSQLite3:
|
||||
if d.Driver == DriverSQLite3 {
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user