Skip to content

Failed to unmarshal audit log entry #3016

@peter-aglen

Description

@peter-aglen

Using v57 of the package, we have a problem reading the audit log using Organizations.GetAuditLog.

The AuditEntry struct has a field Permission *string, but we have found a scenario in which the API returns a bool in the permission field (see example below). This naturally leads to the error cannot unmarshal bool into Go struct field AuditEntry.permission of type string, which basically blocks us from reading the audit log.

{
  "@timestamp": 1701766234196,
  "_document_id": "abc",
  "action": "org.update_member_repository_creation_permission",
  "actor": "ole-olsen",
  "actor_id": 123456789,
  "actor_location": {
    "country_code": "NO"
  },
  "business": "business",
  "business_id": 123456,
  "created_at": 1701766234196,
  "external_identity_nameid": "ole.olsen@a.com",
  "external_identity_username": "ole.olsen@a.com",
  "operation_type": "modify",
  "org": "myorg",
  "org_id": 123456789,
  "permission": true,
  "user_agent": "Mozilla/5.0 ...",
  "visibility": "public_internal"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions