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
9 changes: 7 additions & 2 deletions sdk/assertion.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import (
"github.com/opentdf/platform/lib/ocrypto"
)

const (
SystemMetadataAssertionID = "system-metadata"
SystemMetadataSchemaV1 = "system-metadata-v1"
)

// AssertionConfig is a shadow of Assertion with the addition of the signing key.
// It is used on creation
type AssertionConfig struct {
Expand Down Expand Up @@ -315,13 +320,13 @@ func GetSystemMetadataAssertionConfig() (AssertionConfig, error) {
}

return AssertionConfig{
ID: "default-assertion",
ID: SystemMetadataAssertionID,
Type: BaseAssertion,
Scope: PayloadScope,
AppliesToState: Unencrypted,
Statement: Statement{
Format: "json",
Schema: "metadata",
Schema: SystemMetadataSchemaV1,
Value: string(metadataJSON),
},
}, nil
Expand Down
4 changes: 2 additions & 2 deletions sdk/tdf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ func (s *TDFSuite) Test_SystemMetadataAssertions() {

found := false
for _, assertion := range assertions {
if assertion.ID == "default-assertion" { // Ensure `ID` exists
if assertion.ID == SystemMetadataAssertionID { // Ensure `ID` exists
found = true

// Validate JSON in Statement.Value
Expand All @@ -540,7 +540,7 @@ func (s *TDFSuite) Test_SystemMetadataAssertions() {
s.Equal(runtime.Version(), metadata["go_version"], "go_version mismatch")
}
}
s.True(found, "Default assertion not found")
s.True(found, "System metadata assertion not found")
}

func (s *TDFSuite) Test_TDF_KAS_Allowlist() {
Expand Down
Loading