You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The jolokia api server will now check the the TLS cert of the broker
when the connection is secured. In order to do so, at deploy time, a
cluster issuer gets created by the script. This cluster issuer needs to
be used to generate the cert the broker would use for its console.
An example for a broker called ex-aao within the default namespace would
be:
```
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: ex-aao-console-certificate-cert
namespace: default
spec:
secretName: ex-aao-console-certificate-cert-secret
privateKey:
algorithm: RSA
encoding: PKCS1
size: 2048
isCA: false
commonName: ex-aao-console-cert
dnsNames:
- ex-aao-wconsj-0-svc-rte-default.apps-crc.testing
- ex-aao-wconsj-0-svc.default
issuerRef:
name: jolokia-api-server-selfsigned-issuer
kind: ClusterIssuer
group: cert-manager.io
```
When running in dev mode, if the broker is secured by TLS you'll also
need the trust bundle to connect to it. To do so checkout the README
instructions.
After updating the `openapi.yml` file, please make sure to generate the
20
80
documentation:
21
81
22
-
```
82
+
```sh
23
83
yarn run build-api-doc
24
84
```
25
85
@@ -51,15 +111,6 @@ deployed. for example:
51
111
52
112
The optional -ns (or --nosec) argument can be used to disable security.
53
113
54
-
---
55
-
56
-
**Note:**
57
-
58
-
you should enable security in your application. Disable security can only
59
-
be used for test purposes.
60
-
61
-
---
62
-
63
114
The `deploy.sh` script uses `oc kustomize` (built-in
64
115
[kustomize](https://github.com/kubernetes-sigs/kustomize)) command to configure
65
116
and deploy the plugin using resources and patches defined under ./deploy
@@ -71,60 +122,21 @@ To undeploy, run
71
122
./undeploy.sh
72
123
```
73
124
74
-
### Notes about the JWT secret
75
-
76
-
The api server uses SECRET_ACCESS_TOKEN env var to get the secret for generating
77
-
jwt tokens. It has a default value in .env for dev purposes.
78
-
79
-
In production you should override it with your own secret.
80
-
81
-
The jwt-key-gen.sh is a tool to generate a random key and used in Dockerfile.
82
-
It makes sure when you build the api server image a new random key is used.
83
-
84
-
## Security Model of the API Server
85
-
86
-
The API Server provides a security model that provides authentication and authorization of incoming clients.
87
-
The security can be enabled/disabled (i.e. via `API_SERVER_SECURITY_ENABLED` env var)
88
-
89
-
### Authentication
90
-
91
-
Currently the api server support `jwt` token authentication.
92
-
93
-
#### The login api
94
-
95
-
The login api is defined in openapi.yml
96
-
97
-
```yaml
98
-
/server/login
99
-
```
100
-
101
-
A client logs in to an api server by sending a POST request to the login path. The request body contains login information (i.e. username and password for jwt authentication type)
102
-
103
-
Please refer to [api.md](api.md) for details of the log api.
104
-
105
-
Currently the security manager uses local file to store user's info. The default users file name is `.users.json`
106
-
The users file name can be configured using `USERS_FILE_URL` env var. See `.test.users.json` for sample values.
107
-
108
-
### Authorization
109
-
110
-
Currently the api server doesn't perform authorization on logged in users.
111
-
112
-
### Endpoints Management
113
-
114
-
The server keeps a list of jolokia endpoints for clients to access. The endpoints are loaded from a local file named
115
-
`.endpoints.json`. Each top level entry represents a jolokia endpoint. An entry has a unique name and details to access the jolokia api. See `.test.endpoints.json` for sample values.
116
-
117
125
### Accessing a jolokia endpoint
118
126
119
-
When an authenticated client sends a request to the api-server, it should present its token in the request header
127
+
When an authenticated client sends a request to the api-server, it should
128
+
present its token in the request header.
120
129
121
-
'Authorization: Bearer `token`'
130
+
'Authorization: Bearer `token`'
122
131
123
-
It also need to give the `targetEndpoint` in the query part of the request if the request is to access an jolokia endpoint.
132
+
It also need to give the `targetEndpoint` in the query part of the request if
133
+
the request is to access an jolokia endpoint.
124
134
125
135
For example `/execBrokerOperation?targetEndpoint=broker1`.
126
136
127
137
### Direct Proxy
128
138
129
-
Direct Proxy means a client can pass a broker's endpoint info to the api-server in order to access it via the api-server.
130
-
For example the [self-provisioning plugin](https://github.com/artemiscloud/activemq-artemis-self-provisioning-plugin) uses this api to access the jolokia of a broker's jolokia endpoint.
139
+
Direct Proxy means a client can pass a broker's endpoint info to the api-server
140
+
in order to access it via the api-server. For example the [self-provisioning
0 commit comments