GO LANG MTLS Config
TLS Config:
// NoClientCert indicates that no client certificate should be requested
// during the handshake, and if any certificates are sent they will not
// be verified.
NoClientCert ClientAuthType = iota
// RequestClientCert indicates that a client certificate should be requested
// during the handshake, but does not require that the client send any
// certificates.
RequestClientCert
// RequireAnyClientCert indicates that a client certificate should be requested
// during the handshake, and that at least one certificate is required to be
// sent by the client, but that certificate is not required to be valid.
RequireAnyClientCert
// VerifyClientCertIfGiven indicates that a client certificate should be requested
// during the handshake, but does not require that the client sends a
// certificate. If the client does send a certificate it is required to be
// valid.
VerifyClientCertIfGiven
// RequireAndVerifyClientCert indicates that a client certificate should be requested
// during the handshake, and that at least one valid certificate is required
// to be sent by the client.
RequireAndVerifyClientCert
--------------
GIN:
Get Full path:
routeName := c.FullPath()
routeNameMiddleware
is applied globally to all routes. When a request is made to /users/123
, the middleware will print "Route name: /users/:id". Similarly, a request to /products
would print "Route name: /products". The :id
is kept as a parameter and not replaced with the actual id.c.FullPath()
would return the full path including the group's prefix. For example, if the routes were defined under a group /api/v1
, the c.FullPath()
would return /api/v1/users/:id
.
No comments:
Post a Comment