From 5a4af943702c21f4ea1793950b8c4e2b31856777 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 22 Nov 2024 01:34:37 +0000 Subject: [PATCH 1/2] Update listing with threatintel-2024-11-22_01-30-08 --- docs/vulnerability_feeds/listing.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/vulnerability_feeds/listing.json b/docs/vulnerability_feeds/listing.json index 18d03db19f..6a0a876f9f 100644 --- a/docs/vulnerability_feeds/listing.json +++ b/docs/vulnerability_feeds/listing.json @@ -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, @@ -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" } ] } From 167fdc0b564d8be2d07685d6a216d7ff99bf38f4 Mon Sep 17 00:00:00 2001 From: Ramanan Ravikumar <38394463+ramanan-ravi@users.noreply.github.com> Date: Fri, 22 Nov 2024 16:20:28 +0530 Subject: [PATCH 2/2] Set license active in api access token #2372 (#2375) --- deepfence_server/handler/auth.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/deepfence_server/handler/auth.go b/deepfence_server/handler/auth.go index f806f9a2c4..9e62f6fe7d 100644 --- a/deepfence_server/handler/auth.go +++ b/deepfence_server/handler/auth.go @@ -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 @@ -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 } }