Skip to content

Existence checks for agent and environment references - #108

Open
vitramir wants to merge 2 commits into
mainfrom
app-configuration-schema
Open

vitramir wants to merge 2 commits into
mainfrom
app-configuration-schema

Conversation

@vitramir

Copy link
Copy Markdown
Contributor

Adds ResolveAgentExists and ResolveEnvironmentExists, used by the Apps Service to validate an x-agyn-ref property on an app installation before persisting it. See Apps Service — Reference Validation.

Depends on agynio/api#197.

A dedicated existence check rather than GetAgent, following Secrets.ResolveSecretExists: the caller is another service acting for an admin whose own read permissions on the target are beside the point, and it needs one boolean rather than a record it would then have to be trusted not to leak. Internal only, no OpenFGA check.

The organization is part of the question rather than a second call, so the check and the scoping cannot disagree. A target in another organization answers false exactly as a nonexistent one does — the difference is not something the caller is entitled to learn.

Tests run against AGENTS_TEST_DATABASE_URL; verified locally against a real Postgres.

Another service validating an x-agyn-ref on an app installation needs one
boolean, not a record: the caller acts for an admin whose own read permissions
on the target are beside the point, and a Get would hand it a resource it would
then have to be trusted not to leak.

The organization is part of the question rather than a second call, so the
check and the scoping cannot disagree. A target in another organization answers
false exactly as a nonexistent one does.
The container skipped generation when /opt/app/data/.gen existed, but the sync
creates that directory — so generation never ran, go run failed on missing
packages, and DevSpace restarted the container until the job hit its 60 minute
timeout. The log showed only repeated go downloads and no buf output at all.

A directory existing says nothing about whether the packages inside it are the
ones the source needs, and adding a proto to the list makes any such guard
wrong again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant