mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +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")
|
ErrInvalidPassword = errors.New("invalid password")
|
||||||
ErrPasswordRequired = errors.New("password required")
|
ErrPasswordRequired = errors.New("password required")
|
||||||
ErrPasswordTooShort = errors.New("password is too short")
|
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")
|
ErrPasswordsDoNotMatch = errors.New("passwords do not match")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ const (
|
|||||||
GrantShareToken GrantType = "share_token"
|
GrantShareToken GrantType = "share_token"
|
||||||
GrantRefreshToken GrantType = "refresh_token"
|
GrantRefreshToken GrantType = "refresh_token"
|
||||||
GrantAuthorizationCode GrantType = "authorization_code"
|
GrantAuthorizationCode GrantType = "authorization_code"
|
||||||
GrantJwtBearer GrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer"
|
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"
|
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"
|
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.
|
// Grant casts a string to a normalized grant type.
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import "github.com/photoprism/photoprism/pkg/clean"
|
|||||||
type IssuerUri = string
|
type IssuerUri = string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
// IssuerDefault represents the empty issuer URI.
|
||||||
IssuerDefault IssuerUri = ""
|
IssuerDefault IssuerUri = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
// ErrEmpty indicates the username was not provided.
|
||||||
ErrEmpty = errors.New("empty")
|
ErrEmpty = errors.New("empty")
|
||||||
|
// ErrTooLong indicates the username exceeds the allowed length.
|
||||||
ErrTooLong = errors.New("too long")
|
ErrTooLong = errors.New("too long")
|
||||||
|
// ErrInvalid indicates the username failed basic validation.
|
||||||
ErrInvalid = errors.New("invalid")
|
ErrInvalid = errors.New("invalid")
|
||||||
|
// ErrReserved indicates the username is reserved for system use.
|
||||||
ErrReserved = errors.New("reserved")
|
ErrReserved = errors.New("reserved")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -117,8 +117,7 @@ func (d *DSN) Host() string {
|
|||||||
|
|
||||||
// Port the database server port.
|
// Port the database server port.
|
||||||
func (d *DSN) Port() int {
|
func (d *DSN) Port() int {
|
||||||
switch d.Driver {
|
if d.Driver == DriverSQLite3 {
|
||||||
case DriverSQLite3:
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user