security

package
v0.0.0-...-4ae6852 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ByKey = APIKeySecurity(auth.KeySecurityScheme, func() {
	Description("key based auth.")
	Scope("consumer", "consumer based tool access")
	Scope("producer", "producer based tool access")
})
View Source
var ByKeyHeader = func() {
	Header(fmt.Sprintf("apikey_token:%s", auth.APIKeyHeader), String, "API Key header")
}
View Source
var ByKeyNamedHeader = func(name string) {
	Header(fmt.Sprintf("apikey_token:%s", name), String, "API Key header")
}
View Source
var ByKeyPayload = func() {
	APIKey(auth.KeySecurityScheme, "apikey_token", String)
}
View Source
var DeleteSessionCookie = func() {
	Cookie(fmt.Sprintf("session_cookie:%s", auth.SessionCookie), String, func() {
	})

	CookieMaxAge(-1)
	CookieSecure()
	CookieHTTPOnly()
}
View Source
var ProjectHeader = func() {
	Header(fmt.Sprintf("project_slug_input:%s", auth.ProjectHeader), String, "project header")
}
View Source
var ProjectParam = func(name string) {
	Param(name)
}
View Source
var ProjectPayload = func() {
	APIKey(auth.ProjectSlugSecuritySchema, "project_slug_input", String)
}
View Source
var ProjectPayloadNamed = func(name string) {
	APIKey(auth.ProjectSlugSecuritySchema, name, String)
}
View Source
var ProjectSlug = APIKeySecurity(auth.ProjectSlugSecuritySchema, func() {
	Description("project slug header auth.")
})
View Source
var Session = APIKeySecurity(auth.SessionSecurityScheme, func() {
	Description("Session based auth. By cookie or header.")
})

Session defines the security scheme for session-based authentication

View Source
var SessionHeader = func() {
	Header(fmt.Sprintf("session_token:%s", auth.SessionHeader), String, "Session header")
}
View Source
var SessionPayload = func() {
	APIKey(auth.SessionSecurityScheme, "session_token", String)
}
View Source
var WriteSessionCookie = func() {
	Cookie(fmt.Sprintf("session_cookie:%s", auth.SessionCookie), String, func() {
	})

	CookieMaxAge(2592000)
	CookieSecure()
	CookieHTTPOnly()
	CookiePath("/")
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL