2022-01-11 13:20:02 +00:00
|
|
|
// Copyright (C) 2022 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package api
|
|
|
|
|
2022-02-17 13:48:39 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"net/http"
|
|
|
|
)
|
2022-01-11 13:20:02 +00:00
|
|
|
|
|
|
|
// Auth exposes methods to control authentication process for each endpoint.
|
|
|
|
type Auth interface {
|
2022-02-11 15:06:52 +00:00
|
|
|
// IsAuthenticated checks if request is performed with all needed authorization credentials.
|
2022-03-27 11:16:46 +01:00
|
|
|
IsAuthenticated(ctx context.Context, r *http.Request, isCookieAuth, isKeyAuth bool) (context.Context, error)
|
2022-06-05 23:41:38 +01:00
|
|
|
// RemoveAuthCookie indicates to the client that the authentication cookie should be removed.
|
|
|
|
RemoveAuthCookie(w http.ResponseWriter)
|
2022-01-11 13:20:02 +00:00
|
|
|
}
|