Documentation ¶
Index ¶
- Constants
- func AllowLocalhost() bool
- func CategoryInfo(resp http.ResponseWriter, req *http.Request)
- func FolderInfo(resp http.ResponseWriter, req *http.Request)
- func FolderVisibilityToken(resp http.ResponseWriter, req *http.Request)
- func GetDomain() string
- func GetSessionFromRequest(ctx context.Context, req *http.Request) (*docs.Session, error)
- func IsAdminSession(ctx context.Context, req *http.Request) bool
- func KeywordInfo(resp http.ResponseWriter, req *http.Request)
- func LocationInfo(resp http.ResponseWriter, req *http.Request)
- func NotifyDeletePhotoTask(resp http.ResponseWriter, req *http.Request)
- func NotifyFinalizePhotoTask(resp http.ResponseWriter, req *http.Request)
- func NotifyMasterStorageUpdates(resp http.ResponseWriter, req *http.Request)
- func PhotoGetMetadata(resp http.ResponseWriter, req *http.Request)
- func PhotoList(resp http.ResponseWriter, req *http.Request)
- func PhotoResize(resp http.ResponseWriter, req *http.Request)
- func SetAuth(auth Auth)
- func SetTasks(tasks Tasks)
- func UserAdd(resp http.ResponseWriter, req *http.Request)
- func UserLogin(resp http.ResponseWriter, req *http.Request)
- func UserLogout(resp http.ResponseWriter, req *http.Request)
- func UserSessionRefresh(resp http.ResponseWriter, req *http.Request)
- func VisibilityActivateLink(resp http.ResponseWriter, req *http.Request)
- func VisibilityCreate(resp http.ResponseWriter, req *http.Request)
- func VisibilityCreateLink(resp http.ResponseWriter, req *http.Request)
- func VisibilityList(resp http.ResponseWriter, req *http.Request)
- func VisibilityUpdateLink(resp http.ResponseWriter, req *http.Request)
- type Auth
- type Tasks
Constants ¶
const CookieSessionID = "sid"
CookieSessionID is the session id cookie
const CookieVisTokenValues = "vtv"
CookieVisTokenValues is the visibility token values cookie
Variables ¶
This section is empty.
Functions ¶
func AllowLocalhost ¶ added in v0.10.0
func AllowLocalhost() bool
AllowLocalhost returns the flag controlling if localhost is a valid origin
func CategoryInfo ¶
func CategoryInfo(resp http.ResponseWriter, req *http.Request)
CategoryInfo returns info about the given category or category-value slug
func FolderInfo ¶
func FolderInfo(resp http.ResponseWriter, req *http.Request)
FolderInfo returns info about the given folder path and optionally its subfolders
func FolderVisibilityToken ¶ added in v0.11.0
func FolderVisibilityToken(resp http.ResponseWriter, req *http.Request)
FolderVisibilityToken can add or delete a visibility token on a folder. Admin only.
func GetDomain ¶ added in v0.10.0
func GetDomain() string
GetDomain returns the DOMAIN env var or a default
func GetSessionFromRequest ¶
GetSessionFromRequest tries to get the active session associated with a request. Uses the session cookie.
func IsAdminSession ¶
IsAdminSession checks if the session associated with the request belongs to an admin user. If there is no session, fallbacks to indicating a non-admin session.
func KeywordInfo ¶
func KeywordInfo(resp http.ResponseWriter, req *http.Request)
KeywordInfo returns info about the given keyword slug
func LocationInfo ¶
func LocationInfo(resp http.ResponseWriter, req *http.Request)
LocationInfo returns info about the given location slug
func NotifyDeletePhotoTask ¶
func NotifyDeletePhotoTask(resp http.ResponseWriter, req *http.Request)
NotifyDeletePhotoTask is the handler for deleting photo tasks
func NotifyFinalizePhotoTask ¶
func NotifyFinalizePhotoTask(resp http.ResponseWriter, req *http.Request)
NotifyFinalizePhotoTask is the handler for finalizing photo tasks
func NotifyMasterStorageUpdates ¶
func NotifyMasterStorageUpdates(resp http.ResponseWriter, req *http.Request)
NotifyMasterStorageUpdates handles storage notifications from the photo master bucket
func PhotoGetMetadata ¶
func PhotoGetMetadata(resp http.ResponseWriter, req *http.Request)
PhotoGetMetadata returns metadata for a photo
func PhotoList ¶
func PhotoList(resp http.ResponseWriter, req *http.Request)
PhotoList responds with a listing of photos for the given parameters
func PhotoResize ¶
func PhotoResize(resp http.ResponseWriter, req *http.Request)
PhotoResize returns a resized version of a photo
func UserLogin ¶
func UserLogin(resp http.ResponseWriter, req *http.Request)
UserLogin attempts to login a user
func UserLogout ¶
func UserLogout(resp http.ResponseWriter, req *http.Request)
UserLogout ends the active session
func UserSessionRefresh ¶
func UserSessionRefresh(resp http.ResponseWriter, req *http.Request)
UserSessionRefresh refreshes the active session
func VisibilityActivateLink ¶ added in v0.11.0
func VisibilityActivateLink(resp http.ResponseWriter, req *http.Request)
VisibilityActivateLink activates a visibility token link.
func VisibilityCreate ¶ added in v0.11.0
func VisibilityCreate(resp http.ResponseWriter, req *http.Request)
VisibilityCreate creates a new visibility token. Admin only.
func VisibilityCreateLink ¶ added in v0.11.0
func VisibilityCreateLink(resp http.ResponseWriter, req *http.Request)
VisibilityCreateLink creates a new link on a visibility token. Admin only.
func VisibilityList ¶ added in v0.11.0
func VisibilityList(resp http.ResponseWriter, req *http.Request)
VisibilityList returns a list of all visibility tokens. Admin only.
func VisibilityUpdateLink ¶ added in v0.11.0
func VisibilityUpdateLink(resp http.ResponseWriter, req *http.Request)
VisibilityUpdateLink updates an existing visibility token link. Admin only.
Types ¶
type Auth ¶
type Auth interface {
CheckServiceAccountAuthorization(ctx context.Context, req *http.Request) bool
}
Auth interface for authorization checks. This interface is here to allow for testing to substitute something different.