1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//! These constants represent the metadata keys used when a [SphereContext] is
//! is initialized. Since these represent somewhat free-form key/values in the
//! storage layer, we make a best effort to document them here.

#[cfg(doc)]
use crate::context::SphereContext;

#[cfg(doc)]
use crate::data::Did;

#[cfg(doc)]
use cid::Cid;

#[cfg(doc)]
use url::Url;

/// A key that corresponds to the sphere's identity, which is represented by a
/// [Did] when it is set.
pub const IDENTITY: &str = "identity";

/// A name that corresponds to the locally available key. This name is
/// represented as a string, and should match a credential ID for a key in
/// whatever the supported platform key storage is.
pub const USER_KEY_NAME: &str = "user_key_name";

/// The [Cid] of a UCAN JWT that authorizes the configured user key to access
/// the sphere.
pub const AUTHORIZATION: &str = "authorization";

/// The base [Url] of a Noosphere Gateway API that will allow this sphere to
/// sync with it.
pub const GATEWAY_URL: &str = "gateway_url";

/// The counterpart sphere [Did] that either tracks or is tracked by this
/// sphere.
pub const COUNTERPART: &str = "counterpart";