Documentation ¶
Index ¶
- Constants
- type DefaultConfigOptions
- func WithCookieDomain(domain string) DefaultConfigOptions
- func WithCorsEnabled(enabled bool) DefaultConfigOptions
- func WithCorsOptions(corsOptions *cors.Options) DefaultConfigOptions
- func WithOryProjectAPIKey(apiKey string) DefaultConfigOptions
- func WithPathPrefix(prefix string) DefaultConfigOptions
- func WithRequestLogger(logger RequestLogger) DefaultConfigOptions
- func WithResponseLogger(logger ResponseLogger) DefaultConfigOptions
- type OryConfig
- type OryProxy
- type RequestLogger
- type ResponseLogger
Constants ¶
View Source
const (
OriginalHostKey middlewareContextKey = "original-host"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultConfigOptions ¶
type DefaultConfigOptions func(*oryConfigDefault)
func WithCookieDomain ¶
func WithCookieDomain(domain string) DefaultConfigOptions
Set the domain under which the proxy will set the cookie
func WithCorsEnabled ¶
func WithCorsEnabled(enabled bool) DefaultConfigOptions
Enable CORS use WithCorsOptions to configure CORS Only necessary if the request to the proxy is from a browser application running on a different origin than the proxy
func WithCorsOptions ¶
func WithCorsOptions(corsOptions *cors.Options) DefaultConfigOptions
Configure CORS
func WithOryProjectAPIKey ¶
func WithOryProjectAPIKey(apiKey string) DefaultConfigOptions
Sets the project API key that the proxy will use with social sign in requests this value can be omitted if using password or code login/registration flows.
func WithPathPrefix ¶
func WithPathPrefix(prefix string) DefaultConfigOptions
Set a custom value for the proxy path prefix this is the path you are serving the proxy under e.g. /.ory/proxy
func WithRequestLogger ¶
func WithRequestLogger(logger RequestLogger) DefaultConfigOptions
A function that is called when a request is proxied this is optional
func WithResponseLogger ¶
func WithResponseLogger(logger ResponseLogger) DefaultConfigOptions
a function that is called when a response is proxied this is optional
type OryConfig ¶
type OryConfig interface { // RequestLogger is a function that is called when a request is proxied // to the upstream URL RequestLogger(context.Context) RequestLogger // ResponseLogger is a function that is called when a response is proxied // from the upstream URL ResponseLogger(context.Context) ResponseLogger // This is the cookie domain that the proxy will set on the response // so your project domain. This can be on localhost or something like // example.com CookieDomain(context.Context) string // ProxyRoutePathPrefix is the prefix under which the proxy is served. // for example, the proxy could be under /.ory/proxy, in which case the path prefix is /.ory/proxy ProxyRoutePathPrefix(context.Context) string // OryProjectURL is the URL of the Ory Project API // This is the URL that the proxy will forward requests to // the format is usually something like https://project-slug.projects.oryapis.com OryProjectURL(context.Context) string // OryProjectAPIKey is the API key that the proxy will use to authenticate with // the Ory Project API OryProjectAPIKey(context.Context) string // CorsEnabled is a flag to enable or disable CORS CorsEnabled(context.Context) bool // CorsOptions allows to configure CORS CorsOptions(context.Context) *cors.Options // TrustXForwardedHeaders is a flag that indicates whether the proxy should trust the // X-Forwarded-* headers or not. TrustXForwardedHeaders(context.Context) bool }
func NewDefaultConfig ¶
func NewDefaultConfig(oryProjectURL string, opts ...DefaultConfigOptions) OryConfig
type OryProxy ¶
type OryProxy struct {
// contains filtered or unexported fields
}
func NewOryProxy ¶
func (*OryProxy) ListenAndServe ¶
type RequestLogger ¶
type RequestLogger func(ctx context.Context, req *httputil.ProxyRequest, body []byte)
Click to show internal directories.
Click to hide internal directories.