Commit graph

525 commits

Author SHA1 Message Date
Zach Daniel
1ab4b6e69a improvement: support atomics on upserts 2023-10-11 15:09:06 -04:00
Zach Daniel
3782f1cfe2 fix: honor authorize? option for calls to aggregate 2023-10-10 11:10:58 -04:00
Zach Daniel
fbe6b21bf0 improvement: support to-one reference paths in calculations 2023-10-09 18:50:15 -04:00
Zach Daniel
06d152c415 chore: remove IO.inspect 2023-10-07 17:08:12 -04:00
Zach Daniel
32620dfd52 improvement: add Ash.Sort.expr_sort. In 3.0 sort should be a macro 2023-10-07 09:16:52 -04:00
Zach Daniel
04c9249f24 fix: properly perform field authorization on loaded through types 2023-09-28 10:23:16 -04:00
Barnabas Jovanovics
4fb6da6eee
test: update test to load forbidden field through union (#713) 2023-09-28 08:36:37 -04:00
Zach Daniel
a00806eeb0 fix: static checks with conditions could be overly or insufficiently restrictive 2023-09-27 14:40:40 -04:00
Barnabas Jovanovics
a1ad5d5476
add test showing the problem with expressions in field_policy conditions (#710) 2023-09-27 18:58:25 +02:00
Barnabas Jovanovics
9e16109950
feat: expose query or changeset to field policies (#701) 2023-09-25 11:13:36 -04:00
Zach Daniel
93fc4a35b2 improvement: rework utc_datetime to datetime
the old types are now newtypes over the new type

fixes: #704
2023-09-25 11:11:56 -04:00
Zach Daniel
2d9f9ee362 improvement: deprecate old school manual actions
note: these have been deprecated for a very long time, removing them will not
be considered a breaking change (and there will be clear compile errors)
2023-09-25 09:40:29 -04:00
Zach Daniel
b7b2f586a1 chore: format test 2023-09-22 17:05:07 -04:00
Zach Daniel
b13c7f0e53 improvement: add Ash.Query.around_transaction/2 2023-09-22 16:46:43 -04:00
Zach Daniel
1d43b26127 chore: move validate_relationship_attributes to a verifier 2023-09-20 16:51:38 -04:00
Zach Daniel
b0bd2d23d9 improvement: support map_with_tag storage mode for Ash.Union.
closes #694
2023-09-18 10:13:22 -04:00
Zach Daniel
9102966d05 test: update tests to account for no authorizers == authorized 2023-09-18 10:09:27 -04:00
Zach Daniel
91013c2de0 improvement: support stacktraces in set_error 2023-09-12 11:26:11 -04:00
James Harton
5f6920ef92
improvement: Allow resources to opt out of the primary key requirement. (#687)
This is experimental and will likely cause breakages. It's to support time series tables.
2023-09-06 10:21:42 +12:00
Zach Daniel
567dcf6372 fix: better handling for negate error messages 2023-09-04 16:01:48 -04:00
Zach Daniel
69623a1efe chore: cleanups for new mix task 2023-09-04 01:23:57 -04:00
Barnabas Jovanovics
b661022736
fix: sort operator names in keyset (#684) 2023-09-01 06:53:01 -04:00
Zach Daniel
c5ea541b2d chore: rework atomics to atomic_update change and function
improvement: add `Ash.context_to_opts/1-2`
2023-08-29 14:39:38 -04:00
Zach Daniel
18cb24e7f7
improvement: implement atomics, expression-based changes (#682)
there is still a lot of potential work that needs to be on this front.
1. supporting atomics on create actions.
2. supporting atomics in upserts (this one may actually be much easier than the first one, for postgres specifically, due to ecto implementation details)
3. discovering places atomics can be more nicely integrated into existing changes, validations, policies
2023-08-28 16:05:26 -04:00
Zach Daniel
7d5fd04e5c fix: ensure that errors/records return the proper value in bulk creates
closes #681
2023-08-25 08:59:24 -04:00
James Harton
269889c34b
fix(Ash.Filter): Don't overly constrain related references. (#678)
We now only apply related policies to filter statements based on references
that are explicitly annotated as inputs.  This is the same logic that backs
protecting access in filters for field policies.
2023-08-21 19:39:07 -04:00
Tchowa Franck A
7e47bfb60f
improvement: validate all actions and accept/reject fields at once. (#674) 2023-08-18 20:47:35 -04:00
Tchowa Franck A
f302dca003
Feature: Ensure aggregate field is attribute or calculation. (#671) 2023-08-17 18:02:05 -04:00
Zach Daniel
b51dbe49c9 improvement: storage_type/0 -> storage_type/1 2023-08-17 17:52:00 -04:00
Zach Daniel
8233634bb1 improvement: properly set path into error instead of on error messages
TBD: this may break some people's tests, and so may need to be
reverted or released as part of 3.0
2023-08-15 16:23:06 -07:00
Zach Daniel
8c1f334075 improvement: expose union errors with path when tag is set 2023-08-15 14:07:28 -07:00
Barnabas Jovanovics
f85bc95ff5
chore: release version v2.14.0 (#669) 2023-08-09 19:43:55 +02:00
Zach Daniel
7ae9244d01 fix: don't optimized in/== predicates across incorrect boolean expressions 2023-08-08 12:17:07 -07:00
Zach Daniel
6daae630f4 fix: various fixes with runtime evaluation of aggregates
fix: handle mnesia transaction errors properly
2023-08-06 00:41:29 -04:00
Zach Daniel
cf99929230 improvement: initialize change opts in bulk actions
fix: better error message in `validate_related_resource_inclusion`
test: add test for arguments in bulk create actions
2023-08-02 12:41:54 -04:00
Zach Daniel
bda7c56543 improvement: support parent/1 in relationships 2023-07-26 16:46:22 -04:00
Zach Daniel
da73502a2f fix: before/after batch callbacks are no longer broken
test: add tests for those callbacks being executed
2023-07-22 19:51:27 -04:00
Zach Daniel
e5563ce664 fix: Keyword.fetch on keywords, fix test name 2023-07-19 11:18:20 -04:00
Zach Daniel
7f3ec1b8bf improvement: support distinct_sort 2023-07-19 11:06:01 -04:00
Zach Daniel
3c42062861 fix: allow the query & related fields to be read before authorization status is complete 2023-07-18 15:23:27 -04:00
Mariusz Morawski
e356691765
test: Add test that covers issue 652 (#657) 2023-07-18 14:48:26 -04:00
Zach Daniel
5b2efe5e5c improvement: support distincting on calculations
improvement: support distinct in ets data layer for testing
2023-07-18 14:35:25 -04:00
Zach Daniel
c0d8a86987 improvement: support resources directly in API modules
improvement: compile time warning on resources not detected in any apis
2023-07-13 01:38:21 -04:00
Zach Daniel
7114b5efbb improvement: exists type aggregate 2023-07-13 00:08:51 -04:00
Zach Daniel
2634d3d830 improvement: add at/2 function 2023-07-12 16:53:43 -04:00
Zach Daniel
d27e871b8f improvement: add string_split expression 2023-07-12 15:11:21 -04:00
skanderm
925f5c1f9a
fix: incorrect error for casting binary UUID (#653) 2023-07-11 20:35:01 -04:00
Zach Daniel
8e12a14b25 improvement: add field_policy_bypass
fix: fix and improve policy breakdown logs
improvement: optimize field selection/loading when possible
2023-07-11 10:28:07 -04:00
Barnabas Jovanovics
c442d83534
test: add test for aggregate field policy (#644) 2023-07-10 09:00:55 -04:00
Zach Daniel
be75743b13 fix: properly detect selected attributes for changeset field policies 2023-07-06 10:58:09 -04:00