Extract constant names out for the ReverseProxy and Basic authentication methods (#17735)
In order to reduce load on the GC extract out the constant names of the Basic and ReverseProxy methods. As mentioned in https://github.com/go-gitea/gitea/pull/15119#discussion_r730352176 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
931d0cf854
commit
f8ec43dbc7
5 changed files with 11 additions and 5 deletions
|
@ -23,6 +23,9 @@ var (
|
|||
_ Named = &Basic{}
|
||||
)
|
||||
|
||||
// BasicMethodName is the constant name of the basic authentication method
|
||||
const BasicMethodName = "basic"
|
||||
|
||||
// Basic implements the Auth interface and authenticates requests (API requests
|
||||
// only) by looking for Basic authentication data or "x-oauth-basic" token in the "Authorization"
|
||||
// header.
|
||||
|
@ -31,7 +34,7 @@ type Basic struct {
|
|||
|
||||
// Name represents the name of auth method
|
||||
func (b *Basic) Name() string {
|
||||
return "basic"
|
||||
return BasicMethodName
|
||||
}
|
||||
|
||||
// Verify extracts and validates Basic data (username and password/token) from the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue