feat: add platform access foundation

This commit is contained in:
a.tolmachev
2026-03-29 23:17:05 +03:00
parent 9fb69c1571
commit 587584a8bf
19 changed files with 1058 additions and 34 deletions
+31 -2
View File
@@ -1,7 +1,7 @@
use crank_core::{
Agent, AgentId, AgentOperationBinding, AgentStatus, AgentVersion, AuthProfile, DescriptorId,
ExportMode, Operation, OperationId, OperationStatus, Protocol, SampleId, Workspace,
WorkspaceId,
ExportMode, InvitationToken, MembershipRole, Operation, OperationId, OperationStatus,
PlatformApiKey, Protocol, SampleId, User, Workspace, WorkspaceId,
};
use crank_mapping::MappingSet;
use crank_schema::Schema;
@@ -46,6 +46,24 @@ pub struct WorkspaceRecord {
pub workspace: Workspace,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct MembershipRecord {
pub workspace_id: WorkspaceId,
pub user: User,
pub role: MembershipRole,
pub created_at: String,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InvitationRecord {
pub invitation: InvitationToken,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct PlatformApiKeyRecord {
pub api_key: PlatformApiKey,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AgentSummary {
pub id: AgentId,
@@ -248,6 +266,17 @@ pub struct PublishAgentRequest<'a> {
pub published_by: Option<&'a str>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CreateInvitationRequest<'a> {
pub invitation: &'a InvitationToken,
}
#[derive(Clone, Debug, PartialEq)]
pub struct CreatePlatformApiKeyRequest<'a> {
pub api_key: &'a PlatformApiKey,
pub secret_hash: &'a str,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SaveSampleMetadataRequest<'a> {
pub sample: &'a OperationSampleMetadata,