pub struct Discovery {
pub enabled: bool,
pub api_version: String,
pub end_point: String,
pub provider: Option<String>,
pub resource_types: Vec<Resource>,
pub capabilities: Option<Vec<Capability>>,
pub criteria: Option<Vec<Criterium>>,
pub public_key: Option<PublicKey>,
pub invite_accept_dialog: Option<String>,
}Expand description
This is the response payload of the discovery endpoint, representing the properties and capabilities offered by this server.
Fields§
§enabled: boolWhether the OCM service is enabled at this endpoint
api_version: StringThe OCM API version this endpoint supports
end_point: StringThe URI of the OCM API available at this endpoint Example: https://my-cloud-storage.org/ocm
provider: Option<String>A friendly branding name of this endpoint Example: MyCloudStorage
resource_types: Vec<Resource>A list of all supported resource types with their access protocols.
Each resource type is identified by its name: the list MUST NOT
contain more than one resource type object per given name.
capabilities: Option<Vec<Capability>>The optional capabilities exposed at this endpoint according to the present specifications.
use ocm_types::discovery::Capability;
let capabilities = vec![
Capability::WebdavUri,
Capability::ProtocolObject,
];
let json: Vec<Capability> = serde_json::from_str(r#"[
"webdav-uri",
"protocol-object"
]"#).unwrap();
assert_eq!(capabilities, json);criteria: Option<Vec<Criterium>>The criteria for accepting a Share Creation Notification. As all Receiving Servers should require the use of TLS in API calls, it is not necessary to expose that as a criterium.
example:
- allowlist
- invite
use ocm_types::discovery::Criterium;
let criteria = vec![
Criterium::Allowlist,
Criterium::Invite,
];
let json: Vec<Criterium> = serde_json::from_str(r#"[
"allowlist",
"invite"
]"#).unwrap();
assert_eq!(criteria, json);public_key: Option<PublicKey>The signatory used to sign outgoing request to confirm its origin.
The signatory is optional but it MUST contain id and publicKeyPem.
invite_accept_dialog: Option<String>Optional URL path of a web page where a user can accept an invite, when query parameters “token” and “providerDomain” are provided. Implementations that offer the invites capability SHOULD provide this URL as well in order to enhance the UX of the Invite Flow. If for example “/index.php/apps/sciencemesh/accept” is specified here then a Where-Are-You-From page could redirect the end-user to /index.php/apps/sciencemesh/accept?token=zi5kooKu3ivohr9a&providerDomain=example.com.