Allow users to signal whether extensions are required
@jskeet ci sta già lavorando.
Dal 8/5/2025.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Use case: From a producer-perspective, I want to avoid poison messages being produced due to missing attributes that are required in the system (either by intermediaries or consumers). This should be handled as a cross-cutting concern, to avoid gaps.
Currently, the SDK allows extensions to be created, and it allows users to provide a validator to execute.
The validator method can be used to ensure the type, structure, or even combination of extensions that should be set, providing full validation of the extension. However, it doesn't allow users to indicate that it is a required extension.
Taking the example of a tenant attribute that is required within the system's boundaries, I could register the attribute as follows:
var tenantIdAttribute =
CloudEventAttribute.CreateExtension("tenant", CloudEventAttributeType.String, tenantValue =>
{
if (tenantValue is not string tenant) throw new ArgumentException("tenant attribute must be of type string");
if (string.IsNullOrWhiteSpace(tenant))
throw new ArgumentException("tenant attribute must not be null, empty or whitespace");
});
However, the validation only runs if the attribute is actually set, but from a user's perspective, the ability to indicate this as a required extension is equally important. Currently, the SDK allows me to tackle extension validation as a cross-cutting concern by providing a validation method to the SDK, however, it currently neglects what may be most essential to many users, verifying that the attribute is actually there.
- Lingua principale
- C#
- Stelle
- 334
- Fork
- 88
- Merge medio
- 6m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudevents/sdk-csharp
-
Include specversion in CloudEvent.GetPopulatedAttributesForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
cloudevents/sdk-csharp#373 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
cloudevents/sdk-csharp#324 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
cloudevents/sdk-csharp#310 · 6 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
cloudevents/sdk-csharp#308 · 5 commenti · 1 reazione ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
cloudevents/sdk-csharp#292 · 2 commenti · 1 reazione ·
Tutte le issue di cloudevents/sdk-csharp
Issue simili
-
Python: Bug: split_plaintext_paragraph / split_markdown_paragraph can return a chunk larger than max_tokensForse già presa @xThreeh l’ha presa oggi. Apertapython triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/semantic-kernel#14566 ·
I maintainer di solito rispondono entro 4 giorni
-
triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
rjmurillo/moq.analyzers#1384 ·
-
Variables passed to Compensated are not set on the routing slipForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
MassTransit/MassTransit#6249 ·
-
security
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Sendspin/sendspin-dotnet#339 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
owasp-dep-scan/dosai#79 ·
I maintainer di solito rispondono entro 1 giorno