Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GeminiRequireCertificate = GeminiAuth(Allow)
GeminiRequireCertificate is a middleware that only requires a client certificate.
Functions ¶
func GeminiAuth ¶
func GeminiAuth(approver Approver) sr.Middleware
GeminiAuth builds an authentication middleware from approval criteria.
If a request does not contain a client certificate it will be rejected with a "60 certificate required" response. If the client identity does not pass the approver it will be rejected with "62 certificate invalid".
func GeminiOptionalAuth ¶
func GeminiOptionalAuth(approver Approver) sr.Middleware
GeminiOptionalAuth builds auth middleware which doesn't require an identity.
If there is no client certificate the request will pass through the middleware. It will only be rejected with "62 certificate invalid" if there *is* a client certificate, but it fails the approval.
Types ¶
type Approver ¶
Approver is a function that validates a certificate.
It should not be have to handle a nil argument.
func RequireSpecificIdentity ¶
func RequireSpecificIdentity(identity *x509.Certificate) Approver
RequireSpecificIdentity builds an approver that demands one specific client certificate.