Modifying the argument clashes with AshCloak changing the argument's type
Hello! I have a resource
Platform
with an attribute called credentials
I want to have encrypted. This attribute is a union of embedded resources (representing credentials for different platforms).
I have a change that sets the type
attribute on the credentials union changeset to the same value as the platform.type
is set - to avoid having to pass the same value twice and ensure the credentials type matches the platform type.
After adding the AshCloak encryption, it replaces my argument :credentials, :map
with its own argument typed as a union.This causes my change to fail, because:
1. AshCloak's argument expects a properly-typed union value
2. My change can't set the type before Ash attempts to cast the argument
3. Without the type field, Ash considers the argument invalid when casting to the union
How can I either apply my change before AshCloak's union casting, or configure AshCloak to somehow work with my existing argument definition?
I was thinking of renaming my argument to credentials_input
an setting the value of AshCloaks credentials
argument inside the change - but I feel this duplicates the logic and the action now accepts two arguments for credentials which might be confusing.
0 Replies