File tree Expand file tree Collapse file tree 2 files changed +11
-13
lines changed
Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 11package authcontrol
22
33type ServiceConfig struct {
4- URL string `toml:"url"`
4+ // Base URL of the service.
5+ URL string `toml:"url"`
6+ // JWTSecret is used to create dynamic JWT tokens for S2S auth.
57 JWTSecret string `toml:"jwt_secret"`
6- AccessKey string `toml:"access_key"`
8+ // JWTToken is a static JWT token for S2S auth.
9+ JWTToken string `toml:"jwt_token"`
710}
Original file line number Diff line number Diff line change @@ -14,15 +14,13 @@ import (
1414)
1515
1616type S2SClientConfig struct {
17- // JWTToken is the static JWT token used for authentication.
18- JWTToken string
19- // JWTSecret is the secret key used to dynamically create JWT BEARER token for authorization.
20- JWTSecret string
21- // Service is used in the service claim of the JWT token.
17+ // Service defines the "service" claim in the JWT token.
2218 Service string
23- // AccessKey is an optional access key used for authentication.
24- AccessKey string
25- // DebugRequests enables logging of HTTP requests.
19+ // JWTSecret is used to create dynamic JWT tokens for S2S auth.
20+ JWTSecret string
21+ // JWTToken is a static JWT token for S2S auth.
22+ JWTToken string
23+ // DebugRequests enables HTTP request logging.
2624 DebugRequests bool
2725}
2826
@@ -44,9 +42,6 @@ func S2SClient(cfg *S2SClientConfig) *http.Client {
4442 transport .If (cfg .JWTToken != "" ,
4543 transport .SetHeader ("Authorization" , "BEARER " + cfg .JWTToken ),
4644 ),
47- transport .If (cfg .AccessKey != "" ,
48- transport .SetHeader ("X-Access-Key" , cfg .AccessKey ),
49- ),
5045 transport .If (cfg .DebugRequests ,
5146 transport .LogRequests (transport.LogOptions {Concise : true , CURL : true }),
5247 ),
You can’t perform that action at this time.
0 commit comments