Repository navigation
Platform-only deploy/delete require app-engine:apps:run just to discover an unused classic URL #2208
sergiohinojosa
started this conversation in
Ideas
Replies: 1 comment
|
Hi @sergiohinojosa, thank you for the suggestion! At first glance, this looks like a very sensible change, avoiding the classic environment completely where it is not needed (or available). I'll check it with the team and get back to you! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
With platform credentials only (a platform token or OAuth, no
accessToken), everydeploy,delete,purgeanddownloadfirst callsGET /platform/metadata/v1/classic-environment-domain. That call needsapp-engine:apps:run. The classic URL it returns is only used to build the classic (access-token) client, which a platform-only manifest never creates.So a platform token scoped to exactly what the project deploys (documents and settings) is refused before any work starts:
Why this matters
app-engine:apps:runis not a configuration permission. It lets the bearer call the backend functions of every app installed in the environment. We hand Monaco to learners in hands-on trainings, on a short-lived platform token scoped to documents and settings. Addingapp-engine:apps:runto that token would let a learner call other apps' functions as the token's principal, just so Monaco can look up a URL it then does not use.Where (v2.30.1)
pkg/client/clientset.go:340:CreateClientSetWithOptionscallsmetadata.GetDynatraceClassicURLwhenever platform credentials are given. The result is only consumed by theif auth.AccessToken != nilblock that follows.cmd/monaco/dynatrace/dynatrace.go:69:VerifyEnvironmentAuthenticationresolves the classic URL the same way before deploy. (MONACO_FEAT_SIMPLE_CLASSIC_URLhelps here, but not atclientset.go:340, which has no flag.)Proposed change
Discover the classic URL only when it is needed, i.e. when an access token is configured:
go test ./pkg/client/passes. Side effect: a platform-only run no longer does the up-front auth probe, so a bad token fails on its first real API call, which already reports the error.Tested on a gen3 environment with a platform token holding only document, settings and DQL read scopes (no
app-engine:apps:run):deploycreates a dashboard document plus a settings object, anddeleteremoves both, twice in a row.(Fully cleaning up a deleted document also needs
document:trash.documents:delete, which is expected.)We are happy to open a PR with tests if this direction is acceptable. Would you prefer this guard, or an explicit manifest/env option for the classic URL?
All reactions