Comments (7)
Thanks for taking this on and for the PR @amayvs ! I agree I think JSON would be better than storing binary.
Yes for the UI I was thinking we would have a textarea that is optional, and perhaps verify that it is proper JSON before submitting. We'd likely want to do that validation on the server side as well before accepting the JSON and perhaps put a limit to the number of bytes that can be stored?
from flipt.
@kevin-ip honestly I think we can just hardcode the max of the attachment
field to be 10kb
or something similar. Then if we get a request to make it configurable we could do so later.
10kb of json is quite a lot for a single field I think
I was thinking something like this which I guess does make sense to be in the variant validator
const MAX_VARIANT_ATTACHMENT_SIZE = 10000
bytes, err := json.Marshal(req.Attachment)
if err != nil { ... }
if len(bytes) > MAX_VARIANT_ATTACHMENT_SIZE {
return errs.InvalidFieldError("attachment", "max json payload size is 10kb")
}
or something similar?
That way we don't have to modify the validator itself to pass in the context or add a new config property
from flipt.
reference: https://checkr.github.io/flagr/#/flagr_use_cases?id=dynamic-configuration
from flipt.
@4n70w4 thanks for the feature request. I think I can see the value in this, wondering if you think this attachment field should support strictly JSON or any value (like a blob).
Reason being, I don't want to get into validating user input as JSON, but perhaps I dont need to. Whatever the user saves as the value could be returned as an attachment.
What are your thoughts?
from flipt.
@markphelps yes you're right, may be do payload in any format.
from flipt.
Hi @markphelps, we are currently working on this feature and wanted to get some input about how the field should be represented in the UI.
As per the comments above, we've implemented attachment
field as a bytearray
, do we expect the UI to have a simple textarea
where user can copy/paste data or does it need to do any encoding/decoding?
But we feel that the field would be better served as JSON
, and if binary attachment is required, it can be base64
encoded and included to the JSON
structure.
Additionally, if you have other general thoughts about this feature then do let us know. Thanks.
Draft PR: #685
from flipt.
Hi @markphelps, What would you recommend the default limit to the number of bytes?
I am planning to add a new config, DataConfig
(default with 1024 KB), and updating the Validator.Validate()
to take a context.Context
. The ValidationUnaryInterceptor
will set the ctx
with dataConfig
before invoking Validator.Validate(...)
. The method will then get the config from the context and compare against the length of the attachment
. WDYT?
from flipt.
Related Issues (20)
- [FLI-590] Clickhouse for Audit Events
- Single evaluation endpoint for variant and boolean types HOT 4
- [FLI-734] Proposal(Auth): Support JWTs HOT 1
- [FLI-736] [Bug]: default config outputs first INFO log regardless of `FLIPT_LOG_LEVEL`
- [FLI-738] Validate authentication configs at start
- [FLI-746] Show time/date format on settings/preferences page
- Button color update for more contrast from disabled state HOT 2
- Empty autocomplete dropdown menus only populate the dropdown menu if you click on the up/down arrows. HOT 2
- Namespace input validation not updating button until clicking outside of input HOT 1
- [FLI-748] Auth(OIDC/OAuth): Support AuthStyle config HOT 3
- [FLI-749] OpenFeature Node SDK HOT 2
- Adding a security policy to the projects HOT 1
- Allow Flipt Dockerfile to use 80 and 443 HOT 8
- [FLI-751] Proposal: (UI) Onboarding Screen HOT 3
- [FLI-759] [Bug]: config init does not work correctly
- Make the project buildable using nix (help needed) HOT 2
- [FLI-788] Docs: Clearer example for securing management backend HOT 3
- OpenTelemetry-Go Jaeger Exporter dropped by July 2023
- [FLI-767] ClickHouse Integration for Flag Eval Analytics HOT 3
- [FLI-780] Show configured Git ref in UI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flipt.