aws / aws/aws-durable-execution-sdk-java

[Feature]: Cross context operation access check

Offen
#298 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Java
Sterne
28
Forks
11
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
47

Beschreibung

### What would you like?

Add a check to ensure an operation is accessed (calling `.get`) only in the context where it's created.

This would disallow the access to an operation in
- its grandparent context
- its sibling context
- etc

There is an exception - `parallel` operation, in which the branches are always used in its grandparent context.

This check currently exists in TypeScript SDK but not implemented in Java SDK

### Possible Implementation

It's straightforward. The context id of the current thread is in thread local object. We can check that with the operation's context id.

### Is this a breaking change?

#### Yes

### Does this require an RFC?

No

### Additional Context

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, die vorhandene Prüfung des kontextübergreifenden Zugriffs im TypeScript SDK zu finden, verfolge dann den Java-`.get`-Pfad und die threadlokale ID des aktuellen Kontexts. Implementiere gleichwertige Prüfungen für übergeordnete, gleichgeordnete und andere Kontexte, wobei die angegebene `parallel`-Ausnahme erhalten bleibt, und verifiziere, dass weiterhin gültiger Zugriff innerhalb desselben Kontexts funktioniert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, typescript
Bereich
backend-api-design
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.