@rivascva/dt-idl 1.1.97 → 1.1.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/go/request/auth_transport.go +10 -0
- package/package.json +1 -1
|
@@ -18,6 +18,16 @@ type AuthTransport struct {
|
|
|
18
18
|
token *jwt.Token
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
func NewAuthTransport(transport http.RoundTripper, service string, secret string) *AuthTransport {
|
|
22
|
+
return &AuthTransport{
|
|
23
|
+
mu: sync.RWMutex{},
|
|
24
|
+
transport: transport,
|
|
25
|
+
service: service,
|
|
26
|
+
secret: secret,
|
|
27
|
+
token: nil,
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
21
31
|
func (t *AuthTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
|
22
32
|
// get the token
|
|
23
33
|
t.mu.RLock()
|