Documentation
¶
Overview ¶
Package api implements the ROFL API.
Index ¶
- Constants
- Variables
- func AttestLabels(signer signature.Signer, la LabelAttestation) ([]byte, *signature.RawSignature, error)
- type AttestLabelsRequest
- type AttestLabelsResponse
- type BundleAddRequest
- type BundleAddResponse
- type BundleInfo
- type BundleListRequest
- type BundleListResponse
- type BundleRemoveRequest
- type BundleRemoveResponse
- type BundleWriteRequest
- type BundleWriteResponse
- type ComponentInfo
- type Config
- type LabelAttestation
- type LogGetRequest
- type LogGetResponse
- type Notifications
- type VolumeAddRequest
- type VolumeAddResponse
- type VolumeInfo
- type VolumeListRequest
- type VolumeListResponse
- type VolumeRemoveRequest
- type VolumeRemoveResponse
Constants ¶
const ( // LocalRPCEndpointAttestation is the name of the local RPC endpoint for attestation functions. LocalRPCEndpointAttestation = "attestation" // MethodAttestLabels is the name of the AttestLabels method. MethodAttestLabels = "AttestLabels" // MaxAttestLabels is the maximum number of labels on can request attestation for. MaxAttestLabels = 10 )
const ( // LocalRPCEndpointBundleManager is the name of the local RPC endpoint for the bundle manager. LocalRPCEndpointBundleManager = "bundle-manager" // MethodBundleWrite is the name of the BundleWrite method. MethodBundleWrite = "BundleWrite" // MethodBundleAdd is the name of the BundleAdd method. MethodBundleAdd = "BundleAdd" // MethodBundleRemove is the name of the BundleRemove method. MethodBundleRemove = "BundleRemove" // MethodBundleList is the name of the BundleList method. MethodBundleList = "BundleList" )
const ( // LocalRPCEndpointLogManager is the name of the local RPC endpoint for the log manager. LocalRPCEndpointLogManager = "log-manager" // MethodLogGet is the name of the LogGet method. MethodLogGet = "LogGet" )
const ( // LocalRPCEndpointVolumeManager is the name of the local RPC endpoint for the volume manager. LocalRPCEndpointVolumeManager = "volume-manager" // MethodVolumeAdd is the name of the VolumeAdd method. MethodVolumeAdd = "VolumeAdd" // MethodVolumeRemove is the name of the VolumeRemove method. MethodVolumeRemove = "VolumeRemove" // MethodVolumeList is the name of the VolumeList method. MethodVolumeList = "VolumeList" )
const (
// EnclaveRPCEndpointRONL is the name of the EnclaveRPC endpoint for the RONL component.
EnclaveRPCEndpointRONL = "ronl"
)
const (
// MethodGetConfig is the name of the `get_config` method.
MethodGetConfig = "rofl.GetConfig"
)
Variables ¶
var AttestLabelsSignatureContext = signature.NewContext("oasis-core/node: attest component labels")
AttestLabelsSignatureContext is the signature context used for label attestation.
Functions ¶
func AttestLabels ¶ added in v0.2504.0
func AttestLabels(signer signature.Signer, la LabelAttestation) ([]byte, *signature.RawSignature, error)
AttestLabels signs the given label attestation and returns the encoded attestation with signature.
Types ¶
type AttestLabelsRequest ¶ added in v0.2504.0
type AttestLabelsRequest struct {
// Labels are the labels to attest to.
Labels []string `json:"labels"`
}
AttestLabelsRequest is a request to host to attest to specific component labels.
type AttestLabelsResponse ¶ added in v0.2504.0
type AttestLabelsResponse struct {
// Attestation is the CBOR-serialized label attestation.
Attestation []byte `json:"attestation"`
// NodeID is the public key of the node attesting to the labels.
NodeID signature.PublicKey `json:"node_id"`
// Signature is the signature of the attested labels.
Signature signature.RawSignature `json:"signature"`
}
AttestLabelsResponse is the response from the AttestLabels method.
type BundleAddRequest ¶ added in v0.2502.0
type BundleAddRequest struct {
// TemporaryName is the temporary name to use to access the bundle. The chunks must have
// previously been created by using `BundleWriteRequest`.
TemporaryName string `json:"temporary_name"`
// ManifestHash is the expected hash of the manifest contained inside the bundle.
ManifestHash hash.Hash `json:"manifest_hash"`
// Labels are the labels to tag the bundle with so it can later be found.
Labels map[string]string `json:"labels"`
// Volumes are the volumes to attach to the bundle.
Volumes map[string]string `json:"volumes"`
}
BundleAddRequest is a request to host to add a specific bundle to the host.
The `PermissionBundleAdd` permission is required to call this method.
type BundleAddResponse ¶ added in v0.2502.0
type BundleAddResponse struct{}
BundleAddResponse is the response from the BundleAdd method.
type BundleInfo ¶ added in v0.2502.0
type BundleInfo struct {
// ManifestHash is the hash of the manifest.
ManifestHash hash.Hash `json:"manifest_hash"`
// Components is a list of all components in this bundle.
Components []*ComponentInfo `json:"components"`
// Labels is a set of labels assigned to this bundle.
Labels map[string]string `json:"labels,omitempty"`
}
BundleInfo is the bundle information.
type BundleListRequest ¶ added in v0.2502.0
type BundleListRequest struct {
// Labels are the labels to filter the bundles by. All labels must match.
Labels map[string]string `json:"labels"`
}
BundleListRequest is a request to host to list all bundles.
The `PermissionBundleAdd` permission is required to call this method.
type BundleListResponse ¶ added in v0.2502.0
type BundleListResponse struct {
// Bundles are the resulting bundles.
Bundles []*BundleInfo `json:"bundles,omitempty"`
}
BundleListResponse is a response from host to list all bundles.
type BundleRemoveRequest ¶ added in v0.2502.0
type BundleRemoveRequest struct {
// Labels are the labels to filter the bundles by. All labels must match.
Labels map[string]string `json:"labels"`
}
BundleRemoveRequest is a request to host to remove specific bundles.
The `PermissionBundleRemove` permission is required to call this method.
type BundleRemoveResponse ¶ added in v0.2502.0
type BundleRemoveResponse struct{}
BundleRemoveResponse is the response from the BundleRemove method.
type BundleWriteRequest ¶ added in v0.2502.0
type BundleWriteRequest struct {
// TemporaryName is a temporary name to identify the chunk later.
TemporaryName string `json:"temporary_name"`
// Create is the optional flag which specifies that the bundle should be recreated. If the
// bundle exists and this flag is set to true, it will be truncated. If the flag is set to
// false, any content will be appended to the existing bundle.
Create bool `json:"create,omitempty"`
// Data that should be appended to the bundle.
Data []byte `json:"data"`
}
BundleWriteRequest is a request to host to store a chunk of the bundle.
The `PermissionBundleAdd` permission is required to call this method.
type BundleWriteResponse ¶ added in v0.2502.0
type BundleWriteResponse struct{}
BundleWriteResponse is the response from the BundleWrite method.
type ComponentInfo ¶ added in v0.2502.0
type ComponentInfo struct {
// Name is the component name.
Name string `json:"name"`
}
ComponentInfo is the component information.
type Config ¶ added in v0.2505.0
type Config struct {
/// Notification are notifications settings.
Notifications Notifications `json:"notifications"`
}
Config is runtime application configuration.
type LabelAttestation ¶ added in v0.2504.0
type LabelAttestation struct {
// Labels are the attested labels.
Labels map[string]string `json:"labels"`
// RAK is the component RAK.
RAK signature.PublicKey `json:"rak"`
}
LabelAttestation is an attestation of component labels.
type LogGetRequest ¶ added in v0.2504.0
type LogGetRequest struct {
// Labels are the labels to filter the bundles by. All labels must match and only the
// first bundle is used.
Labels map[string]string `json:"labels"`
// ComponentID is the identifier of the component in the bundle.
ComponentID string `json:"component_id"`
// Since is an optional UNIX timestamp to filter log entries by. Only entries with higher
// timestamps will be returned.
Since uint64 `json:"since,omitempty"`
}
LogGetRequest is a request to host to fetch logs.
The `PermissionLogView` permission is required to call this method.
type LogGetResponse ¶ added in v0.2504.0
type LogGetResponse struct {
// Logs are the log lines for the given component.
Logs []string `json:"logs"`
}
LogGetResponse is a response from the LogGet method.
type Notifications ¶ added in v0.2505.0
type Notifications struct {
/// Blocks subscribe to runtime block notifications.
Blocks bool `json:"blocks,omitempty"`
/// Events subscribe to runtime event notifications associated
/// with the specified tags.
Events [][]byte `json:"events,omitempty"`
}
Notifications are notification settings.
type VolumeAddRequest ¶ added in v0.2502.0
type VolumeAddRequest struct {
// Labels are the labels to tag the volume with so it can later be found.
Labels map[string]string `json:"labels"`
}
VolumeAddRequest is a request to add a volume.
The `PermissionVolumeAdd` permission is required to call this method.
type VolumeAddResponse ¶ added in v0.2502.0
type VolumeAddResponse struct {
// ID is the unique volume identifier.
ID string `json:"id"`
}
VolumeAddResponse is a response from the VolumeAdd method.
type VolumeInfo ¶ added in v0.2502.0
type VolumeInfo struct {
// ID is the unique volume identifier.
ID string `json:"id"`
// Labels is a set of labels assigned to this volume.
Labels map[string]string `json:"labels,omitempty"`
}
VolumeInfo is the volume information.
type VolumeListRequest ¶ added in v0.2502.0
type VolumeListRequest struct {
// Labels are the labels to filter the volumes by. All labels must match.
Labels map[string]string `json:"labels"`
}
VolumeListRequest is a request to list volumes.
The `PermissionVolumeAdd` permission is required to call this method.
type VolumeListResponse ¶ added in v0.2502.0
type VolumeListResponse struct {
Volumes []*VolumeInfo `json:"volumes,omitempty"`
}
VolumeListResponse is a response from the VolumeList method.
type VolumeRemoveRequest ¶ added in v0.2502.0
type VolumeRemoveRequest struct {
// Labels are the labels to filter the volumes by. All labels must match.
Labels map[string]string `json:"labels"`
}
VolumeRemoveRequest is a request to remove volumes.
The `PermissionVolumeRemove` permission is required to call this method.
type VolumeRemoveResponse ¶ added in v0.2502.0
type VolumeRemoveResponse struct{}
VolumeRemoveResponse is a response from the VolumeRemove method.