-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
341 changed files
with
1,814 additions
and
69,277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
en/docs/api-analytics/choreo-analytics/choreo-based-analytics-via-proxy.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Choreo Based Analytics via Proxy | ||
|
||
This documentation outlines the steps to configure APIM Analytics with Choreo through a proxy, utilizing a self-signed certificate for secure communication. | ||
|
||
## Prerequisites | ||
|
||
- Install OpenSSL. | ||
|
||
## Installation and Configuration Steps | ||
|
||
### Step 1: Install mitmproxy | ||
|
||
First, install mitmproxy by following the instructions on the [official mitmproxy documentation](https://docs.mitmproxy.org/stable/overview-installation/). This tool will act as the intercepting proxy between your API Manager and the internet. | ||
|
||
### Step 2: Generate a Self-Signed Certificate | ||
|
||
To create a secure channel, generate a self-signed certificate using the following steps: | ||
|
||
1. Create a configuration file named `req.conf` with the following content: | ||
|
||
```toml | ||
[req] | ||
distinguished_name = req_distinguished_name | ||
x509_extensions = v3_req | ||
prompt = no | ||
|
||
[req_distinguished_name] | ||
C = US | ||
ST = VA | ||
L = SomeCity | ||
O = MyCompany | ||
OU = MyDivision | ||
CN = www.company.com | ||
|
||
[v3_req] | ||
keyUsage = keyEncipherment, dataEncipherment | ||
extendedKeyUsage = serverAuth | ||
subjectAltName = @alt_names | ||
|
||
[alt_names] | ||
IP.1 = 127.0.0.1 | ||
DNS.1 = localhost | ||
DNS.2 = analytics-event-auth.choreo.dev | ||
DNS.3 = analytics-prod-incoming.servicebus.windows.net | ||
``` | ||
|
||
2. Generate the certificate and key by executing the following command: | ||
|
||
```conf | ||
openssl genrsa -out cert.key 2048 | ||
openssl req -new -x509 -key cert.key -out cert.crt -config req.conf -extensions 'v3_req' | ||
cat cert.key cert.crt > cert.pem | ||
``` | ||
|
||
More details on configuring certificates in mitmproxy can be found [here](https://docs.mitmproxy.org/stable/concepts-certificates/). | ||
|
||
!!! note | ||
In a production environment, it is crucial to use a certificate issued by a trusted Certificate Authority (CA) instead of a self-signed certificate. This ensures the integrity and trustworthiness of the secure connections established by your infrastructure. | ||
|
||
### Step 3: API Manager Configuration | ||
|
||
Import the generated cert.crt and cert.key into the API Manager's client-truststore and keystore. Then, apply the following configurations to your deployment.toml file: | ||
|
||
```toml | ||
[apim.analytics] | ||
enable = true | ||
config_endpoint = 'https://analytics-event-auth.choreo.dev/auth/v1' | ||
auth_token = 'YOUR_AUTH_TOKEN' | ||
|
||
[apim.analytics.properties] | ||
proxy_config_enable = true | ||
proxy_config_host ='127.0.0.1' | ||
proxy_config_port = '3128' | ||
proxy_config_protocol = 'https' | ||
``` | ||
|
||
Replace `YOUR_AUTH_TOKEN` with the On-premise key. For guidance on obtaining this key, please refer to the instructions provided in the [WSO2 documentation](https://apim.docs.wso2.com/en/latest/api-analytics/choreo-analytics/getting-started-guide/#step-2-register-your-environment). | ||
|
||
### Step 3: API Manager Configuration | ||
|
||
Launch mitmproxy with the following command to start intercepting traffic: | ||
|
||
```conf | ||
mitmweb --web-port 8086 --listen-port 3128 -m regular --no-http2 --certs cert.pem | ||
``` | ||
|
||
For further details on mitmproxy and its configurations, consult the [mitmproxy documentation](https://docs.mitmproxy.org/stable/overview-installation/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,9 @@ type = "elk" | |
|
||
#### Step 1.2 - Enabling Logs | ||
|
||
!!! note | ||
Note that, the following configurations are added by default from the APIM 4.3.0 version onwards. | ||
|
||
Open the `wso2am-4.x.x/repository/conf` directory. To enable logging for a reporter, edit the `log4j2.properties` file following the instructions given below. | ||
|
||
|
||
|
@@ -79,6 +82,114 @@ Open the `wso2am-4.x.x/repository/conf` directory. To enable logging for a repor | |
!!! note | ||
The `apim_metrics.log` file be rolled each day or when the log size reaches the limit of 1000 MB by default. Furthermore, only 10 revisions will be kept and older revisions will be deleted automatically. You can change these configurations by updating the configurations provided in step 2 given above in this. section. | ||
|
||
!!! note | ||
Following are the details that are available on analytics log events: | ||
|
||
`apim_event_response` - This event will be triggered for each successful API invocation. When a API associated backend returns an error response still it will be logged through this event. | ||
|
||
``` | ||
apim_event_response: | ||
{ | ||
"apiCreator": "admin", | ||
"apiCreatorTenantDomain": "carbon.super", | ||
"apiId": "43d030dc-427f-4678-98e3-87b7d9882b5f", | ||
"apiMethod": "GET", | ||
"apiName": "SampleAPI", | ||
"apiResourceTemplate": "/*", | ||
"apiType": "HTTP", | ||
"apiVersion": "1.0.0", | ||
"applicationId": "2d6c54b0-7c7d-4b50-83dc-e6ae6f88962e", | ||
"applicationName": "DefaultApplication", | ||
"applicationOwner": "admin", | ||
"backendLatency": 13, | ||
"correlationId": "79ed20c3-55b1-434a-adf6-eea25e2d09c3", | ||
"destination": "http://192.168.114.51:8281/services/sampleAPIBackend", | ||
"eventType": "response", | ||
"gatewayType": "SYNAPSE", | ||
"keyType": "SANDBOX", | ||
"platform": "Mac OS X", | ||
"properties":{}, | ||
"apiContext":"/api1/2.0.0", | ||
"userName":"[email protected]" | ||
"proxyResponseCode": 202, | ||
"regionId": "default", | ||
"requestMediationLatency": 54, | ||
"requestTimestamp": "2022-01-20T03:34:36.451Z", | ||
"responseCacheHit": false, | ||
"responseLatency": 73, | ||
"responseMediationLatency": 6, | ||
"targetResponseCode": 202, | ||
"userAgent": "Chrome", | ||
"userIp": "172.16.2.70" | ||
} | ||
``` | ||
|
||
apim_event_faulty - This event will be triggered for each failed and throttled API invocation | ||
|
||
``` | ||
apim_event_faulty: | ||
{ | ||
"apiCreator": "admin", | ||
"apiCreatorTenantDomain": "carbon.super", | ||
"apiId": "43d030dc-427f-4678-98e3-87b7d9882b5f", | ||
"apiName": "SampleAPI", | ||
"apiType": "HTTP", | ||
"apiVersion": "1.0.0", | ||
"applicationId": "0b5ccc91-30e2-4ee5-9355-d1698075c028", | ||
"applicationName": "SampleApp3", | ||
"applicationOwner": "admin", | ||
"correlationId": "ccf2196f-9db8-429b-aaae-98f4c6edf6d7", | ||
"errorCode": 900803, | ||
"errorMessage": "APPLICATION_LEVEL_LIMIT_EXCEEDED", | ||
"errorType": "THROTTLED", | ||
"eventType": "fault", | ||
"gatewayType": "SYNAPSE", | ||
"keyType": "PRODUCTION", | ||
"proxyResponseCode": 429, | ||
"regionId": "default", | ||
"requestTimestamp": "2022-02-01T04:18:48.023Z", | ||
"responseCacheHit": false, | ||
"targetResponseCode": -1 | ||
} | ||
``` | ||
|
||
|
||
| **Parameter** | **Type** | **Description** | | ||
|------------------------------|-----------|----------------------------------------------------------------------| | ||
| "apiCreator" | string | The creator of the API. | | ||
| "apiCreatorTenantDomain" | string | The tenant domain of the API creator. | | ||
| "apiId" | string | Unique identifier of the API. | | ||
| "apiMethod" | string | The HTTP method used by the API (e.g., GET, POST). | | ||
| "apiName" | string | The name of the API. | | ||
| "apiResourceTemplate" | string | The template of the API resource accessed. | | ||
| "apiType" | string | The type of the API (e.g., HTTP, REST). | | ||
| "apiVersion" | string | The version of the API. | | ||
| "applicationId" | string | Unique identifier of the application that makes the API call. | | ||
| "applicationName" | string | Name of the application that makes the API call. | | ||
| "applicationOwner" | string | Owner of the application that makes the API call. | | ||
| "backendLatency" | long | The time taken by the backend to process the request. | | ||
| "correlationId" | string | Unique identifier for tracking API calls. | | ||
| "destination" | string | The backend URL to which the API call was redirected. | | ||
| "eventType" | string | The type of event. | | ||
| "gatewayType" | string | The type of the API gateway. | | ||
| "keyType" | string | Indicates whether the API key used was for SANDBOX or PRODUCTION. | | ||
| "platform" | string | Operating system was used to access the API. | | ||
| "properties" | object | Properties of the event. | | ||
| "apiContext" | string | The context of the API call. | | ||
| "userName" | string | The username of the individual who made the API call. | | ||
| "proxyResponseCode" | int | The HTTP response code returned by the API gateway. | | ||
| "regionId" | string | The region identifier for the API call. | | ||
| "requestMediationLatency" | int | Time taken for request mediation. | | ||
| "requestTimestamp" | long | Timestamp when the request was made. | | ||
| "responseCacheHit" | bool | Indicates if the response was served from cache. | | ||
| "responseLatency" | long | Total time taken to respond to the request. | | ||
| "responseMediationLatency" | long | Time taken for response mediation. | | ||
| "targetResponseCode" | int | The HTTP response code received from the backend target. | | ||
| "userAgent" | string | The user agent of the client making the API call. | | ||
| "userIp" | string | The IP address of the user making the API call. | | ||
| "errorCode" | int | The error code generated in a fault. | | ||
| "errorMessage" | string | The error message associated with the fault. | | ||
| "errorType" | string | The type of error (e.g., THROTTLED). | | ||
|
||
### Step 2 - Configuring ELK | ||
|
||
|
Binary file modified
BIN
+96.3 KB
(340%)
...ssets/img/consume/invoke-apis/graphql-console/graphql-console-execute-query.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+294 KB
(320%)
...cs/assets/img/consume/invoke-apis/graphql-console/graphql-sub-init-response.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+235 KB
(390%)
en/docs/assets/img/consume/invoke-apis/graphql-console/try-out-sub-event.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-133 KB
(55%)
en/docs/assets/img/design/api-policies/attach-api-level-policies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.26 MB
(11%)
en/docs/assets/img/design/api-policies/attach-policies-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-926 KB
(17%)
en/docs/assets/img/design/api-policies/custom-authorization-token-policy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+105 KB
...sets/img/design/api-policies/save-api-for-custom-authorization-token-policy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-722 KB
(17%)
en/docs/assets/img/design/api-policies/save-attached-policies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+272 KB
(1100%)
...mg/tutorials/create-and-publish-a-graphql-api/graphql-console-execute-query.png
Oops, something went wrong.
Binary file modified
BIN
+294 KB
(320%)
...ts/img/tutorials/create-and-publish-a-graphql-api/graphql-sub-init-response.png
Oops, something went wrong.
Binary file modified
BIN
+235 KB
(390%)
...ocs/assets/img/tutorials/create-and-publish-a-graphql-api/try-out-sub-event.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...e/manage-application/advanced-topics/adding-an-application-deletion-workflow.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Adding an Application Deletion Workflow | ||
|
||
Attaching a custom workflow to application deletion, enables an admin to approve/reject application deletion requests made for existing applications. Note that only an admin is able to approve/reject an application deletion request. | ||
|
||
After application deletion workflow is enabled, when an application deletion request is made, the application workflow status is changed to the `DELETE PENDING` state. In this state, a consumer can still use the application to subscribe to APIs, generate production and sandbox keys until the application deletion is approved. Once the application deletion request is approved the application will be deleted. | ||
|
||
### Engaging the Approval Workflow Executor in the API Manager | ||
|
||
1. Sign in to the API Manager Management Console (`https://<Server Host>:9443/carbon`) and go to **Browse** under **Registry**. | ||
|
||
[]({{base_path}}/assets/img/learn/navigate-main-resources.png) | ||
|
||
|
||
2. Open the `/_system/governance/apimgt/applicationdata/workflow-extensions.xml` resource and click **Edit as text**. Disable the `ApplicationDeletionSimpleWorkflowExecutor` and enable `ApplicationDeletionApprovalWorkflowExecutor`. | ||
``` | ||
<WorkFlowExtensions> | ||
... | ||
<!--ApplicationDeletion executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationDeletionSimpleWorkflowExecutor"/--> | ||
<ApplicationDeletion executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationDeletionApprovalWorkflowExecutor"/> | ||
... | ||
</WorkFlowExtensions> | ||
``` | ||
The application deletion approval workflow executor is now engaged. | ||
3. Sign in to the WSO2 API Developer Portal (`https://<hostname>:<port>/devportal`) and click **Applications**. | ||
[]({{base_path}}/assets/img/learn/application-listing.png) | ||
4. Click the **Delete** icon under **Actions** column to open the **Delete Application** popup to delete the desired application. Confirm the delete request by clicking the **Delete** button. | ||
[]({{base_path}}/assets/img/learn/application-delete.png) | ||
5. You will see the workflow status as **DELETE PENDING**. | ||
[]({{base_path}}/assets/img/learn/application-delete-before-approval.png) | ||
6. Sign in to the Admin Portal (`https://<Server Host>:9443/admin`), list all the tasks for Application delete from **Tasks** --> **Application Deletion** and click on approve (or reject) to approve (or reject) the workflow pending request. | ||
[]({{base_path}}/assets/img/learn/application-delete-admin-entry.png) | ||
7. After approving go back to the API Developer Portal Application listing page. The application will be removed. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.