blob: 3e82ee3af1629ed907e69d8865f3ba9bdc38f7f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
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 {
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
}
|