Class DatabentoAuthenticationException
- Namespace
- DatabentoDotNet.Live
- Assembly
- DatabentoDotNet.Live.dll
The live gateway rejected the client's credentials: its authentication response did not carry
success=1.
public sealed class DatabentoAuthenticationException : LiveException, ISerializable
- Inheritance
-
DatabentoAuthenticationException
- Implements
- Inherited Members
Remarks
Port of upstream's Error::Auth(String) (error.rs), raised from
AuthResponse::parse when the response is missing success or carries anything but
1. Upstream's message is the error= field when there is one and the whole
response line when there is not; both are kept here, but as separate properties rather than
collapsed into one string, so a caller can branch on Error without parsing a
message.
This means the credentials were refused, not that the exchange went wrong. A gateway that answers with something that is not an authentication response at all raises LiveProtocolException instead. Telling a caller their API key was rejected when the real fault was a malformed challenge would send them to rotate a key that was never the problem.
The API key is never in the message. Only ToString()'s redacted form appears — enough to say which key a process with several was refused on, and not enough to be one.
Constructors
DatabentoAuthenticationException()
Creates the exception with no message.
public DatabentoAuthenticationException()
DatabentoAuthenticationException(string)
Creates the exception with a message.
public DatabentoAuthenticationException(string message)
Parameters
messagestringThe message. Must not contain the API key.
DatabentoAuthenticationException(string, Exception)
Creates the exception with a message and an underlying cause.
public DatabentoAuthenticationException(string message, Exception innerException)
Parameters
messagestringThe message. Must not contain the API key.
innerExceptionExceptionThe underlying cause.
Properties
Error
The gateway's error= text, or null when it rejected the request
without giving a reason.
public string? Error { get; init; }
Property Value
Response
The gateway's authentication response, verbatim and without its terminator.
public string? Response { get; init; }
Property Value
Remarks
The gateway echoes the client's auth= field back on a malformed reply, so
this is not simply "text the gateway wrote". Asking the real gateway for a reply whose
bucket suffix was sliced from the wrong end of the key came back as
CRAM reply string malformed, was '<digest>-<the bucket that was sent>'.
In correct operation what travels in that field is the digest and the bucket id, and the
bucket id is safe to log by design — but the safety comes from what the client puts on the
wire, not from the gateway declining to repeat it. Anything that ever widens the auth
field has to be weighed against this property carrying it straight into a log.