You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add name-based source flags to remove-route-policy
Extract source resolution flags (--source-app, --source-space, --source-org,
--source-any, --source) into a shared RoutePolicySourceFlags struct embedded
in both add-route-policy and remove-route-policy commands.
Previously remove-route-policy only accepted --source with a raw GUID-format
value (cf:app:<guid>, etc.), while add-route-policy supported name-based
resolution. The two commands now have matching flag sets.
Hostnamestring`long:"hostname" required:"true" description:"Hostname for the route"`
17
14
Pathstring`long:"path" description:"Path for the route"`
18
-
19
-
// Source resolution flags (mutually exclusive as primary source)
20
-
SourceAppstring`long:"source-app" description:"Allow access from this app (by name)"`
21
-
SourceSpacestring`long:"source-space" description:"Allow access from all apps in this space (by name) or specify the space for --source-app"`
22
-
SourceOrgstring`long:"source-org" description:"Allow access from all apps in this org (by name) or specify the org for --source-space/--source-app"`
23
-
SourceAnybool`long:"source-any" description:"Allow access from any authenticated app"`
24
-
25
-
// Advanced: raw source flag
26
-
Sourcestring`long:"source" description:"Raw source (cf:app:<guid>, cf:space:<guid>, cf:org:<guid>, or cf:any)"`
15
+
RoutePolicySourceFlags
27
16
28
17
usageinterface{} `usage:"CF_NAME add-route-policy DOMAIN --hostname HOSTNAME [--source-app APP_NAME [--source-space SPACE_NAME] [--source-org ORG_NAME] | --source-space SPACE_NAME [--source-org ORG_NAME] | --source-org ORG_NAME | --source-any | --source SOURCE] [--path PATH]\n\nALLOW ACCESS TO A ROUTE:\n Create a route policy that allows specific apps, spaces, or orgs to access a route using mTLS authentication.\n\nEXAMPLES:\n # Allow the \"frontend-app\" (in current space) to access the backend route\n cf add-route-policy apps.identity --source-app frontend-app --hostname backend\n\n # Allow an app in a different space to access the route\n cf add-route-policy apps.identity --source-app api-client --source-space other-space --hostname backend\n\n # Allow an app in a different org to access the route\n cf add-route-policy apps.identity --source-app external-client --source-space external-space --source-org external-org --hostname backend\n\n # Allow all apps in the \"monitoring\" space to access the API metrics endpoint\n cf add-route-policy apps.identity --source-space monitoring --hostname api --path /metrics\n\n # Allow all apps in a space in a different org\n cf add-route-policy apps.identity --source-space prod-space --source-org prod-org --hostname api\n\n # Allow all apps in the \"platform\" org to access the route\n cf add-route-policy apps.identity --source-org platform --hostname shared-api\n\n # Allow any authenticated app to access the public API\n cf add-route-policy apps.identity --source-any --hostname public-api\n\n # Use raw source (advanced)\n cf add-route-policy apps.identity --source cf:app:d76446a1-f429-4444-8797-be2f78b75b08 --hostname backend"`
Sourcestring`long:"source" required:"true" description:"Source to identify the route policy (cf:app:<guid>, cf:space:<guid>, cf:org:<guid>, or cf:any)"`
12
-
Hostnamestring`long:"hostname" required:"true" description:"Hostname for the route"`
13
-
Pathstring`long:"path" description:"Path for the route"`
14
-
Forcebool`short:"f" description:"Force deletion without confirmation"`
0 commit comments