JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

Compatibility with JSONAPI::Authorization (Resource Caching)

Offen
#1,177 1 Kommentar 9 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Ruby
Sterne
2.3k
Forks
546
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

This issue is a (choose one):

  • Feature request.

Checklist before submitting:

  • I've searched for an existing issue.
  • The feature I'm asking for is compliant with the JSON:API spec.

Description

JSONAPI::Authorization is a pundit based authorization tool that works out-of-the-box with jsonapi-resources' ActiveRecord backed resources.
The problem is with Cached Resource as it does not have a model key.

JSONAPI::Authorization's related issue https://github.com/venuu/jsonapi-authorization/issues/67

Features:

Exposing the original model into cache in CachedResourceFramgment(https://github.com/cerebris/jsonapi-resources/blob/master/lib/jsonapi/cached_response_fragment.rb#L87) would solve the problem easily – not sure about the cons.

I have a working solution in my fork so I can submit a PR If you are OK with the idea.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne bei lib/jsonapi/cached_response_fragment.rb etwa bei Zeile 87 und prüfe, wie Cached Resource die Ressource derzeit darstellt. Sieh dir das verlinkte JSONAPI::Authorization-Issue und die gemeldete Fork-Lösung an und bestimme dann, ob das Offenlegen des ursprünglichen Modells den fehlenden Modellschlüssel ohne nachteilige Auswirkungen behebt. Als abgeschlossen gilt die Aufgabe, wenn Cached Resource mit dem Ressourcen-Caching von JSONAPI::Authorization funktioniert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
ruby
Bereich
api, backend
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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