syntax = "proto3";
package cald.relay.v1;
import "Core.proto";
import "Lookup.proto";
// If false, all generated code goes in a single java file
option java_multiple_files = true;
option java_package = "nexus.cald.api.relay";
// Calling this service: each rpc in RelayForgetNumberService, at the end of this file, is an HTTP
// POST to //. is the name between "cald." and ".v1" in this file's
// package (cald.relay.v1, so "relay"), and is the rpc's name in kebab-case: a relay at
// https://example.com/cald takes forgetNumber at https://example.com/cald/relay/forget-number. The
// body is the request message in protobuf's standard JSON encoding (Content-Type:
// application/json), and a 200 answer's body is the response message, encoded the same way. Every
// outcome the service decides, refusals included, is a 200 whose status field says which; any other
// HTTP status means the call didn't go through. A server that doesn't offer an rpc has no route for
// it.
// A holder that has deleted its registration at Lookup asks its relay to forget the number too:
// the relay drops what it keeps for the number -- its queue, its
// wake-up registration, its retrieval sessions and its abuse-attribution records -- rather than
// leaving them to age out.
// A holder calls this only after Lookup has answered DELETED, so nothing is destroyed while the
// deletion could still fail.
//
// The request is the holder's own signed SignedRegistrationDeletion (Lookup.proto), naming this
// relay's forget-number endpoint as its audience, so the bytes sent to Lookup's deletion endpoint
// can't be replayed here or the other way round.
// Lookup no longer holds the deleted pair, so the request carries it, with the intermediates it
// chains through to the root this relay trusts.
message ForgetNumberRequest {
// A serialized lookup SignedRegistrationDeletion whose audience is this relay's forget-number
// endpoint under its public URL or a relay address it is configured with, transmitted verbatim.
bytes signedRegistrationDeletion = 1;
// By the deleted pair's signing key, over `signedRegistrationDeletion` exactly as sent, under
// signing context `cald/lookup/registration-deletion/v1` (Core.proto): the same signature
// Lookup's deletion takes, over another audience.
bytes signature = 2;
// The deleted pair: both leaves, and the intermediates both were issued through, nearest the
// leaves first. The root is the relay's own and is never read from here.
cald.core.v1.CertificateBundle deletedPair = 3;
}
message ForgetNumberResponse {
Status status = 1;
// Human-readable detail for logs. Never something to branch on: `status` is.
string reason = 2;
enum Status {
// Never sent. What a response with no status reads as; a holder treats it as not forgotten.
STATUS_UNSPECIFIED = 0;
// The relay holds nothing for the number any more.
FORGOTTEN = 1;
// The request is the holder's, but Lookup names a different current pair for the number: a
// later registration, whose data this request can't touch. Only what is bound to the deleted
// pair was forgotten: envelopes sealed to its encryption certificate (and their
// abuse-attribution records), and sessions and a wake-up registration made under its signing
// certificate.
NOT_CURRENT = 2;
// The content didn't decode; the carried pair isn't both leaves of one pair issued to the
// number through a chain to this relay's root; heldFingerprint isn't the carried pair's; the
// signature didn't verify under its signing certificate; the audience isn't this relay's
// forget-number endpoint; or
// the timestamp isn't fresh. Nothing changed.
AUTHENTICATION_FAILED = 3;
// This source has sent too many forget-number requests lately. Checked before
// anything else, so it says nothing about the request, and nothing changed. Try again later.
RATE_LIMITED = 4;
}
}
service RelayForgetNumberService {
// Forget everything this relay keeps for a number whose holder has deleted its registration.
rpc forgetNumber(ForgetNumberRequest) returns (ForgetNumberResponse);
}