Repository navigation
(Ready to merge) fix(aviator): 2527025 handle leading zeros in application id; treat leading-zero values as names - #1157
Conversation
Numeric values passed to aviator app commands were forwarded to the server unchanged. An id such as 001564 was signed and sent as-is, the server did not match it against the canonical id 1564, and the user saw a misleading "Permission Denied ... Message part 2 mismatch" error. Numeric ids are now normalized (leading zeros removed) before they are signed and sent, so 001564 behaves exactly like 1564. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
SSC Applications can have numeric names such as 0000144. Could we treat leading-zero values such as 000144 as application names rather than normalize them to IDs?, and this command accepts either a name or an ID. In this scenario, normalization selects ID 144 instead of the intended application named 000144 |
Only canonical numeric values are used as ids; values such as 000144 are passed unchanged to the name lookup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Thanks for the feedback. Confirmed and fixed in 0c70cd9: ids are no longer normalized. Only canonical numeric values ( |
|
Could we also update the shared help text as well? |
… values Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Help text updated in the latest commit: numeric values without leading zeros are ids; everything else, including values like 000144, is a name. The help assertion in AviatorAppResolverMixinTest is updated as well (7 + 6 tests pass). |
|
one very minor comment AviatorAppResolverMixin Javadoc still says numeric values are always IDs. Update it to match the new leading-zero rule. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Story
ValueEdge defect 2527025: Incorrect "Permission Denied" error is displayed when application ID contains leading zeros
https://almoctane-ams.saas.microfocus.com/ui/?&p=206015/2001#/entity-navigation?entityType=work_item&id=2527025
Why
fcli aviator app update 001564 --name xfailed withPermission Denied for application update ... Message part 2 mismatch, while1564succeeded. All-digit values were forwarded unchanged as ids, so the id was signed and sent as001564and the server did not match it against the canonical id1564. The error pointed at permissions although the cause was the id format.Review feedback: SSC applications can have numeric names such as
000144. Normalizing such a value to id144would select the wrong application, or make the named application unreachable.What changed
AviatorAppHelper(fcli-aviator): only values in canonical numeric form (0or digits without a leading zero, max 18 digits) are treated as an application id and returned unchanged. Every other value, including all-digit values with a leading zero such as000144, is treated as an application name and passed toGetApplicationByNameexactly as typed. NoLong.parseLongnormalization is applied anywhere.isNumericreplaced byisCanonicalId. It was only used inside the helper.<app-name-or-id>(update,get,delete,add-entitlement,reduce-entitlement) as they resolve through this helper..proto.Behaviour
1564,2024001564,00014400999999999999999999(18 digits)19digits or moremy-appIds that previously worked (canonical form) behave exactly as before. A leading-zero value never worked as an id (server rejected it), so nothing that worked is broken. If it matches no application, the user now gets the normal "application not found" result for that name.
Tests
AviatorAppHelperTest: canonical id detection, canonical ids passed through without server contact, leading-zero values take the name-lookup path../gradlew :fcli-core:fcli-aviator:test --tests "*AviatorAppHelperTest". Result: passed.Out of scope / decisions
144) remain ids with no fallback to name; an application whose name is a canonical number is addressable only by id (existing behaviour).0is treated as a canonical id; the server rejects it if no such application exists.