Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Handshake = hplugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "SYFON_AUTHZ_PLUGIN",
MagicCookieValue: "syfon_authz_plugin_v1",
}
Plugin handshake config for go-plugin
Functions ¶
This section is empty.
Types ¶
type AuthenticationPluginManager ¶ added in v0.2.4
type AuthenticationPluginManager struct {
// contains filtered or unexported fields
}
AuthenticationPluginManager manages the plugin process and calls Authenticate.
func NewAuthenticationPluginManager ¶ added in v0.2.4
func NewAuthenticationPluginManager(pluginPath string) (*AuthenticationPluginManager, error)
NewAuthenticationPluginManager loads the plugin binary and returns a manager.
func (*AuthenticationPluginManager) Authenticate ¶ added in v0.2.4
func (pm *AuthenticationPluginManager) Authenticate(ctx context.Context, in *plugin.AuthenticationInput) (*plugin.AuthenticationOutput, error)
Authenticate delegates to the plugin.
type AuthnPluginRPC ¶ added in v0.2.4
AuthnPluginRPC is the hplugin.Plugin implementation for go-plugin.
type AuthnRPC ¶ added in v0.2.4
type AuthnRPC struct {
// contains filtered or unexported fields
}
AuthnRPC implements AuthenticationPlugin over RPC.
func (*AuthnRPC) Authenticate ¶ added in v0.2.4
func (a *AuthnRPC) Authenticate(ctx context.Context, in *plugin.AuthenticationInput) (*plugin.AuthenticationOutput, error)
type AuthzMiddleware ¶
type AuthzMiddleware struct {
// contains filtered or unexported fields
}
func NewAuthzMiddleware ¶
func NewAuthzMiddleware(logger *slog.Logger, mode, basicUser, basicPass string) *AuthzMiddleware
func (*AuthzMiddleware) FiberMiddleware ¶ added in v0.2.0
func (m *AuthzMiddleware) FiberMiddleware() fiber.Handler
FiberMiddleware returns a fiber middleware that extracts the token and fetches user info.
type AuthzPluginRPC ¶ added in v0.2.4
AuthzPluginRPC is the hplugin.Plugin implementation for go-plugin.
type AuthzRPC ¶ added in v0.2.4
type AuthzRPC struct {
// contains filtered or unexported fields
}
AuthzRPC implements AuthorizationPlugin over RPC.
func (*AuthzRPC) Authorize ¶ added in v0.2.4
func (a *AuthzRPC) Authorize(ctx context.Context, in *plugin.AuthorizationInput) (*plugin.AuthorizationOutput, error)
type DummyPluginManager ¶ added in v0.2.4
type DummyPluginManager struct{}
DummyPluginManager implements the same interface as PluginManager for testing.
func (*DummyPluginManager) Authorize ¶ added in v0.2.4
func (d *DummyPluginManager) Authorize(ctx context.Context, in *plugin.AuthorizationInput) (*plugin.AuthorizationOutput, error)
type Gen3AuthPlugin ¶ added in v0.2.4
type Gen3AuthPlugin struct {
MockConfig mockAuthConfig
Logger any // Replace with actual logger type if needed
}
Gen3AuthPlugin implements AuthenticationPlugin for gen3 mode.
func (*Gen3AuthPlugin) Authenticate ¶ added in v0.2.4
func (p *Gen3AuthPlugin) Authenticate(_ context.Context, in *plugin.AuthenticationInput) (*plugin.AuthenticationOutput, error)
type JWK ¶ added in v0.2.4
type JWK struct {
Kty string `json:"kty"` // Key type (RSA, EC, etc)
Use string `json:"use"` // Use (sig, enc)
Kid string `json:"kid"` // Key ID
N string `json:"n"` // RSA modulus
E string `json:"e"` // RSA exponent
}
JWK represents a JSON Web Key
type JWKS ¶ added in v0.2.4
type JWKS struct {
Keys []JWK `json:"keys"`
}
JWKS represents a JSON Web Key Set response
type JWKSCache ¶ added in v0.2.4
type JWKSCache struct {
// contains filtered or unexported fields
}
JWKSCache holds JWKS public keys for JWT signature verification
func NewJWKSCache ¶ added in v0.2.4
NewJWKSCache creates a new JWKS cache for the given endpoint
type LocalAuthPlugin ¶ added in v0.2.4
LocalAuthPlugin implements AuthenticationPlugin for local mode.
func (*LocalAuthPlugin) Authenticate ¶ added in v0.2.4
func (p *LocalAuthPlugin) Authenticate(ctx context.Context, in *plugin.AuthenticationInput) (*plugin.AuthenticationOutput, error)
type PluginClient ¶ added in v0.2.4
type PluginClient struct {
// contains filtered or unexported fields
}
PluginClient is the concrete implementation for plugin communication.
type PluginManager ¶ added in v0.2.4
type PluginManager struct {
// contains filtered or unexported fields
}
PluginManager manages the plugin process and calls Authorize.
func NewPluginManager ¶ added in v0.2.4
func NewPluginManager(pluginPath string) (*PluginManager, error)
NewPluginManager loads the plugin binary and returns a manager.
func (*PluginManager) Authorize ¶ added in v0.2.4
func (pm *PluginManager) Authorize(ctx context.Context, in *plugin.AuthorizationInput) (*plugin.AuthorizationOutput, error)
Authorize delegates to the plugin.
type RequestIDMiddleware ¶
type RequestIDMiddleware struct {
// contains filtered or unexported fields
}
func NewRequestIDMiddleware ¶
func NewRequestIDMiddleware(logger *slog.Logger) *RequestIDMiddleware
func (*RequestIDMiddleware) FiberMiddleware ¶ added in v0.2.0
func (m *RequestIDMiddleware) FiberMiddleware() fiber.Handler