Skip to content

Commit 6134f1a

Browse files
author
Mladen Rusev
committed
update the api
1 parent 787f14e commit 6134f1a

File tree

7 files changed

+333
-8
lines changed

7 files changed

+333
-8
lines changed

.envrc.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ export ARK_SUBDOMAIN= # your CyberArk tenant subdomain
1818
export ARK_USERNAME= # your CyberArk username
1919
export ARK_SECRET= # your CyberArk password
2020
# OPTIONAL: the URL for the CyberArk Discovery API if not using the production environment
21-
export ARK_DISCOVERY_API=https://platform-discovery.integration-cyberark.cloud/api/tenant-discovery/public
21+
export ARK_DISCOVERY_API=https://platform-discovery.integration-cyberark.cloud/api/public/tenant-discovery

pkg/internal/cyberark/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestCyberArkClient_PutSnapshot_MockAPI(t *testing.T) {
4848
// ARK_SUBDOMAIN should be your tenant subdomain.
4949
//
5050
// To test against a tenant on the integration platform, also set:
51-
// ARK_DISCOVERY_API=https://platform-discovery.integration-cyberark.cloud/api/tenant-discovery/public
51+
// ARK_DISCOVERY_API=https://platform-discovery.integration-cyberark.cloud/api/public/tenant-discovery
5252
//
5353
// To enable verbose request logging:
5454
//

pkg/internal/cyberark/identity/cmd/testidentity/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
// the login is successful.
2323
//
2424
// To test against a tenant on the integration platform, set:
25-
// ARK_DISCOVERY_API=https://platform-discovery.integration-cyberark.cloud/api/tenant-discovery/public
25+
// ARK_DISCOVERY_API=https://platform-discovery.integration-cyberark.cloud/api/public/tenant-discovery
2626
const (
2727
subdomainFlag = "subdomain"
2828
usernameFlag = "username"

pkg/internal/cyberark/servicediscovery/discovery.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (c *Client) DiscoverServices(ctx context.Context, subdomain string) (*Servi
9797
if err != nil {
9898
return nil, fmt.Errorf("invalid base URL for service discovery: %w", err)
9999
}
100-
u.Path = path.Join(u.Path, "api/tenant-discovery/public")
100+
u.Path = path.Join(u.Path, "api/public/tenant-discovery")
101101
u.RawQuery = url.Values{"bySubdomain": []string{subdomain}}.Encode()
102102
endpoint := u.String()
103103
request, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil)

pkg/internal/cyberark/servicediscovery/mock.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import (
2020

2121
const (
2222
// MockDiscoverySubdomain is the subdomain for which the MockDiscoveryServer will return a success response
23-
MockDiscoverySubdomain = "venafi-test"
23+
MockDiscoverySubdomain = "tlspk-test"
2424

2525
mockIdentityAPIURL = "https://ajp5871.id.integration-cyberark.cloud"
2626
mockDiscoveryContextAPIURL = "https://venafi-test.inventory.integration-cyberark.cloud/"
27-
prefix = "/api/tenant-discovery/public?bySubdomain="
27+
prefix = "/api/public/tenant-discovery?bySubdomain="
2828
)
2929

3030
//go:embed testdata/discovery_success.json.template

pkg/internal/cyberark/servicediscovery/testdata/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To get the original data:
66

77
NOTE: This API is not implemented yet as of 02.09.2025 but is expected to be finalised by end of PI3 2025.
88
```bash
9-
curl -fsSL "${ARK_DISCOVERY_API}/api/tenant-discovery/public?bySubdomain=${ARK_SUBDOMAIN}" | jq
9+
curl -fsSL "${ARK_DISCOVERY_API}/api/public/tenant-discovery?bySubdomain=${ARK_SUBDOMAIN}" | jq
1010
```
1111

1212
Then replace `identity_administration.api` with `{{ .Identity.API }}` and

pkg/internal/cyberark/servicediscovery/testdata/discovery_success.json.template

Lines changed: 326 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,329 @@
203203
]
204204
}
205205
]
206-
}
206+
}
207+
208+
{
209+
"region": "America East",
210+
"dr_region": null,
211+
"subdomain": "tlskp-test",
212+
"tenant_id": "8f08a102-58ca-49cd-960e-debc5e0d3cd4",
213+
"identity_id": "anb5751",
214+
"default_url": null,
215+
"tenant_flags": {
216+
"is_crdr_supported": false,
217+
"is_crdr_active": false
218+
},
219+
"services": [
220+
{
221+
"service_name": "data_privacy",
222+
"service_subdomains": [
223+
"data_privacy",
224+
"dataprivacy"
225+
],
226+
"region": "us-east-1",
227+
"endpoints": [
228+
{
229+
"is_active": true,
230+
"type": "main",
231+
"ui": "https://ui.data-privacy.integration-cyberark.cloud/",
232+
"api": "https://us-east-1.data-privacy.integration-cyberark.cloud/api"
233+
}
234+
]
235+
},
236+
{
237+
"service_name": "idaptive_risk_analytics",
238+
"service_subdomains": [
239+
"idaptive_risk_analytics",
240+
"idsecanalytics",
241+
"idaptiveriskanalytics"
242+
],
243+
"region": "us-east-1",
244+
"endpoints": [
245+
{
246+
"is_active": true,
247+
"type": "main",
248+
"ui": "https://anb5751-my.analytics.idaptive.qa",
249+
"api": "https://anb5751-my.analytics.idaptive.qa"
250+
}
251+
]
252+
},
253+
{
254+
"service_name": "component_manager",
255+
"service_subdomains": [
256+
"component_manager",
257+
"componentmanager"
258+
],
259+
"region": "us-east-1",
260+
"endpoints": [
261+
{
262+
"is_active": true,
263+
"type": "main",
264+
"ui": "https://ui-connectormanagement.connectormanagement.integration-cyberark.cloud",
265+
"api": "https://tlskp-test.connectormanagement.integration-cyberark.cloud/api"
266+
}
267+
]
268+
},
269+
{
270+
"service_name": "itdr",
271+
"service_subdomains": [
272+
"itdr"
273+
],
274+
"region": "us-east-1",
275+
"endpoints": [
276+
{
277+
"is_active": true,
278+
"type": "main",
279+
"ui": "https://ui-itdr.itdr.integration-cyberark.cloud/",
280+
"api": "https://tlskp-test.itdr.integration-cyberark.cloud/api"
281+
}
282+
]
283+
},
284+
{
285+
"service_name": "identity_user_portal",
286+
"service_subdomains": [
287+
"identity_user_portal",
288+
"identityuserportal",
289+
"idusrportal"
290+
],
291+
"region": "us-east-1",
292+
"endpoints": [
293+
{
294+
"is_active": true,
295+
"type": "main",
296+
"ui": "https://anb5751.id.integration-cyberark.cloud",
297+
"api": "https://anb5751.id.integration-cyberark.cloud"
298+
}
299+
]
300+
},
301+
{
302+
"service_name": "userportal",
303+
"service_subdomains": [
304+
"userportal"
305+
],
306+
"region": "us-east-1",
307+
"endpoints": [
308+
{
309+
"is_active": true,
310+
"type": "main",
311+
"ui": "https://us-east-1.ui.userportal.integration-cyberark.cloud/",
312+
"api": "https://tlskp-test.api.userportal.integration-cyberark.cloud/api"
313+
}
314+
]
315+
},
316+
{
317+
"service_name": "ekp",
318+
"service_subdomains": [
319+
"ekp"
320+
],
321+
"region": "us-east-1",
322+
"endpoints": [
323+
{
324+
"is_active": true,
325+
"type": "main",
326+
"ui": "https://ui-tlskp-test.ekp.integration-cyberark.cloud/",
327+
"api": "https://tlskp-test.ekp.integration-cyberark.cloud/"
328+
}
329+
]
330+
},
331+
{
332+
"service_name": "itdruba",
333+
"service_subdomains": [
334+
"itdruba"
335+
],
336+
"region": "us-east-1",
337+
"endpoints": [
338+
{
339+
"is_active": true,
340+
"type": "main",
341+
"ui": "https://ui-itdruba.itdruba.integration-cyberark.cloud/",
342+
"api": "https://tlskp-test.itdruba.integration-cyberark.cloud/api"
343+
}
344+
]
345+
},
346+
{
347+
"service_name": "cloud_onboarding",
348+
"service_subdomains": [
349+
"cloud_onboarding",
350+
"cloudonboarding"
351+
],
352+
"region": "us-east-1",
353+
"endpoints": [
354+
{
355+
"is_active": true,
356+
"type": "main",
357+
"ui": "https://ui-cloudonboarding.cloudonboarding.integration-cyberark.cloud",
358+
"api": "https://tlskp-test.cloudonboarding.integration-cyberark.cloud/api"
359+
}
360+
]
361+
},
362+
{
363+
"service_name": "identity_administration",
364+
"service_subdomains": [
365+
"identity_administration",
366+
"idadmin",
367+
"identityadministration"
368+
],
369+
"region": "us-east-1",
370+
"endpoints": [
371+
{
372+
"is_active": true,
373+
"type": "main",
374+
"ui": "https://anb5751.id.integration-cyberark.cloud",
375+
"api": "{{ .Identity.API }}"
376+
}
377+
]
378+
},
379+
{
380+
"service_name": "adminportal",
381+
"service_subdomains": [
382+
"adminportal"
383+
],
384+
"region": "us-east-1",
385+
"endpoints": [
386+
{
387+
"is_active": true,
388+
"type": "main",
389+
"ui": "https://ui-adminportal.adminportal.integration-cyberark.cloud",
390+
"api": "https://tlskp-test.adminportal.integration-cyberark.cloud/api"
391+
}
392+
]
393+
},
394+
{
395+
"service_name": "intelligence",
396+
"service_subdomains": [
397+
"intelligence"
398+
],
399+
"region": "us-east-1",
400+
"endpoints": [
401+
{
402+
"is_active": true,
403+
"type": "main",
404+
"ui": "https://ui-intelligence.intelligence.integration-cyberark.cloud/",
405+
"api": "https://tlskp-test.intelligence.integration-cyberark.cloud/api"
406+
}
407+
]
408+
},
409+
{
410+
"service_name": "discoverycontext",
411+
"service_subdomains": [
412+
"discoverycontext",
413+
"inventory"
414+
],
415+
"region": "us-east-1",
416+
"endpoints": [
417+
{
418+
"is_active": true,
419+
"type": "main",
420+
"ui": "https://ui-inventory.inventory.integration-cyberark.cloud/",
421+
"api": "{{ .DiscoveryContext.API }}"
422+
}
423+
]
424+
},
425+
{
426+
"service_name": "license",
427+
"service_subdomains": [
428+
"license"
429+
],
430+
"region": "us-east-1",
431+
"endpoints": [
432+
{
433+
"is_active": true,
434+
"type": "main",
435+
"ui": "https://ui-license.license.integration-cyberark.cloud/",
436+
"api": "https://tlskp-test.license.integration-cyberark.cloud/api"
437+
}
438+
]
439+
},
440+
{
441+
"service_name": "flows",
442+
"service_subdomains": [
443+
"flows",
444+
"idflows"
445+
],
446+
"region": "us-east-1",
447+
"endpoints": [
448+
{
449+
"is_active": true,
450+
"type": "main",
451+
"ui": "https://anb5751.flows.integration-cyberark.cloud",
452+
"api": "https://anb5751.flows.integration-cyberark.cloud"
453+
}
454+
]
455+
},
456+
{
457+
"service_name": "audit",
458+
"service_subdomains": [
459+
"audit"
460+
],
461+
"region": "us-east-1",
462+
"endpoints": [
463+
{
464+
"is_active": true,
465+
"type": "main",
466+
"ui": "https://ui.audit-ui.integration-cyberark.cloud",
467+
"api": "https://tlskp-test-us-east-1.audit.integration-cyberark.cloud/api"
468+
}
469+
]
470+
},
471+
{
472+
"service_name": "chat",
473+
"service_subdomains": [
474+
"chat"
475+
],
476+
"region": "us-east-1",
477+
"endpoints": [
478+
{
479+
"is_active": true,
480+
"type": "main",
481+
"ui": "https://platform-chat-ui.platform.chat.integration-cyberark.cloud/",
482+
"api": "https://tlskp-test.platform.chat.integration-cyberark.cloud/api"
483+
}
484+
]
485+
},
486+
{
487+
"service_name": "fmcdp",
488+
"service_subdomains": [],
489+
"region": "us-east-1",
490+
"endpoints": [
491+
{
492+
"is_active": true,
493+
"type": "main",
494+
"ui": "https://tagtig.io/",
495+
"api": "https://tagtig.io/api"
496+
}
497+
]
498+
},
499+
{
500+
"service_name": "uniguidance",
501+
"service_subdomains": [
502+
"uniguidance"
503+
],
504+
"region": "us-east-1",
505+
"endpoints": [
506+
{
507+
"is_active": true,
508+
"type": "main",
509+
"ui": "https://ui-uniguidance.uniguidance.integration-cyberark.cloud/",
510+
"api": "https://tlskp-test.uniguidance.integration-cyberark.cloud/api"
511+
}
512+
]
513+
},
514+
{
515+
"service_name": "featureadopt",
516+
"service_subdomains": [
517+
"featureadopt"
518+
],
519+
"region": "us-east-1",
520+
"endpoints": [
521+
{
522+
"is_active": true,
523+
"type": "main",
524+
"ui": "https://ui-featureadopt.featureadopt.integration-cyberark.cloud/",
525+
"api": "https://us-east-1-featureadopt.featureadopt.integration-cyberark.cloud/api"
526+
}
527+
]
528+
}
529+
],
530+
"tenant_urls": null
531+
}

0 commit comments

Comments
 (0)