feat(client): add functional option pattern for JWT auth config
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// The client handles authentication via X-SLURM-USER-NAME and X-SLURM-USER-TOKEN
|
||||
// headers, request/response marshaling, and error handling.
|
||||
//
|
||||
// Basic usage:
|
||||
// Static token authentication:
|
||||
//
|
||||
// httpClient := &http.Client{
|
||||
// Transport: &slurm.TokenAuthTransport{
|
||||
@@ -15,4 +15,14 @@
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
//
|
||||
// JWT authentication (auto-signed from local key):
|
||||
//
|
||||
// client, err := slurm.NewClientWithOpts("http://localhost:6820",
|
||||
// slurm.WithJWTKey("/etc/slurm/jwt/slurm_jwt.key"),
|
||||
// slurm.WithUsername("slurmapi"),
|
||||
// )
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
package slurm
|
||||
|
||||
Reference in New Issue
Block a user