Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions packages/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const (
operationCallGetPamSessionKey = "CallGetPamSessionKey"
operationCallUploadPamSessionLog = "CallUploadPamSessionLog"
operationCallPAMSessionTermination = "CallPAMSessionTermination"
operationCallUploadPamSessionEventBatch = "CallUploadPamSessionEventBatch"
operationCallGetMFASessionStatus = "CallGetMFASessionStatus"
operationCallOrgRelayHeartBeat = "CallOrgRelayHeartBeat"
operationCallInstanceRelayHeartBeat = "CallInstanceRelayHeartBeat"
Expand Down Expand Up @@ -1008,6 +1009,23 @@ func CallUploadPamSessionLogs(httpClient *resty.Client, sessionId string, reques
return nil
}

func CallUploadPamSessionEventBatch(httpClient *resty.Client, sessionId string, startOffset int64, data []byte) error {
response, err := httpClient.
R().
SetHeader("User-Agent", USER_AGENT).
SetHeader("Content-Type", "application/octet-stream").
SetBody(data).
Post(fmt.Sprintf("%v/v1/pam/sessions/%s/event-batches?startOffset=%d", config.INFISICAL_URL, sessionId, startOffset))

if err != nil {
return NewGenericRequestError(operationCallUploadPamSessionEventBatch, err)
}
if response.IsError() {
return NewAPIErrorWithResponse(operationCallUploadPamSessionEventBatch, response, nil)
}
return nil
}
Comment thread
bernie-g marked this conversation as resolved.

func CallPAMSessionTermination(httpClient *resty.Client, sessionId string) error {
response, err := httpClient.
R().
Expand Down
1 change: 1 addition & 0 deletions packages/pam/pam-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func HandlePAMProxy(ctx context.Context, conn *tls.Conn, pamConfig *GatewayPAMCo
if err != nil {
return fmt.Errorf("failed to create session logger: %w", err)
}
pamConfig.SessionUploader.RegisterSession(pamConfig.SessionId)

serverName := credentials.Host
if pamConfig.ResourceType == session.ResourceTypeKubernetes {
Expand Down
Loading
Loading