script
I am working on a query library, which provides ease of making complex queries. I added a feature to blacklist some fields like passwords or other similar fields, which can not be accessed. It’s working in case of select, group_by, join. It returns an error if the user is trying to query a field that is blacklisted.
The problem is with where and preload. It returns an error if we try to query a blacklisted field with where but returns the record with all the blacklisted fields if we query some other non-blacklisted field. similar is the case with preload. It returns the complete record with all the blacklisted fields included.
It’s an open-source library so removing blacklisted fields from the Jason encoder is not an option.
Can you please suggest any solutions.
Thanks.
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 1- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
0x6a68
If i understand your question correctly you will need something like elixir did in the release of version 1.8. Elixir v1.8 released - The Elixir programming language (Custom struct inspections)
You will need to write for each struct a derive with a custom protocol see: Protocol — Elixir v1.20.2