Table of Contents

Namespace Codebelt.SharedKernel

Assembly: Codebelt.SharedKernel.dll

When domain code needs to talk about moments in time, traced requests, or immutable identifiers, raw TimeSpan and string values quickly lose meaning and bypass the validation your model actually relies on. The Codebelt.SharedKernel namespace solves that by replacing those primitives with strongly-typed value objects that enforce their own invariants: a Token is never whitespace, a CorrelationId is never a single repeated character, and a CoordinatedUniversalTime is never anything but UTC.

If you are issuing a token and need to express how long it remains valid, reach for TimeToLive and pass it to your issuer. If two systems must agree on what "now" means within a bounded margin, reach for ClockSkew. If you need an absolute timestamp, use CoordinatedUniversalTime. For traced request identifiers and opaque credentials, start with CorrelationId and Secret; both extend Token and inherit its minimum length, maximum length, and character-distribution checks.

Availability: .NET 10 and .NET 9

Classes

ClockSkew

Represents a ClockSkew object that can be used to warrant for clock skew related scenarios such as authentication.

ComparableValueObject<T>

Provides an implementation of SingleValueObject<T> tailored for handling a single value that implements the IComparable<T> interface.

CoordinatedUniversalTime

Represents a CoordinatedUniversalTime (UTC) object that can be used when you need a timestamp that is based on an absolute time.

CorrelationId

Represents a CorrelationId object that can be used as unique identifier that help you trace requests across multiple services in a distributed system.

TimeToLive

Represents a TimeToLive (TTL) object that can be used when issuing authentication tokens or similar.

Token

Represents a Token object that encapsulates an immutable value used for identification or access control.

TokenOptions

Configuration options for Token.