Fix audit log for logout all (#65)
- [x] Fix audit for logout all AB#1579962
This commit is contained in:
commit
b3bf233e57
|
|
@ -54,19 +54,19 @@ func NewAuditClient(opts *ClientOpts) (*Client, error) {
|
|||
|
||||
func (c *Client) CreateSuccessfulLoginAuditEntry(ss *sessions.SessionState, appURL string, tenantID string) {
|
||||
coding := Coding{
|
||||
System: "http://hl7.org/fhir/ValueSet/audit-event-type", Version: "1", Code: "110114", Display: "User Authentication", UserSelected: ""}
|
||||
System: "http://hl7.org/fhir/ValueSet/audit-event-type", Version: "1", Code: "110114", Display: "User Authentication"}
|
||||
c.createAuditEntry(ss, appURL, tenantID, "0", "Success", &coding)
|
||||
}
|
||||
|
||||
func (c *Client) CreateFailedLoginAuditEntry(ss *sessions.SessionState, appURL string, tenantID string, errorDesc string) {
|
||||
coding := Coding{
|
||||
System: "http://hl7.org/fhir/ValueSet/audit-event-type", Version: "1", Code: "110114", Display: "User Authentication", UserSelected: ""}
|
||||
System: "http://hl7.org/fhir/ValueSet/audit-event-type", Version: "1", Code: "110114", Display: "User Authentication"}
|
||||
c.createAuditEntry(ss, appURL, tenantID, "1", errorDesc, &coding)
|
||||
}
|
||||
|
||||
func (c *Client) CreateSuccessfulLogoutAuditEntry(ss *sessions.SessionState, appURL string, tenantID string) {
|
||||
coding := Coding{
|
||||
System: "http://hl7.org/fhir/ValueSet/audit-event-type", Version: "1", Code: "110114", Display: "Logout", UserSelected: "All Sessions"}
|
||||
System: "http://hl7.org/fhir/ValueSet/audit-event-type", Version: "1", Code: "110123", Display: "User Logout All Sessions"}
|
||||
c.createAuditEntry(ss, appURL, tenantID, "0", "Success", &coding)
|
||||
}
|
||||
|
||||
|
|
@ -77,8 +77,7 @@ func (c *Client) createAuditEntry(ss *sessions.SessionState, appURL string, tena
|
|||
auditObject := RootEvent{
|
||||
ResourceType: "AuditEvent",
|
||||
Event: &Event{
|
||||
Type: &Coding{
|
||||
coding.System, coding.Version, coding.Code, coding.Display, coding.UserSelected},
|
||||
Type: &Coding{System: coding.System, Version: coding.Version, Code: coding.Code, Display: coding.Display},
|
||||
Action: "E",
|
||||
DateTime: time.Now().UTC().Format(time.RFC3339),
|
||||
Outcome: outcomeCode,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
package audit
|
||||
|
||||
type Coding struct {
|
||||
System string `json:"system,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Code string `json:"code,omitempty"`
|
||||
Display string `json:"display,omitempty"`
|
||||
System string `json:"system,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Code string `json:"code,omitempty"`
|
||||
Display string `json:"display,omitempty"`
|
||||
// AuditServer is complaining about UserSelected. Do not use.
|
||||
UserSelected string `json:"userSelected,omitempty"`
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue