refact(bsr): Use JSON for session meta and summary data

The session metadata is provided all at once when a new bsr is opened.
While the session recording metadata records metadata about a recording
while the recording is happening, notably it records each time a new
connection occurs.

The nested structure of the session metadata does not lend itself to the
append-only syntax of the recording meta file. In addition we do not
want to mix different kinds of metadata together. Thus the session
metadata is now written to a separate file in the BSR, and is written as
JSON which better handles the nested structure and allows for simpler
encoding/decoding.

Similarly the summary files are intended to be written to as containers
close and have been switched to JSON.
This commit is contained in:
Timothy Messier committed 2023-05-31 12:18:23 +00:00
1 parent 7dc15f1f39
commit 78ea1a9f3a
50 files changed
+738 -1718

No files matched your search

@@ -2,10 +2,13 @@ CREATING SHA256SUM.sig
CREATED SHA256SUM.sig
CREATING SHA256SUM
CREATED SHA256SUM
CREATING session.meta
CREATED session.meta
CREATING session.summary
CREATED session.summary
CREATING session-recording.meta
CREATED session-recording.meta
CREATING session-meta.json
CREATED session-meta.json
CLOSED session-meta.json
CREATING session-recording-summary.json
CREATED session-recording-summary.json
CREATING bsrKey.pub
CREATED bsrKey.pub
CLOSING bsrKey.pub
@@ -3,3 +3,4 @@
.* wrappedPrivKey
.* pubKeyBsrSignature.sign
.* pubKeySelfSignature.sign
.* session-meta.json
@@ -2,7 +2,7 @@ CREATING SHA256SUM.sig
CREATED SHA256SUM.sig
CREATING SHA256SUM
CREATED SHA256SUM
CREATING connection.meta
CREATED connection.meta
CREATING connection.summary
CREATED connection.summary
CREATING connection-recording.meta
CREATED connection-recording.meta
CREATING connection-recording-summary.json
CREATED connection-recording-summary.json
@@ -2,7 +2,7 @@ CREATING SHA256SUM.sig
CREATED SHA256SUM.sig
CREATING SHA256SUM
CREATED SHA256SUM
CREATING channel.meta
CREATED channel.meta
CREATING channel.summary
CREATED channel.summary
CREATING channel-recording.meta
CREATED channel-recording.meta
CREATING channel-recording-summary.json
CREATED channel-recording-summary.json
@@ -0,0 +1,2 @@
id: session_123456789
protocol: TEST
@@ -1,35 +0,0 @@
id: session_123456789
protocol: TEST
user_publicId: user123
user_scope_publicId: global
user_scope_type: global
target_publicId: target123
target_scope_publicId: proj123
target_scope_type: project
target_scope_parentId: org123
target_defaultPort: 0
target_sessionMaxSeconds: 0
target_sessionConnectionLimit: 0
worker_publicId: w_12345
worker_version: 0.25.5
worker_sha: beepboopgitsha
staticHost_publicId: host123
staticHostCatalog_publicId: staticcat123
staticHostCatalog_projectId: proj123
staticHost_address: 127.0.0.1
scs123_staticCredentialStore_publicId: scs123
scs123_staticCredentialStore_projectId: proj123
scs123_staticCredentialStore_credential_scjson123_staticJsonCredential_publicId: scjson123
scs123_staticCredentialStore_credential_scjson123_staticJsonCredential_projectId: proj123
scs123_staticCredentialStore_credential_scjson123_staticJsonCredential_objectHmac: hmac
vcs123_vaultCredentialStore_publicId: vcs123
vcs123_vaultCredentialStore_projectId: proj123
vcs123_vaultCredentialStore_vaultAddress: an/address
vcs123_vaultCredentialStore_namespace: name
vcs123_vaultCredentialStore_tlsServerName: imaserver
vcs123_vaultCredentialStore_tlsSkipVerify: false
vcs123_vaultCredentialStore_credential_vl123_vaultLibrary_publicId: vl123
vcs123_vaultCredentialStore_credential_vl123_vaultLibrary_projectId: proj123
vcs123_vaultCredentialStore_credential_vl123_vaultLibrary_vaultPath: /a/path
vcs123_vaultCredentialStore_credential_vl123_vaultLibrary_httpMethod: GET
vcs123_vaultCredentialStore_credential_vl123_vaultLibrary_credentialType: magic