Commit 7fc8c13
authored
* fix: ACNA-4617 surface JIL subscription errors, match profiles by productId
`aio console workspace api add` previously treated any HTTP 200 from the
JIL subscribe endpoint as success and dumped the body through `--json`,
including responses like `{ error: [...], errorDetails: [...] }` that
indicate a partial or total failure. Scripts that check exit code saw a
green run while the workspace was never actually subscribed.
Detect a non-empty `error[]` or `errorDetails[]` and throw a CLI error
instead, so `--json` exits non-zero and the JIL message (e.g. "Service
FrameioAPISDK requires selection of a product") is visible to the user.
Also extend `--license-config` profile matching to accept the licenseConfig
`productId`, in addition to `id` and `name`. Users looking at the output
of `aio console api list --json` reasonably try the `productId` they see
under `properties.licenseConfigs[].productId`; matching by it is harmless
when the (id, name, productId) tuple is unambiguous within a service and
unblocks Frame.io-style services where each product has a single profile.
* fix: ACNA-4617 dedupe duplicate service records by sdkCode
Root cause of the Frame.io subscription failure: getEnabledServicesForOrg
returns FrameioAPISDK twice in this org — once as type: 'adobeid' with no
licenseConfigs, and once as type: 'entp' with the product profile metadata
required for OAuth Server-to-Server. The previous Array.find by code
returned whichever the API listed first (the adobeid record), so
availableProfiles was null, --license-config was silently dropped, and
JIL rejected the subscription with "requires selection of a product".
Replace the find-by-code with pickServiceForCode, which prefers the entp
record with populated licenseConfigs when a code appears more than once.
This command always uses OAuth Server-to-Server credentials, so picking
the entp record matches the credential type and aligns with how the
existing interactive prompt filters services (servicesToPromptChoices in
aio-cli-lib-console).
Verified end-to-end against the reporter's org on fresh Stage and
Production workspaces: Frame.io now subscribes cleanly and the resulting
OAuth Server-to-Server credential carries the frame.s2s.all scope.
* fix: GH-258 make api add additive instead of overwriting existing services
JIL's PUT-services endpoint replaces the credential's service list rather
than merging into it, so any second call to `aio console workspace api add`
silently wiped the services attached by an earlier call. The success
message still said "added", but the prior subscriptions (and their
credential scopes) were gone, with no deploy-time signal that anything
broke.
Fetch the credential's current serviceProperties via
getServicePropertiesFromWorkspaceWithCredentialType, merge with the
requested adds (requested entry wins on sdkCode overlap so users can still
update licenseConfigs), and submit the union. If the fetch fails (e.g. a
brand-new workspace with no credential yet) treat it as "no existing
services" so the first-time path still works.
Dedupe the enabled-services list up front via dedupeServicesByCode so the
existing-services helper picks the entp record for FrameioAPISDK in
fixServiceProperties and preserves the licenseConfig on round-trip.
Verified end-to-end against the reporter's org: after three sequential
single-service `api add` calls (AdobeIOManagementAPISDK, FrameioAPISDK,
AppBuilderDataServicesSDK), the credential ends up subscribed to all
three with their scopes intact, instead of just the last one.
Closes #258
1 parent a2b9156 commit 7fc8c13
3 files changed
Lines changed: 401 additions & 12 deletions
File tree
- src/commands/console/workspace/api
- test/commands/console/workspace/api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
| 613 | + | |
| 614 | + | |
614 | 615 | | |
615 | 616 | | |
616 | 617 | | |
| |||
941 | 942 | | |
942 | 943 | | |
943 | 944 | | |
944 | | - | |
| 945 | + | |
| 946 | + | |
945 | 947 | | |
946 | 948 | | |
947 | 949 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
60 | | - | |
| 65 | + | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
| |||
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
77 | 188 | | |
78 | 189 | | |
79 | 190 | | |
| |||
107 | 218 | | |
108 | 219 | | |
109 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
110 | 233 | | |
111 | | - | |
| 234 | + | |
| 235 | + | |
112 | 236 | | |
113 | 237 | | |
114 | 238 | | |
115 | 239 | | |
116 | 240 | | |
117 | | - | |
| 241 | + | |
118 | 242 | | |
119 | 243 | | |
120 | 244 | | |
| |||
154 | 278 | | |
155 | 279 | | |
156 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
157 | 298 | | |
158 | 299 | | |
159 | 300 | | |
160 | 301 | | |
161 | | - | |
| 302 | + | |
162 | 303 | | |
163 | 304 | | |
164 | 305 | | |
| 306 | + | |
| 307 | + | |
165 | 308 | | |
166 | 309 | | |
167 | 310 | | |
| |||
200 | 343 | | |
201 | 344 | | |
202 | 345 | | |
203 | | - | |
| 346 | + | |
204 | 347 | | |
205 | 348 | | |
206 | 349 | | |
| |||
222 | 365 | | |
223 | 366 | | |
224 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
0 commit comments