Skip to content

feat(aviator): 2493050 resolve application name through GetApplicationByName - #1150

Merged
rsenden merged 4 commits into
fortify:feat/v3.x/aviator/27.1from
anishkumarnagaraj-design:feat/v3.x/aviator/get-application-by-name
Oct 29, 2026
Merged

rsenden merged 4 commits into
fortify:feat/v3.x/aviator/27.1from
anishkumarnagaraj-design:feat/v3.x/aviator/get-application-by-name

Conversation

@anishkumarnagaraj-design

@anishkumarnagaraj-design anishkumarnagaraj-design commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Story

Work item 2493050: Add GetApplicationByName gRPC command to the server and use it in fcli
https://almoctane-ams.saas.microfocus.com/ui/?p=206015/2001#/entity-navigation?entityType=work_item&id=2493050

Targets feat/v3.x/aviator/27.1.

Why

fcli aviator app get|update|delete|add-entitlement|reduce-entitlement accept an application name or id. For a name, fcli called ListApplications and compared names on the client, because the server had no lookup by name. The server now provides GetApplicationByName (see the companion server MR), so fcli resolves a name with a single call.

What changed

  • Application.proto (fcli copy): adds the ApplicationByName message and the GetApplicationByName rpc, with the same field numbers as the server proto (name=1, signature=2, message=3, tenantName=4). Other differences between the two proto copies are unrelated and were left alone.
  • AviatorGrpcClient.getApplicationByName(...) and Constants.OP_GET_APP_BY_NAME.
  • AviatorAppHelper.resolveApplicationId:
    • Numeric values are still treated as application ids and returned as-is, with no server call (unchanged).
    • Any other value is a name. fcli signs (tenant, name) and calls GetApplicationByName, then returns the application id.
    • Removed the client-side list-and-filter name matching and the "multiple applications" branch. The server guarantees one non-deleted application per name in a tenant, so that branch could no longer happen.
  • Help text: fcli.aviator.app.app-name-or-id says names are matched case-insensitively.

Behaviour

Input Result
numeric value used as the application id, no server call (unchanged)
name that exists resolved by the server to its id
name that does not exist standard "requested resource was not found ... verify the name or ID is correct" error, including the server message naming the application and tenant
name, older server without the RPC clear error: "The Aviator service does not support the ... operation" plus a hint to use the numeric application id (gRPC UNIMPLEMENTED). No fallback to ListApplications, by decision: a new fcli needs a server with the new RPC

Name matching is case-insensitive and done by the server.

Tests

  • AviatorAppHelperTest now covers the numeric path (no server call, using null client and descriptor), blank and null values, and isNumeric. The tests for the removed list-matching code were removed with it.
  • AviatorAppResolverMixinTest still passes.
  • Not unit-tested: the new name path in resolveApplicationId. The module has no Mockito and signing needs real keys, so this needs an integration test against a server with the new RPC.

Run (JDK 17 toolchain, online): ./gradlew :fcli-core:fcli-aviator:test --tests "*AviatorAppHelperTest" --tests "*AviatorAppResolverMixinTest"

Not in this change

  • The --app option on user-facing commands (fcli aviator ssc audit-sast and similar) is intentionally unchanged: it is always an application name, never an id.
  • No check that a numeric id exists before use: the command that follows already reports an unknown id.

Related

Server MR (adds the RPC): https://gitlab.otxlab.net/appsec/aviator/fortify-aviator/-/merge_requests/407

…nByName

Non-numeric values passed to aviator app commands are resolved with a single GetApplicationByName call instead of listing all applications and filtering by name on the client. Numeric values are still treated as application ids. Requires a server that supports GetApplicationByName.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@anishkumarnagaraj-design
anishkumarnagaraj-design changed the base branch from feat/v3.x/aviator/27.1 to dev/v3.x October 29, 2026 05:34
@anishkumarnagaraj-design
anishkumarnagaraj-design changed the base branch from dev/v3.x to feat/v3.x/aviator/27.1 October 29, 2026 05:48
@anishkumarnagaraj-design
anishkumarnagaraj-design force-pushed the feat/v3.x/aviator/get-application-by-name branch from 4ffcd0a to 8535066 Compare October 29, 2026 06:27
…hing

Name matching is performed by the server and is case-insensitive.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…pplicationByName

Map gRPC UNIMPLEMENTED to an actionable message (upgrade the server, or use the numeric application id) instead of the generic technical error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… service

Users cannot upgrade the hosted service, so state that the service does not support the operation and keep only the numeric id hint.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rsenden
rsenden merged commit fb3c43b into fortify:feat/v3.x/aviator/27.1 Oct 29, 2026
14 of 15 checks passed
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.

4 participants