blob: 63275cc1659a86f9abcd20e7098eb223b23a64fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package internal
import (
"net/http"
)
// Artifact allows to handle artifact related requests
type Artifact interface {
TryMakeRequest(host string, w http.ResponseWriter, r *http.Request, token string, responseHandler func(*http.Response) bool) bool
}
// Auth handles the authentication logic
type Auth interface {
AuthorizationMiddleware(handler http.Handler) http.Handler
IsAuthSupported() bool
RequireAuth(w http.ResponseWriter, r *http.Request) bool
GetTokenIfExists(w http.ResponseWriter, r *http.Request) (string, error)
CheckResponseForInvalidToken(w http.ResponseWriter, r *http.Request, resp *http.Response) bool
CheckAuthenticationWithoutProject(w http.ResponseWriter, r *http.Request, domain domain) bool
}
|