@rivascva/dt-idl 1.1.85 → 1.1.87

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/auth/models.go CHANGED
@@ -3,7 +3,16 @@ package auth
3
3
  import "time"
4
4
 
5
5
  // DefaultServiceTokenDuration is the default duration for service tokens.
6
- const DefaultServiceTokenDuration = 30 * time.Minute
6
+ const DefaultServiceTokenDuration = 60 * time.Minute
7
+
8
+ // DefaultUserTokenDuration is the default duration for user tokens.
9
+ const DefaultUserTokenDuration = 15 * time.Minute
10
+
11
+ // DefaultServiceRefreshTokenDuration is the default duration for refresh tokens.
12
+ const DefaultServiceRefreshTokenDuration = 7 * 24 * time.Hour
13
+
14
+ // DefaultUserRefreshTokenDuration is the default duration for refresh tokens.
15
+ const DefaultUserRefreshTokenDuration = 30 * 24 * time.Hour
7
16
 
8
17
  // approvedServices is a list of services that are allowed to access sensitive data.
9
18
  var approvedServices = []string{"dt-trade-service", "dt-portfolio-service", "dt-asset-service", "dt-user-service"}
@@ -9,6 +9,7 @@ import (
9
9
  "github.com/RivasCVA/dt-idl/go/auth"
10
10
  "github.com/RivasCVA/dt-idl/go/log"
11
11
  "github.com/RivasCVA/dt-idl/go/models"
12
+ "github.com/RivasCVA/dt-idl/go/utils"
12
13
  "github.com/RivasCVA/dt-idl/go/write"
13
14
  "github.com/google/uuid"
14
15
  )
@@ -74,7 +75,14 @@ func CommonContext(next http.Handler) http.Handler {
74
75
  // CommonHeaders adds shared headers to all responses.
75
76
  func CommonHeaders(next http.Handler) http.Handler {
76
77
  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
78
+ // set the content type
77
79
  w.Header().Add("content-type", "application/json")
80
+
81
+ // set the request id
82
+ if requestId, err := utils.GetRequestIdFromContext(r.Context()); err == nil {
83
+ w.Header().Add("X-Request-Id", requestId)
84
+ }
85
+
78
86
  next.ServeHTTP(w, r)
79
87
  })
80
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivascva/dt-idl",
3
- "version": "1.1.85",
3
+ "version": "1.1.87",
4
4
  "description": "Dream Trade - Interface Definition Language",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",