https://github.com/sivaosorg/unused-ngx-blobs-o2jwt
Config middleware resource server validate authentication token / jwt / user-detail
https://github.com/sivaosorg/unused-ngx-blobs-o2jwt
middleware-dispatchers resource-allocation resource-migration resource-modeling resource-server
Last synced: 3 months ago
JSON representation
Config middleware resource server validate authentication token / jwt / user-detail
- Host: GitHub
- URL: https://github.com/sivaosorg/unused-ngx-blobs-o2jwt
- Owner: sivaosorg
- Created: 2022-01-01T06:37:14.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-17T10:30:48.000Z (over 2 years ago)
- Last Synced: 2025-01-12T10:09:41.962Z (4 months ago)
- Topics: middleware-dispatchers, resource-allocation, resource-migration, resource-modeling, resource-server
- Language: Java
- Homepage: https://github.com/sivaosorg/ngx-blobs-o2jwt
- Size: 103 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Config middleware resource server
The base library including validate authentication token / jwt / user-detail / permit / deny endpoints
## ⚡️ Quick start
Build application:
```bash
/bin/bash gradlew jar
```
> output jar: ngx-blobs-o2jwt-1.0.0.jar## :rocket: Functions
#### Config endpoints resource
:package: add file [`application-rss.yml`](src/main/resources/application-rss.yml)
```yml
spring:
resource-server-starter:
enabled: true # enable resources server, default is true
resource-id: product-api # set resources_id
jwt-key: '' # set key to encode token, default is empty (using key system)
endpoints-permitted:
- enabled: true
endpoint-short-url: '/swagger-ui.html'
endpoint-regex: ''
endpoint-description: API list all endpoints via swagger
- enabled: true
endpoint-short-url: '/publish/event/**'
endpoint-regex: ''
endpoint-description: Uri websocket to publish event
- enabled: false
endpoint-short-url: '/api/v1/users/redis/heartbeat/123?value=1&value1=2'
endpoint-regex: '/api/v1/users/redis/heartbeat/123{1}.*'
endpoint-description: Uri routes API endpoint staging
endpoints-denied:
- enabled: true
endpoint-short-url: '/api/v1/admin/**'
endpoint-regex: ''
endpoint-description: API admin
- enabled: false
endpoint-short-url: '/api/v1/configs/**'
endpoint-regex: ''
endpoint-description: API configs system
- enabled: false
endpoint-short-url: '/api/v1/redis-props/keys'
endpoint-regex: ''
endpoint-description: API redis props
```#### Config re-callback check token from OAuth2.0
:package: checkout file [`application-params.yml`](src/main/resources/application-params.yml)
```yml
# ////////////////////////////
# Config Resource Attributes
# ////////////////////////////
---
spring:
resource-server-callback-starter:
enabled: false # enable check token from OAuth2.0, default is false# ////////////////////////////
# Config Application Attributes
# ////////////////////////////
---
spring:
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: Asia/Ho_Chi_Minh# ////////////////////////////
# Config Cors Attributes
# ////////////////////////////
---
spring:
cors-starter:
enabled: false
allow-credentials: true
max-age-in-seconds: 1800
allowed-origins:
- * # default is any origins
allowed-headers: # default (*) is any headers
- Authorization
- Requestor-Type
allowed-methods:
- * # default is any methods (GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE)
exposed-headers: # not allowed for *
- X-Get-Header
- Access-Control-Expose-Headers
```:package: checkout file [`application-dev.yml`](src/main/resources/application-dev.yml), [`application-local.yml`](src/main/resources/application-dev.yml), [`application-prod.yml`](src/main/resources/application-dev.yml)
```yml
# ////////////////////////////
# Config Resource Attributes
# ////////////////////////////
---
spring:
resource-server-callback-starter:
host-auth: http://localhost:8083 # host OAuth2.0
```