Friday, 2 May 2025

GO LANG GIN quick commands, GO LANG MTLS config, MTLS pass

 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()


In this example, the 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.
If the middleware was applied to a group of routes, the 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.

--------------------------------------------------
current server Front end open new tab, SAML authentication, then post back to current server ACS, then current server sends API response to front end contains window.post so front end can get event and data and close tab

No comments:

Post a Comment