directory
Version:
v0.0.0-...-7c549dc
Opens a new window with list of versions in this module.
Published: Nov 4, 2022
License: Apache-2.0
Opens a new window with license information.
README
¶
Sample Interceptor - Go
The interceptor service is generated using the interceptor service Open API definition.
Swagger Editor is used to generate the spring service.
To learn about interceptors and for instructions on how to run it please head over to the
home directory of interceptor samples.
Prerequisites
Build the sample from source
-
Build the sample interceptor service.
./build.sh
Here, the requestBody is Base64 encoded.
-
Start the interceptor service.
docker run --name interceptor-go -p 9081:9081 wso2am/cc-sample-xml-interceptor-go:v1.0.0
-
Test the interceptor service.
curl https://localhost:9081/api/v1/handle-request \
-H "content-type: application/json" \
-H "accept: application/json" \
-d '{"requestBody": "eyJuYW1lIjoiVGhlIFByaXNvbmVyIn0K"}' \
--cert ../resources/certs/mg.pem \
--key ../resources/mg.key \
--cacert ../resources/certs/interceptor.pem
Sample response
{"headersToAdd":{"x-user":"admin"},"headersToReplace":{"content-type":"application/xml"},"body":"PG5hbWU+VGhlIFByaXNvbmVyPC9uYW1lPg=="}
curl https://localhost:9081/api/v1/handle-response \
-H "content-type: application/json" \
-H "accept: application/json" \
-d '{"responseCode": 200}' \
--cert ../resources/certs/mg.pem \
--key ../resources/mg.key \
--cacert ../resources/certs/interceptor.pem
Sample response
{"responseCode":201}
-
Remove container
docker rm -f interceptor-go
Directories
¶
* Choreo-Connect Interceptor Service * * Interceptor Service * * API version: v1 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
* Choreo-Connect Interceptor Service * * Interceptor Service * * API version: v1 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) |
go
* Copyright (c) 2021, WSO2 Inc.
|
* Copyright (c) 2021, WSO2 Inc. |
Click to show internal directories.
Click to hide internal directories.