glacis 0.1.3__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: glacis
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: GLACIS SDK for Python - AI Compliance Attestation
5
5
  Project-URL: Homepage, https://glacis.io
6
6
  Project-URL: Documentation, https://docs.glacis.io/sdk/python
@@ -69,22 +69,82 @@ class AttestInput(BaseModel):
69
69
  populate_by_name = True
70
70
 
71
71
 
72
+ class InclusionProof(BaseModel):
73
+ """Merkle inclusion proof from transparency log."""
74
+
75
+ leaf_index: int = Field(alias="leaf_index", description="Leaf index in tree")
76
+ tree_size: int = Field(alias="tree_size", description="Tree size when proof generated")
77
+ hashes: list[str] = Field(description="Sibling hashes")
78
+ root_hash: str = Field(alias="root_hash", description="Root hash")
79
+
80
+ class Config:
81
+ populate_by_name = True
82
+
83
+
84
+ class STH(BaseModel):
85
+ """Signed Tree Head."""
86
+
87
+ tree_size: int = Field(alias="tree_size")
88
+ timestamp: str
89
+ root_hash: str = Field(alias="root_hash")
90
+ signature: str
91
+
92
+ class Config:
93
+ populate_by_name = True
94
+
95
+
96
+ class TransparencyProofs(BaseModel):
97
+ """Transparency proofs from receipt-service."""
98
+
99
+ inclusion_proof: InclusionProof
100
+ sth_curr: STH
101
+ sth_prev: STH
102
+ consistency_path: list[str] = Field(default_factory=list)
103
+
104
+ class Config:
105
+ populate_by_name = True
106
+
107
+
108
+ class FullReceipt(BaseModel):
109
+ """Full receipt from receipt-service."""
110
+
111
+ schema_version: str = Field(default="1.0")
112
+ attestation_hash: str
113
+ heartbeat_epoch: int
114
+ binary_hash: str
115
+ network_state_hash: str
116
+ mono_counter: int
117
+ wall_time_ns: str
118
+ witness_signature: str
119
+ transparency_proofs: TransparencyProofs
120
+
121
+ class Config:
122
+ populate_by_name = True
123
+
124
+
72
125
  class AttestReceipt(BaseModel):
73
126
  """Receipt returned from attestation."""
74
127
 
75
128
  attestation_id: str = Field(alias="attestationId", description="Unique attestation ID")
129
+ attestation_hash: str = Field(alias="attestation_hash", description="Content hash")
76
130
  timestamp: str = Field(description="ISO 8601 timestamp")
77
131
  leaf_index: int = Field(alias="leafIndex", description="Merkle tree leaf index")
78
- leaf_hash: str = Field(alias="leafHash", description="Leaf node hash")
79
- merkle_proof: MerkleInclusionProof = Field(
80
- alias="merkleProof", description="Inclusion proof"
81
- )
82
- signed_tree_head: SignedTreeHead = Field(
83
- alias="signedTreeHead", description="Tree head at attestation time"
84
- )
85
- badge_url: str = Field(alias="badgeUrl", description="Verification badge URL")
132
+ tree_size: int = Field(alias="treeSize", description="Tree size")
133
+ epoch_id: Optional[str] = Field(alias="epochId", default=None)
134
+ receipt: Optional[FullReceipt] = Field(default=None, description="Full receipt with proofs")
86
135
  verify_url: str = Field(alias="verifyUrl", description="Verification endpoint URL")
87
136
 
137
+ # Computed properties for convenience
138
+ @property
139
+ def witness_status(self) -> str:
140
+ """Return witness status based on receipt presence."""
141
+ return "WITNESSED" if self.receipt else "PENDING"
142
+
143
+ @property
144
+ def badge_url(self) -> str:
145
+ """Return badge/verify URL."""
146
+ return self.verify_url
147
+
88
148
  class Config:
89
149
  populate_by_name = True
90
150
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "glacis"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  description = "GLACIS SDK for Python - AI Compliance Attestation"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.9"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes