OFREP Single flag evaluation (Core API)

Aperta
#8,435 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
openapi, python
Ambito
api, backend

Direzione di ricerca

Inizia individuando la valutazione esistente degli identity flag e gli altri endpoint fatturati nella Core API, quindi confronta il loro comportamento relativo a richieste, persistenza e fatturazione con la specifica OFREP evaluateFlag. Verifica il fallback del valore del nuovo endpoint, il vocabolario dei motivi, la risposta 404, la persistenza degli attributi dell’identità e il comportamento di fatturazione rispetto ai criteri di accettazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

In order to implement the OFREP specification, our Core API needs a new endpoint that evaluates a single flag given a set of identity traits. The Edge API counterpart is Flagsmith/edge-api#712.

An interpretation of the specification to our data model is as the following example:

(request)

POST /ofrep/v1/evaluate/flags/{feature.name} HTTP/1.1
Host: {flagsmith_host}
X-API-Key: {server_side_environment_key}
Content-Type: application/json

{
  "context": {
    "targetingKey": "{identity.identifier}",
    "trait1": "value1",
    "trait2": "value2"
  }
}

(response)

HTTP/1.1 200 OK
Content-Type: application/json

{
  "key": "{feature.name}",
  "value": "{multivariate_feature_option.value}",
  "reason": "SPLIT",
  "variant": "{multivariate_feature_option.key}"
}

(response, unknown flag)

HTTP/1.1 404 Not Found
Content-Type: application/json

{
  "key": "{feature.name}",
  "errorCode": "FLAG_NOT_FOUND"
}

Acceptance criteria

  • Our API exposes a new endpoint POST /ofrep/v1/evaluate/flags/{flagKey} compliant to the OFREP specification. As such, the endpoint:
    • Serves the flag's value as its remote configuration value, falling back to the flag's enabled state when no value is set.
    • Reports the flag's evaluation reason using the vocabulary OFREP defines.
    • Responds 404 Not Found when the environment has no such flag.
    • Is billed similarly to other billed endpoints.
    • Persists the identity and its traits on the same terms as identity flag evaluation.
Lingua principale
Python
Stelle
7.1k
Fork
603
Merge medio
3g 8h
PR unite (30g)
102

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Flagsmith/flagsmith

Tutte le issue di Flagsmith/flagsmith

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.