Add forward proxy code
[aaf/cadi.git] / sidecar / fproxy / README.md
1 # Introduction
2
3 The AAF Forward Proxy is a forward proxy service with credential caching capabilities for incoming REST requests. It is one of two applications (along with Reverse proxy) deployed as a
4 Kubernetes sidecar to the main Primary service
5
6 ## Features
7
8 Forward Proxy:
9
10 * The service will forward all incoming REST requests on to their original endpoints.
11 * Add any cached security credentials to the forwarding request
12
13 ### Credential Cache:
14 The credential cache is a short-lived in-memory cache, keyed on a transaction ID. The following data is cached:
15
16 * Transaction ID - this is the key for retrieving cached values
17 * CredentialName - this is the name of the credential to be cached.
18           This should correspond to the header name for a header credential, or the cookie name for a cookie credential.
19 * CredentialValue - this is the value associated with the credential.
20           This should correspond to the header value of a header credential, or the cookie contents for a cookie credential.
21 * CredentialType - this is the type of the credential to be cached. Currently supported values are: HEADER, COOKIE.
22           The cache has a configurable cache expiry period, so that any cache entries older than the expiry period will be automatically removed from the cache.
23                   
24 ### Credential Cache REST API:
25 Credentials can be added to the credential cache by performing a REST POST using the following URL:
26
27 (Note that the transaction ID is provided as a URL parameter)
28
29 https://<host>:<port>/credential-cache/<transactionid>
30 The body of the request should contain the cached data (described above) in JSON format as follows:
31
32 { "credentialName":"foo", "credentialValue":"bar", "credentialType":"<HEADER/COOKIE>" }
33
34
35 ## Configuring the fProxy service
36 The fProxy service is configured through the fproxy.properties file that resides under the ${CONFIG_HOME} environment variable.
37
38 The file has the following configurable properties:
39
40 credential.cache.timeout.ms     This is the time in milliseconds that a cache entry will expire after it is added.              180000
41 transactionid.header.name       This is the name of the header in incoming requests that will contain the transaction ID.       X-TransactionId