You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature flags evaluated outside the context of a request don't populate EvaluationContext correctly.
An example of where this bug happens is here, which is the code path executed during the evaluation of a profile rule. That code path goes on running this line which eventually runs jwt.GetUserSubjectFromContext(ctx) which leads to empty string being returned as targetingKey (here).
This is an example stack trace that leads to error openfeature: TARGETING_KEY_MISSING: no targetingKey provided in the evaluation context
0 0x0000000105e54b80 in github.com/stacklok/minder/internal/auth.GetUserSubjectFromContext
at ./internal/auth/jwtauth.go:119
1 0x000000010602c098 in github.com/stacklok/minder/internal/flags.fromContext
at ./internal/flags/flags.go:42
2 0x000000010602c2c4 in github.com/stacklok/minder/internal/flags.Bool
at ./internal/flags/flags.go:52
3 0x00000001065fb414 in github.com/stacklok/minder/internal/engine.(*Executor).createOrUpdateEvalStatus
at ./internal/engine/eval_status.go:204
4 0x00000001065fd8d0 in github.com/stacklok/minder/internal/engine.(*Executor).evalEntityEvent.func1.1
at ./internal/engine/executor.go:226
5 0x000000010608ddc4 in github.com/stacklok/minder/internal/profiles.TraverseRules
at ./internal/profiles/util.go:165
6 0x00000001065fd32c in github.com/stacklok/minder/internal/engine.(*Executor).evalEntityEvent.func1
at ./internal/engine/executor.go:203
7 0x00000001065fdeec in github.com/stacklok/minder/internal/engine.(*Executor).forProjectsInHierarchy
at ./internal/engine/executor.go:266
8 0x00000001065fce24 in github.com/stacklok/minder/internal/engine.(*Executor).evalEntityEvent
at ./internal/engine/executor.go:194
9 0x00000001065fc670 in github.com/stacklok/minder/internal/engine.(*Executor).HandleEntityEvent.func1
at ./internal/engine/executor.go:142
blkt
changed the title
EvaluationContext missing when feature flags evaluated outside the context of a request
Feature flags not working when evaluated outside the context of a request
Jul 3, 2024
Describe the issue
Feature flags evaluated outside the context of a request don't populate
EvaluationContext
correctly.An example of where this bug happens is here, which is the code path executed during the evaluation of a profile rule. That code path goes on running this line which eventually runs
jwt.GetUserSubjectFromContext(ctx)
which leads to empty string being returned astargetingKey
(here).This is an example stack trace that leads to error
openfeature: TARGETING_KEY_MISSING: no targetingKey provided in the evaluation context
To Reproduce
flags-config.yaml
psql minder
)select * from evaluation_statuses
What version are you using?
minder-0.20240703.2465_ref.924bd1a
The text was updated successfully, but these errors were encountered: