True when a collector signing key is registered, so the public key can be served signed.
StaticInstanceAuthenticates an MJDiag-Ed25519 signed request whose body is already read.
Counts one authenticated request for callerKey. Returns false when over the per-sender limit.
Layers 2, 3, & 4:
senderKeyId equal to the authenticated key)Optionalsender: SenderIdentitySets intake options. contextUser with provider (or the default provider) lets the intake
read sender registrations and save received bundle rows. maxRecordsInMemory (default 200)
caps the records kept in memory; maxOpenIntakesPerSender (default 5) caps the Receiving
records of one install. The four limit options must be positive integers, otherwise it throws.
The declared encrypted size of a record, or undefined for an unknown reference ID.
Enrols a sender with a registration code. Refused when there is no data context or signing key.
The Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared because it is possible that a given class might have copies of its code in multiple paths in a deployed application. This approach ensures that no matter how many code copies might exist, there is only one instance of the object in question by using the Global Object Store.
Creates an intake record. With sender (an authenticated HTTP request) the record is bound to
that (installId, keyId) and a body naming another install is refused. Without sender the
call is an in-process submission (local loopback). Throws on invalid input, and throws
IntakeCapacityError when the install has too many open intakes or the map is full of open ones.
Optionalsender: SenderIdentityTrue when ip has used its budget of failed attempts in this window.
Counts one failed attempt (bad header, unknown install, failed signature check, failed enrolment) for ip.
OptionalsignatureBase64: stringRegisters a sender's Ed25519 public key in memory (no database row), for a self-hosted hub,
the local loopback or tests. maxBundlesPerDay 0 means no daily limit.
Registers the collector's Ed25519 signing key. It signs the recipient public key in
GetPublicKeyDescriptor, and enrolment returns its public key so senders can pin it.
Holds one daily-quota slot for the sender before the bundle count is read, so concurrent creates in this process cannot all pass the check. Open records without a bundle row and other held slots count as used. Returns null (and holds nothing) when the quota is used up. The caller releases the slot once the intake record exists or the request has failed. Creates on other collector processes are not counted.
Parses the Authorization header and finds the sender's registration, before any body is read. An install found unknown is refused without a lookup for the next 60 s.
True when the sender has not used up its MaxBundlesPerDay. Open records of the sender that
have no bundle row yet count as used, except the record referenceId.
OptionalreferenceId: stringRemoves Receiving records whose upload window has passed, and rejects and removes
Quarantined records past their complete deadline (quarantine object deleted, row marked
Failed). A record whose complete is running is skipped. The records leave the map at once.
Layer 1 & Quarantine Staging:
Inspects the MJDB envelope header in <1ms before accepting the payload into Quarantine storage.
sender must be the sender the record is bound to.
Optionalsender: SenderIdentityVerifies a resolved sender's signature over the request once the body is read.
Protected StaticgetReturns the singleton instance of the class. If the instance does not exist, it is created and stored in the Global Object Store. If className is provided it will be used as part of the key in the Global Object Store, otherwise the actual class name will be used. NOTE: the class name used by default is the lowest level of the object hierarchy, so if you have a class that extends another class, the lowest level class name will be used.
OptionalclassName: string
Generic, abstract base class for any scenario where we want to use a Singleton pattern. This base class abstracts away the complexity of ensuring a truly global singleton instance across multiple code paths in a deployed application. It uses a Global Object Store to ensure that only one instance of the class exists in the application even if the class has code imported into multiple execution paths (which is not optimal, of course, but can occur in some situations).