From 7f917593423f6e425555d6b839fc42b0a0897230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20Val=C3=A9rio?= Date: Mon, 30 Dec 2024 14:38:29 -0300 Subject: [PATCH 1/2] update variable name --- oauthproxy.go | 2 +- pics_oauthproxy.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/oauthproxy.go b/oauthproxy.go index 6798b3ecff..e0030cc4f5 100644 --- a/oauthproxy.go +++ b/oauthproxy.go @@ -363,7 +363,7 @@ func (p *OAuthProxy) buildProxySubrouter(s *mux.Router) { p.SignOut(w, r, false) }, )) - s.Path(picsSignOutAllDevicesPath).Handler(p.sessionChain.ThenFunc( + s.Path(picsSignOutAllSessionsPath).Handler(p.sessionChain.ThenFunc( func(w http.ResponseWriter, r *http.Request) { p.SignOut(w, r, true) }, diff --git a/pics_oauthproxy.go b/pics_oauthproxy.go index 9464dc227a..2b39e8340d 100644 --- a/pics_oauthproxy.go +++ b/pics_oauthproxy.go @@ -11,7 +11,7 @@ import ( ) const ( - picsSignOutAllDevicesPath = "/sign_out_all_sessions" + picsSignOutAllSessionsPath = "/sign_out_all_sessions" ) func PicsSignOutAllSessions(backendLogoutAllSessionsURL string, introspectClaims string, accessToken string) (resp requests.Result, err error) { From b50dc018f25f875c296444d24b66d98b3b2966be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20Val=C3=A9rio?= Date: Mon, 30 Dec 2024 15:02:53 -0300 Subject: [PATCH 2/2] add auditlog --- oauthproxy.go | 2 ++ pkg/pics/audit/audit_client.go | 1 + 2 files changed, 3 insertions(+) diff --git a/oauthproxy.go b/oauthproxy.go index 781f9a795a..fc559e5c1c 100644 --- a/oauthproxy.go +++ b/oauthproxy.go @@ -813,6 +813,8 @@ func (p *OAuthProxy) backendLogout(rw http.ResponseWriter, req *http.Request, si if resp.StatusCode() != 200 { logger.Errorf("error while calling backend logout url, returned error code %v", resp.StatusCode()) } + + p.picsAuditClient.CreateSuccessfulLogoutAuditEntry(session, req.RequestURI, req.Header.Get("edisp-org-id")) } else { if providerData.BackendLogoutURL == "" { return diff --git a/pkg/pics/audit/audit_client.go b/pkg/pics/audit/audit_client.go index e928344e73..da92b20381 100644 --- a/pkg/pics/audit/audit_client.go +++ b/pkg/pics/audit/audit_client.go @@ -69,6 +69,7 @@ func (c *Client) CreateSuccessfulLogoutAuditEntry(ss *sessions.SessionState, app System: "http://hl7.org/fhir/ValueSet/audit-event-type", Version: "1", Code: "110123", Display: "Logout", UserSelected: "All Sessions"} c.createAuditEntry(ss, appURL, tenantID, "0", "Success", &coding) } + func (c *Client) createAuditEntry(ss *sessions.SessionState, appURL string, tenantID string, outcomeCode string, outcomeDesc string, coding *Coding) { if !c.enabled { return