Skip to main content

Crate nautilus_rs

Crate nautilus_rs 

Source
Expand description

Official Rust SDK for the Verne Nautilus platform.

Provides two services behind a single unified client:

  • Relay — Webhooks-as-a-Service: deliver events to subscribed HTTP endpoints.
  • Gate — Auth-as-a-Service: manage identities, issue short-lived access tokens, and enforce authorization policies.
  • Passepartout — Telegram Auth-as-a-Service: sign users in with Telegram and introspect the access tokens it issues.
  • Clockwork — Cron-as-a-Service: schedule recurring cron jobs and one-off delayed jobs that invoke your HTTP endpoints, and inspect their execution history.

§Quick start

Add the crate to your Cargo.toml:

[dependencies]
nautilus-rs = "1.2"
tokio = { version = "1", features = ["full"] }

§Using both services together

use nautilus_rs::{Verne, SendMessageParams};
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), nautilus_rs::Error> {
    let verne = Verne::builder()
        .relay("vrn_relay_live_sk_…")
        .gate("vrn_gate_live_sk_…")
        .build()?;

    // Send a webhook event
    let msg = verne.relay()?.messages().send(SendMessageParams {
        event_type: "order.placed".into(),
        payload: json!({ "order_id": "ord_123" }),
        ..Default::default()
    }).await?;
    println!("sent: {}", msg.id);

    Ok(())
}

§Using a single service

You can also instantiate Relay or Gate on their own:

use nautilus_rs::Relay;

let relay = Relay::new("vrn_relay_live_sk_…");

§Error handling

Every fallible call returns Result<T, Error>. Match on the variants to handle specific failure modes:

use nautilus_rs::{Error, Relay, SendMessageParams};
use serde_json::json;

let relay = Relay::new("vrn_relay_live_sk_…");
match relay.messages().send(SendMessageParams {
    event_type: "ping".into(),
    payload: json!({}),
    ..Default::default()
}).await {
    Ok(msg) => println!("delivered: {}", msg.id),
    Err(Error::Api(e)) => eprintln!("API {}: {}", e.status, e.message),
    Err(e) => eprintln!("unexpected: {e}"),
}

§API key format

Keys follow the pattern vrn_<service>_<env>_sk_…, for example:

  • vrn_relay_live_sk_…
  • vrn_gate_test_sk_…

Structs§

AccessToken
A short-lived access token issued by Gate.
ApiError
A structured error returned by the Verne API.
AuthorizationDecision
The result of an authorization check.
AuthorizeParams
Parameters for Gate::authorize.
Clockwork
Clockwork service client — Cron-as-a-Service.
ClockworkBuilder
Builder for a standalone Clockwork client.
CreateCronJobParams
Parameters for CronJobsClient::create.
CreateDelayedJobParams
Parameters for DelayedJobsClient::create.
CreateIdentityParams
Parameters for IdentitiesClient::create.
CreateTokenParams
Parameters for TokensClient::create.
CronJob
A scheduled cron job returned by the Clockwork API.
CronJobsClient
Access to the /v1/clockwork/jobs endpoints.
DelayedJob
A one-off delayed job returned by the Clockwork API.
DelayedJobsClient
Access to the /v1/clockwork/delayed endpoints.
Execution
A single execution record for a cron or delayed job.
Gate
Gate service client — Auth-as-a-Service.
GateBuilder
Builder for a standalone Gate client.
IdentitiesClient
Access to the /v1/gate/identities endpoints.
Identity
A user identity managed by Gate.
IdentityTraits
Profile traits for an existing Identity.
IdentityTraitsInput
Profile traits supplied when creating a new identity.
JsonPatchOp
A single RFC 6902 JSON Patch operation used with IdentitiesClient::patch.
ListMessagesParams
Parameters for MessagesClient::list.
LoginStart
The result of starting a Passepartout login flow.
LoginStatus
The current state of a Passepartout login flow.
Message
A webhook message returned by the Relay API.
MessagesClient
Access to the /v1/relay/messages endpoints.
OidcProvider
A social login (OAuth 2.0 / OIDC) provider and whether it is enabled for a tenant’s end-users.
Paginated
A page of results from a list endpoint.
Passepartout
Passepartout service client — Telegram Auth-as-a-Service.
PassepartoutBuilder
Builder for a standalone Passepartout client.
Relay
Relay service client — Webhooks-as-a-Service.
RelayBuilder
Builder for a standalone Relay client.
SecuritySettings
Security-related Gate Identity settings for a tenant.
SendMessageParams
Parameters for MessagesClient::send.
SettingsClient
Access to the /v1/gate/settings endpoints.
TelegramUser
A Telegram user profile returned once a login flow completes.
TokenInfo
Token validity and claims returned by TokensClient::introspect.
TokenIntrospection
Token validity and claims returned by Passepartout::introspect.
TokensClient
Access to the /v1/gate/tokens endpoints.
UpdateCronJobParams
Parameters for CronJobsClient::update.
Verne
Unified entry point for the Verne Nautilus platform SDK.
VerneBuilder
Builder for the unified Verne client.

Enums§

Error
The top-level error type returned by every fallible SDK operation.