Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.
Open
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
38 changes: 38 additions & 0 deletions fbpcp/entity/attestation_document.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict
from dataclasses import dataclass
from enum import Enum
from typing import List, Optional

from dataclasses_json import dataclass_json
from fbpcp.entity.measurement import Measurement


class PolicyName(str, Enum):
BINARY_MATCH = "BINARY_MATCH"


@dataclass_json
@dataclass
class PolicyParams:
package_name: Optional[str]
version: Optional[str]


@dataclass_json
@dataclass
class AttestationPolicy:
policy_name: PolicyName
params: PolicyParams


@dataclass_json
@dataclass
class AttestationDocument:
policy: AttestationPolicy
measurements: List[Measurement]
17 changes: 17 additions & 0 deletions fbpcp/entity/measurement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict
from dataclasses import dataclass

from dataclasses_json import dataclass_json


@dataclass_json
@dataclass
class Measurement:
key: str
value: str