-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(flags): return real feature flag evaluation for basic matching with new endpoint #24358
Conversation
@@ -98,7 +127,7 @@ impl IntoResponse for FlagError { | |||
(StatusCode::BAD_REQUEST, "The distinct_id field is missing from the request. Please include a valid identifier.".to_string()) | |||
} | |||
FlagError::NoTokenError => { | |||
(StatusCode::UNAUTHORIZED, "No API key provided. Please include a valid API key in your request.".to_string()) | |||
(StatusCode::UNAUTHORIZED, "No API token provided. Please include a valid API token in your request.".to_string()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if we should call it a key or a token, lol. We'll pick one on which to standardize.
@@ -8,10 +8,10 @@ pub struct Config { | |||
#[envconfig(default = "127.0.0.1:3001")] | |||
pub address: SocketAddr, | |||
|
|||
#[envconfig(default = "postgres://posthog:posthog@localhost:5432/test_posthog")] | |||
#[envconfig(default = "postgres://posthog:posthog@localhost:5432/posthog")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
real app uses real DB!
…osthog into feat/make-rust-decide-curlable
Looking great as far as my Rust knowledge goes :D Didn't run it, don't have Rust installed yet. Do we have a standard way to do this? Worth updating the docs too: https://posthog.com/handbook/engineering/developing-locally |
Yeah, the feature flag module readme has some instructions: https://github.com/PostHog/posthog/blob/feat/make-rust-decide-curlable/rust/feature-flags/README.md#L2-L53. But I was going to update the |
The new Rust
/flags
endpoint now works end-to-end locally! With this change, you can now do the following:RUST_LOG=debug cargo run --bin feature-flags
/decide
-looking requests, e.g.Doesn't support gzip or any compression yet. Supports both Redis and Postgres for returning flag and team definitions. Only supports a subset of matching logic.