soul-base 0.1.0

Data contract primitives for the Soul platform (IDs, Subject, Scope, Consent, Envelope, ...).
Documentation
use crate::{
    actor::{ActorId, ActorType},
    tenant::TenantId,
};
#[cfg(feature = "schema")]
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

/// Backward-compatible type alias. Prefer `ActorType` directly.
#[deprecated(since = "1.1.0", note = "Use ActorType instead")]
pub type SubjectKind = ActorType;

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(JsonSchema))]
pub struct Subject {
    /// Actor type classification (was: `kind: SubjectKind`)
    #[serde(alias = "kind")]
    pub actor_type: ActorType,
    /// Actor unique identifier (was: `subject_id: Id`)
    #[serde(alias = "subject_id")]
    pub actor_id: ActorId,
    pub tenant: TenantId,
    #[serde(default)]
    pub claims: serde_json::Map<String, serde_json::Value>,
}