Skip to content

Commit

Permalink
Merge branch 'main' into release-2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ramanan-ravi committed Nov 22, 2024
2 parents b4724a9 + 167fdc0 commit 5e4d40f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
19 changes: 11 additions & 8 deletions deepfence_server/handler/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@ func (h *Handler) APIAuthHandler(w http.ResponseWriter, r *http.Request) {
h.respondError(err, w)
return
}
// licenseActive - not needed in this api
accessTokenResponse, err := user.GetAccessToken(h.TokenAuth, model.GrantTypeAPIToken, false)

licenseActive := false
license, err := model.GetLicense(r.Context(), pgClient)
if err == nil {
licenseActive = license.IsActive
}
accessTokenResponse, err := user.GetAccessToken(h.TokenAuth, model.GrantTypeAPIToken, licenseActive)
if err != nil {
h.respondError(err, w)
return
Expand All @@ -90,13 +95,11 @@ func (h *Handler) RefreshTokenHandler(w http.ResponseWriter, r *http.Request) {
}

licenseActive := false
if grantType == model.GrantTypePassword {
pgClient, err := directory.PostgresClient(r.Context())
pgClient, err := directory.PostgresClient(r.Context())
if err == nil {
license, err := model.GetLicense(r.Context(), pgClient)
if err == nil {
license, err := model.GetLicense(r.Context(), pgClient)
if err == nil {
licenseActive = license.IsActive
}
licenseActive = license.IsActive
}
}

Expand Down
12 changes: 6 additions & 6 deletions docs/vulnerability_feeds/listing.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
}
],
"5": [
{
"built": "2024-11-20T01:33:52.440183664Z",
"version": 5,
"url": "https://threat-intel.deepfence.io/vulnerability-db/releases/download/threatintel-vuln-v5-2024-11-20_01-30-09/threatintel-vuln-v5-2024-11-20_01-30-09.tar.gz",
"checksum": "eb08ff334929aaa62e42474ac44df3f6a296d8f1d6fd5861c4c34775b7ba608c"
},
{
"built": "2024-11-20T13:12:15.751735771Z",
"version": 5,
Expand All @@ -50,6 +44,12 @@
"version": 5,
"url": "https://threat-intel.deepfence.io/vulnerability-db/releases/download/threatintel-vuln-v5-2024-11-21_13-08-46/threatintel-vuln-v5-2024-11-21_13-08-46.tar.gz",
"checksum": "7f25862e0372762a46b20965149fc38d62a8ae1084b0dbbad5e307d921feb827"
},
{
"built": "2024-11-22T01:33:53.147260619Z",
"version": 5,
"url": "https://threat-intel.deepfence.io/vulnerability-db/releases/download/threatintel-vuln-v5-2024-11-22_01-30-08/threatintel-vuln-v5-2024-11-22_01-30-08.tar.gz",
"checksum": "163a0ec98a4f4594f4b1964880dd8d4ef502ba1c8d3b9627966e834afa10d60b"
}
]
}
Expand Down

0 comments on commit 5e4d40f

Please sign in to comment.