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
-[HTTP client and service examples secured with different auth mechanisms](https://github.com/ldclakmal/ballerina-security/tree/master/examples/http)
24
-
-[gRPC client and service examples secured with JWT auth mechanism](https://github.com/ldclakmal/ballerina-security/tree/master/examples/grpc)
25
-
-[WebSocket client and service examples secured with JWT auth mechanism](https://github.com/ldclakmal/ballerina-security/tree/master/examples/websocket)
26
-
-[WebSub hub, publisher and subscriber examples secured with JWT auth mechanism](https://github.com/ldclakmal/ballerina-security/tree/master/examples/websub)
23
+
#### [Test Suite](./test-suite)
27
24
28
-
### Scenarios
25
+
This section demonstrates an automated Ballerina security test-suite which contains authentication and authorization related integration scenarios and Ballerina by examples (BBEs). These tests run on demand with the provided Ballerina version in GitHub secrets. Refer to the [workflow](https://github.com/ldclakmal/ballerina-security/actions).
This section demonstrates the examples with authentication and authorization for different transport protocols supported by Ballerina. The client and servers are secured with different auth protocols.
33
+
34
+
#### [Scenarios](./scenarios)
35
+
36
+
This section demonstrates the real-world scenarios which has authentication and authorization requirements and how that can be supported with Ballerina.
This directory contains the example scenarios written by [Ballerina](https://ballerina.io) programming language for different protocols supported.
3
+
This section demonstrates the examples with authentication and authorization for different transport protocols supported by Ballerina. The client and servers are secured with different auth protocols.
This directory contains the real-world scenarios written by [Ballerina](https://ballerina.io) programming language.
3
+
This section demonstrates the real-world scenarios which has authentication and authorization requirements and how that can be supported with Ballerina.
4
4
5
-
### [Scenario 1](./scenario-1)
5
+
### [Ballerina Secure Token Service (STS)](./sts)
6
+
7
+
Ballerina STS which supports OAuth2 token issuing and validation.
8
+
9
+
Refer to the [README](./sts/README.md) for more information.
Simple inventory management system, with 2 secured microservices, and a secured API gateway, which connects to an LDAP user store and trusts OAuth2 authorization server.
8
14
9
-
User `Jane`, the admin, connects to `Admin Microservice` through the REST API of API gateway using HTTPS for management purposes. User `Alice`, a customer, connects to `Inventory Microservice` through the REST API of API gateway using HTTPS for purchasing items. All the APIs are authenticated with different types of authentication mechanisms such as basic auth, JWT auth, OAuth2 etc. and secured with TLS as well. Refer to the [diagram](./scenario-1/scenario-1.png) and [README](./scenario-1/README.md) for more information.
15
+
Refer to the [diagram](./scenario-1/scenario-1.png) and [README](./scenario-1/README.md) for more information.
Advanced inventory management system, with 4 secured microservices, and a secured API gateway, which connects to an LDAP user store and trusts OAuth2 authorization server.
14
20
15
-
User `Jane`, the admin, connects to `Admin Microservice` through the REST API of API gateway using HTTPS for management purposes. User `Alice`, a customer, connects to `Inventory Microservice` through the REST API of API gateway using HTTPS for purchasing items. User `Bob`, another customer, connects to `Inventory Microservice` through the GraphQL API of API gateway using HTTPS for searching items. `Electronic` and `Fashions` microservices are connected to `Inventory Microservice` and can be accessed via gRPC APIs. All the HTTP, GraphQL, gRPC APIs are authenticated with different types of authentication mechanisms such as basic auth, JWT auth, OAuth2 etc. and secured with TLS as well. Refer to the [diagram](./scenario-2/scenario-2.png) and [README](./scenario-2/README.md) for more information.
21
+
Refer to the [diagram](./scenario-2/scenario-2.png) and [README](./scenario-2/README.md) for more information.
Copy file name to clipboardExpand all lines: test-suite/README.md
+42-5Lines changed: 42 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,45 @@
3
3
4
4
# Ballerina Security Test Suite
5
5
6
-
This is an automated Ballerina security test suite which contains authentication and authorization related scenarios. These tests run on demand with the provided Ballerina version.
6
+
This section demonstrates an automated Ballerina security test-suite which contains authentication and authorization related integration scenarios and Ballerina by examples (BBEs). These tests run on demand with the provided Ballerina version in GitHub secrets. Refer to the [workflow](https://github.com/ldclakmal/ballerina-security/actions).
7
+
8
+
### Directory Structure
9
+
10
+
```shell
11
+
test-suite
12
+
|
13
+
|__ packages
14
+
||__ bbe
15
+
|||__ access-control
16
+
||||__ basic-auth-file-store
17
+
||||__ basic-auth-ldap-store
18
+
||||__ jwt-auth
19
+
||||__ oauth2-bearer-token
20
+
||||__ oauth2-client-credentials-grant
21
+
||||__ oauth2-password-grant
22
+
||||__ oauth2-refresh-token-grant
23
+
|||
24
+
|||__ security
25
+
||||__ crypto
26
+
||||__ url
27
+
||||__ jwt
28
+
||
29
+
||__ integration
30
+
|||__ basic-auth-file-store
31
+
|||__ basic-auth-ldap-store
32
+
|||__ jwt-auth
33
+
|||__ oauth2
34
+
||
35
+
||__ resources
36
+
|
37
+
|__ scripts
38
+
|__ bbe
39
+
||__ access-control
40
+
||__ security
41
+
|
42
+
|__ integration
43
+
|__ resources
44
+
```
7
45
8
46
### Secured services
9
47
@@ -14,7 +52,7 @@ This is an automated Ballerina security test suite which contains authentication
14
52
15
53
##### Steps:
16
54
1. User configurations are defined in `Config.toml`
17
-
2. Ballerina service is secured with Basic Auth with file user store.
55
+
2. Ballerina service is secured with Basic Auth with file user store. Inbound tokens are validated with the user store configured in `Config.toml`.
18
56
3. CURL client send requests to Ballerina service.
19
57
20
58
#### 2. Basic Auth - LDAP user store
@@ -25,7 +63,7 @@ This is an automated Ballerina security test suite which contains authentication
25
63
26
64
##### Steps:
27
65
1. User configurations are provided to OpenLDAP server with `.ldif`
28
-
2. Ballerina service is secured with Basic Auth with LDAP user store. Inbound tokens are validated with the OpenLDAP server.
66
+
2. Ballerina service is secured with Basic Auth with LDAP user store. Inbound tokens are validated with the user store defined in OpenLDAP server.
29
67
3. CURL client send requests to Ballerina service.
30
68
31
69
#### 3. JWT Auth
@@ -37,8 +75,7 @@ This is an automated Ballerina security test suite which contains authentication
37
75
38
76
##### Steps:
39
77
1. Service providers are defined in WSO2 IS STS.
40
-
2. Ballerina service is secured with JWT Auth. Inbound tokens are validated by Ballerina with the use of configurations
41
-
provided by WSO2 IS STS.
78
+
2. Ballerina service is secured with JWT Auth. Inbound tokens are validated by Ballerina with the use of configurations provided by WSO2 IS STS.
42
79
3. CURL client send request to WSO2 IS STS and get the JWT.
43
80
4. CURL client send requests to Ballerina service with the received JWT.
0 commit comments