Skip to main content

RtSecretValueWireFormat

Namespace: Meshmakers.Octo.Runtime.Contracts.Serialization

The one wire contract of an RtSecretValue in every serialisation (AB#5532, AB#5534).

public static class RtSecretValueWireFormat

Inheritance Object → RtSecretValueWireFormat

Remarks:

Write: only the marker {"isSet":true|false} - never the envelope, never a plaintext.

Read: a string is new input (RtSecretValue.Pending(String), not trimmed); null stays null (clears the secret); the marker is Pending("") ("unchanged"). The marker is an object whose properties are a subset of the read state { isSet, keyMissing, setAt } (names case-insensitive): isSet and keyMissing booleans, setAt an ISO-8601 date string or null - so a client echoing the state object it read (OctoSecretState) leaves the secret unchanged; the empty object is a marker too. Anything else (numbers, booleans, arrays, objects with other properties, a wrongly typed marker property) is rejected with an exception whose message never contains the value (AB#5532 round 2).

The System.Text.Json, Newtonsoft and YAML converters of the engine and the octo-sdk converters all implement exactly this contract through the helpers of this class.

Fields​

IsSetPropertyName​

Name of the marker property.

public static string IsSetPropertyName;

KeyMissingPropertyName​

Name of the optional keyMissing marker property (boolean; accepted on read, never written).

public static string KeyMissingPropertyName;

SetAtPropertyName​

Name of the optional setAt marker property (ISO-8601 date string or null; accepted on read, never written).

public static string SetAtPropertyName;

Methods​

IsSet(RtSecretValue)​

True when the value holds a secret, classified WITHOUT a key ring (SecretValueStates.GetReadState(RtSecretValue, Func<String, Boolean>, Boolean) with null): every protected value, a non-empty pending value (a placeholder-looking input is an ordinary value), and a legacy value that is neither empty, a legacy placeholder nor corrupt.

public static bool IsSet(RtSecretValue value)

Parameters​

value RtSecretValue

Returns​

Boolean

Remarks:

The wire marker is written by serializers that have no key ring, so a protected value whose key id is not in the ring is marked isSet: true here. APIs that report the read state to users (GraphQL isSet / keyMissing, the SDK DTO mapper with a protector) must use ISecretAttributeProtector.GetReadState(RtSecretValue, SecretAccessContext) instead (decisions 2026-10-06, item 2).

IsMarkerProperty(String)​

True when propertyName is a marker property (case-insensitive): isSet, keyMissing or setAt.

public static bool IsMarkerProperty(string propertyName)

Parameters​

propertyName String

Returns​

Boolean

IsValidMarkerText(String, String)​

True when text is a valid textual value of the marker property propertyName (for formats without typed scalars, e.g. YAML): isSet / keyMissing need true / false; setAt needs a date or null (pass null for a null scalar).

public static bool IsValidMarkerText(string propertyName, string text)

Parameters​

propertyName String

text String

Returns​

Boolean

Read(out Utf8JsonReader)​

Reads an RtSecretValue strictly (see remarks of RtSecretValueWireFormat). The reader is positioned on the first token of the value and is left on its last token.

public static RtSecretValue Read(out Utf8JsonReader reader)

Parameters​

reader Utf8JsonReader

Returns​

RtSecretValue

Exceptions​

T:System.Text.Json.JsonException
Any other shape; the message never contains the value.

Write(Utf8JsonWriter, RtSecretValue)​

Writes the marker {"isSet":true|false} of value.

public static void Write(Utf8JsonWriter writer, RtSecretValue value)

Parameters​

writer Utf8JsonWriter

value RtSecretValue

IsMarker(JsonElement)​

True when element is the marker (an object with only the marker properties isSet / keyMissing as booleans and setAt as date string or null; may be empty).

public static bool IsMarker(JsonElement element)

Parameters​

element JsonElement

Returns​

Boolean

Read(JsonReader)​

Reads an RtSecretValue strictly with Newtonsoft (see remarks of RtSecretValueWireFormat). The reader is positioned on the first token of the value and is left on its last token.

public static RtSecretValue Read(JsonReader reader)

Parameters​

reader JsonReader

Returns​

RtSecretValue

Exceptions​

T:Newtonsoft.Json.JsonSerializationException
Any other shape; the message never contains the value.

Write(JsonWriter, RtSecretValue)​

Writes the marker {"isSet":true|false} of value, or null.

public static void Write(JsonWriter writer, RtSecretValue value)

Parameters​

writer JsonWriter

value RtSecretValue

IsMarker(JToken)​

True when token is the marker (an object with only the marker properties isSet / keyMissing as booleans and setAt as date (string) or null; may be empty).

public static bool IsMarker(JToken token)

Parameters​

token JToken

Returns​

Boolean

IsMarkerDictionary(Object)​

True when dictionary is the marker: only the keys isSet / keyMissing with a boolean value (Boolean, a JSON boolean element / token) and setAt with a date (DateTime, DateTimeOffset, a date string or JSON date element / token) or null; may be empty. A non-generic dictionary as YAML produces it (Dictionary<object, object> with string scalars) may also hold the text true / false.

public static bool IsMarkerDictionary(object dictionary)

Parameters​

dictionary Object

Returns​

Boolean