Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 56bb5cc

Browse files
Fix doc [skip ci].
1 parent 2d8f01d commit 56bb5cc

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99

1010
The Symfony bundle provides JWT authentication for request forwarded by Istio sidecar.
1111

12-
> To use this bundle, make sure your K8S application pod had injected Istio sidecar and [RequestAuthentication](https://istio.io/latest/docs/reference/config/security/request_authentication/) CRD had configured, if not your application **IS NOT SECURE**.
12+
> To use this bundle, make sure your K8S application pod had injected Istio sidecar and configured [RequestAuthentication](https://istio.io/latest/docs/reference/config/security/request_authentication/) CRD, if not your application **IS NOT SECURE**.
1313
14-
The difference between this bundle and the awesome [Lexik JWT Authentication](https://github.com/lexik/LexikJWTAuthenticationBundle) bundle is it's **NOT** validate JWT token because Istio sidecar proxy had validated before forward request to your application,
14+
The main difference between the awesome [Lexik JWT Authentication](https://github.com/lexik/LexikJWTAuthenticationBundle) bundle
15+
and this bundle is it's **NOT** validate JWT token because Istio sidecar had validated before forward request to your application,
1516
so that your application don't need to hold public key and double validate JWT token.
1617

1718
## Requirements
@@ -76,17 +77,16 @@ In case your application have multi issuers:
7677
#....
7778
```
7879

79-
80-
## Usages
80+
## Usage
8181

8282
Generate mock JWT token forwarded by Istio sidecar:
8383

8484
```shell
8585
#!/bin/bash
8686

87-
payload='{"issuer":"issuer_1", "sub": "test"}'; \
88-
base64_payload=$(echo -n $payload | base64 -); \
89-
origin_token=$(echo "header.$base64_payload.signature")
87+
payload='{"issuer":"issuer_1", "sub": "test"}';
88+
base64_payload=$(echo -n $payload | base64 -);
89+
origin_token=$(echo "header.$base64_payload.signature");
9090
```
9191

9292
You can test authenticate origin token with curl:
@@ -105,9 +105,9 @@ Or authenticate base64 payload header:
105105
curl -H "X-Istio-JWT-Payload: $base64_header" http://localhost/
106106
```
107107

108-
## Further readings:
108+
## Further readings
109109

110-
+ [Get JWT payload of authenticated user](src/Resources/doc/stateless-user-provider.md)
110+
+ [Get JWT payload of authenticated user](src/Resources/doc/get-jwt-payload-of-authenticated-user.md)
111111
+ [Use stateless user provider](src/Resources/doc/stateless-user-provider.md)
112112
+ [Create custom user provider](src/Resources/doc/create-custom-user-provider.md)
113113

src/Resources/doc/create-custom-user-provider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Create custom user provider
22
=============================
33

4-
In case [stateless user provider](stateless-user-provider.md) not fit to your requirements, you can create your own [custom user provider](https://symfony.com/doc/current/security/user_provider.html#creating-a-custom-user-provider)
4+
In cases [stateless user provider](stateless-user-provider.md) not fit for your requirements, you can create your own [custom user provider](https://symfony.com/doc/current/security/user_provider.html#creating-a-custom-user-provider)
55
implement [JWTPayloadAwareUserProviderInterface](/src/User/JWTPayloadAwareUserProviderInterface.php)
66
when you want to create user instance depend on JWT payload.
77
This interface base on Symfony `UserProviderInterface` just add more optional arg `$payload` to `loadUserByIdentifier` method.

src/Resources/doc/stateless-user-provider.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ A stateless user provider
33

44
This feature inspired by the awesome [Lexik JWT Authentication](https://github.com/lexik/LexikJWTAuthenticationBundle) bundle.
55

6-
Stateless user provider help to create user instances from the JWT payload.
6+
Stateless user provider help to create user instances from the JWT payload, avoiding the need to query the database more than once
7+
or in cases user is an identity of first or third party system.
78

89
Configuring the user provider
910
-----------------------------

0 commit comments

Comments
 (0)