|
| 1 | +# Obfuscated endpoint URL |
| 2 | + |
| 3 | +One simple mechanism to share an IBM API Connect Essentials (StepZen) endpoint to |
| 4 | +to make the [endpoint open](../../protection/makeAllPublic/config.yaml) but |
| 5 | +deploy the schema with an obfuscated name. |
| 6 | + |
| 7 | +## Deploying |
| 8 | + |
| 9 | +For example, deploy this schema using a randomly generated name (Linux/MacOS): |
| 10 | + |
| 11 | +``` |
| 12 | +name=$(cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z' | fold -w 64 | head -n 1) |
| 13 | +stepzen deploy pocs/$name |
| 14 | +``` |
| 15 | + |
| 16 | +You will see the endpoint is deployed with a random obfuscated URL. |
| 17 | + |
| 18 | +``` |
| 19 | +Deploying pocs/FzOYquoOMuQzvQqsLSUfVuvQwfVwuOEhGOkGGpLDnuIzeJZCHQAfHbFMCCIQdmBe to StepZen... done in 511ms 🚀 |
| 20 | + ✓ 🔐 https://danville.us-east-a.ibm.stepzen.net/pocs/FzOYquoOMuQzvQqsLSUfVuvQwfVwuOEhGOkGGpLDnuIzeJZCHQAfHbFMCCIQdmBe/__graphql |
| 21 | + ✓ 🔐 wss://danville.us-east-a.ibm.stepzen.net/stepzen-subscriptions/pocs/FzOYquoOMuQzvQqsLSUfVuvQwfVwuOEhGOkGGpLDnuIzeJZCHQAfHbFMCCIQdmBe/__graphql (subscriptions) |
| 22 | +``` |
| 23 | + |
| 24 | +This endpoint URL can now be handed out to allow others to evaluate the endpoint without requiring any authorization. |
| 25 | + |
| 26 | +> [!WARNING] |
| 27 | +> Anyone with the URL has access to the endpoint, so this is security through obscurity. |
| 28 | +
|
| 29 | +## Analytics |
| 30 | + |
| 31 | +Using the analytics dashboard the account owner can see activity with this specific endpoint, |
| 32 | +so by handing out individual endpoints the account owner can track how extensively the endpoint has been evaluated. |
| 33 | + |
| 34 | +## Single-use & deleting |
| 35 | + |
| 36 | +Thus one can extend thise concept to a "single-use" endpoint, for example creating an endpoint |
| 37 | +for a demo and then delete it when no longer required. |
| 38 | + |
| 39 | +``` |
| 40 | +stepzen delete --non-interactive pocs/FzOYquoOMuQzvQqsLSUfVuvQwfVwuOEhGOkGGpLDnuIzeJZCHQAfHbFMCCIQdmBe |
| 41 | +``` |
| 42 | + |
| 43 | +## Tracking |
| 44 | + |
| 45 | +By maintaining such endpoints in single folder, such as `pocs` or `single-use` you can use `stepzen list` to |
| 46 | +see which endpoints are still active. |
| 47 | + |
| 48 | +``` |
| 49 | +> stepzen list --folder pocs |
| 50 | + Endpoint Created at Updated at |
| 51 | + ──────────────────────────────────────────────────────────────────────── ──────────────────────── ───────────────────── |
| 52 | + pocs/FzOYquoOMuQzvQqsLSUfVuvQwfVwuOEhGOkGGpLDnuIzeJZCHQAfHbFMCCIQdmBe Sep 8, 2024, 12:46 PM Sep 8, 2024, 12:59 PM |
| 53 | +``` |
| 54 | + |
| 55 | +## Schema description |
| 56 | + |
| 57 | +It is recommended to define a [schema description](./index.graphql#L1-L6) so that this GraphQL introspection request can |
| 58 | +used to see the purpose of the obfuscated endpoint. |
| 59 | + |
| 60 | +``` |
| 61 | +> stepzen request '{__schema{description}}' |
| 62 | +{ |
| 63 | + "data": { |
| 64 | + "__schema": { |
| 65 | + "description": "Sample mocked Customer endpoint." |
| 66 | + } |
| 67 | + } |
| 68 | +} |
| 69 | +``` |
0 commit comments