grove.connectors.sfmc package

SalesForce Marketing Cloud connectors for Grove.

Submodules

grove.connectors.sfmc.api module

SalesForce Marketing Cloud audit API client.

The FuelSDK for Python is quite a heavy client - as it handles both SOAP and REST. The REST interface is not far off simply using requests either. As a result, to keep things lightweight this client simply implements the required operations for Get Security Events and Get Audit Events. There does not appear to be any special handling in this client - such as for rate-limits or authentication.

This may be replaced in future with the FuelSDK, but for now, we’ll keep it simple.

class grove.connectors.sfmc.api.Client(identity: str | None = None, token: str | None = None)[source]

Bases: object

get_audit(kind: str, cursor: int = 1, startdate: str | None = None, enddate: str | None = None) AuditLogEntries[source]

Fetches a list of audit events from the relevant audit REST API.

Parameters:
  • kind – The kind of audit events to fetch.

  • cursor – The page number of the records to fetch.

  • latest – The ISO8601 timestamp of the most recent event (inclusive).

  • oldest – The ISO8601 timestamp of the least recent event (inclusive).

Returns:

AuditLogEntries object containing a pagination cursor, and log entries.

get_audit_events(cursor: int = 1, startdate: str | None = None, enddate: str | None = None) AuditLogEntries[source]

Fetches a list of audit events from the getAuditEvents REST API.

Parameters:
  • cursor – The page number of the records to fetch.

  • latest – The ISO8601 timestamp of the most recent event (inclusive).

  • oldest – The ISO8601 timestamp of the least recent event (inclusive).

Returns:

AuditLogEntries object containing a pagination cursor, and log entries.

get_security_events(cursor: int = 1, startdate: str | None = None, enddate: str | None = None) AuditLogEntries[source]

Fetches a list of security events from the getSecurityEvents REST API.

Parameters:
  • cursor – The page number of the records to fetch.

  • latest – The ISO8601 timestamp of the most recent event (inclusive).

  • oldest – The ISO8601 timestamp of the least recent event (inclusive).

Returns:

A list of security events.

grove.connectors.sfmc.audit_events module

SalesForce Marketing Cloud audit event connector for Grove.

class grove.connectors.sfmc.audit_events.Connector(config: ConnectorConfig, context: Dict[str, str])[source]

Bases: BaseConnector

LOG_ORDER = 'CHRONOLOGICAL'
NAME = 'sfmc_audit_events'
POINTER_PATH = 'createdDate'
collect()[source]

Collects all logs from the SFMC API.

This will first check whether there are any pointers cached to indicate previous collections. If not, the last week of data will be collected.

grove.connectors.sfmc.security_events module

SalesForce Marketing Cloud Security security event connector for Grove.

class grove.connectors.sfmc.security_events.Connector(config: ConnectorConfig, context: Dict[str, str])[source]

Bases: BaseConnector

LOG_ORDER = 'CHRONOLOGICAL'
NAME = 'sfmc_security_events'
POINTER_PATH = 'createdDate'
collect()[source]

Collects all logs from the SFMC API.

This will first check whether there are any pointers cached to indicate previous collections. If not, the last week of data will be collected.