Skip to content

Commit 510ab8f

Browse files
authored
CoSec : RBAC-based And Policy-based Multi-Tenant Security Framework (#1)
* CoSec : RBAC-based And Policy-based Multi-Tenant Security Framework
1 parent 5b9be45 commit 510ab8f

File tree

227 files changed

+10051
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+10051
-1
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: "\U0001F41B Bug Report"
3+
about: Something isn't working as expected
4+
---
5+
6+
## Bug Report
7+
8+
Before report a bug, make sure you have:
9+
10+
- Searched open and closed [GitHub issues](https://github.com/Ahoo-Wang/CoSec/issues).
11+
12+
Please pay attention on issues you submitted, because we maybe need more details.
13+
If no response anymore and we cannot reproduce it on current information, we will **close it**.
14+
15+
Please answer these questions before submitting your issue. Thanks!
16+
17+
### Which version of CoSec did you use?
18+
19+
### Expected behavior
20+
21+
### Actual behavior
22+
23+
### Reason analyze (If you can)
24+
25+
### Steps to reproduce the behavior
26+
27+
### Example codes for reproduce this issue (such as a github link).
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Fixes #ISSUSE_ID.
2+
3+
Changes proposed in this pull request:
4+
-
5+
-
6+
-

.github/workflows/codecov.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Codecov
2+
on:
3+
push:
4+
paths-ignore:
5+
- 'document/**'
6+
- 'cosec-gateway-server/**'
7+
pull_request:
8+
paths-ignore:
9+
- 'document/**'
10+
- 'cosec-gateway-server/**'
11+
12+
jobs:
13+
codecov:
14+
name: Codecov
15+
runs-on: ubuntu-latest
16+
env:
17+
CODECOV: true
18+
services:
19+
redis:
20+
image: redis
21+
options: >-
22+
--health-cmd "redis-cli ping"
23+
--health-interval 10s
24+
--health-timeout 5s
25+
--health-retries 5
26+
ports:
27+
- 6379:6379
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@master
32+
33+
- name: Set up JDK 8
34+
uses: actions/setup-java@v3
35+
with:
36+
java-version: '8'
37+
distribution: 'adopt'
38+
server-id: github
39+
settings-path: ${{ github.workspace }}
40+
41+
- name: Check
42+
run: gradle check
43+
44+
- name: Build Code Coverage Report
45+
run: gradle codeCoverageReport
46+
47+
- name: Upload Code Coverage Report to Codecov
48+
uses: codecov/codecov-action@v3
49+
with:
50+
token: ${{ secrets.CODECOV_TOKEN }}
51+
flags: unittests # optional
52+
name: codecov-umbrella # optional
53+
fail_ci_if_error: true # optional (default = false)
54+
verbose: true # optional (default = false)
55+
# directory: ./build/reports/jacoco/codeCoverageReport/
56+
files: ./build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml
57+
path_to_write_report: ./coverage/codecov_report.txt

.github/workflows/docker-deploy.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#
2+
# Copyright [2021-present] [ahoo wang <[email protected]> (https://github.com/Ahoo-Wang)].
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
#
13+
14+
name: Docker Image Deploy
15+
on:
16+
schedule:
17+
- cron: '0 10 * * *'
18+
push:
19+
branches:
20+
- '**'
21+
tags:
22+
- 'v*.*.*'
23+
pull_request:
24+
branches:
25+
- 'main'
26+
jobs:
27+
docker-deploy:
28+
name: Push Docker image
29+
runs-on: ubuntu-latest
30+
permissions:
31+
contents: read
32+
packages: write
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@master
36+
- name: Set up JDK 8
37+
uses: actions/setup-java@v3
38+
with:
39+
java-version: '8'
40+
distribution: 'adopt'
41+
server-id: github
42+
settings-path: ${{ github.workspace }}
43+
44+
- name: Build Dist
45+
run: gradle cosec-gateway-server:installDist
46+
47+
- name: Set up QEMU
48+
uses: docker/setup-qemu-action@v2
49+
50+
- name: Set up Docker Buildx
51+
uses: docker/setup-buildx-action@v2
52+
53+
- name: Login to DockerHub
54+
uses: docker/login-action@v2
55+
with:
56+
username: ${{ secrets.DOCKERHUB_USERNAME }}
57+
password: ${{ secrets.DOCKERHUB_TOKEN }}
58+
59+
- name: Login to GHCR
60+
uses: docker/login-action@v2
61+
with:
62+
registry: ghcr.io
63+
username: ${{ github.repository_owner }}
64+
password: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- name: Docker meta
67+
id: meta
68+
uses: docker/metadata-action@v4
69+
with:
70+
images: |
71+
ahoowang/cosec-gateway
72+
ghcr.io/ahoo-wang/cosec-gateway
73+
tags: |
74+
type=ref,event=branch
75+
type=ref,event=pr
76+
type=semver,pattern={{version}}
77+
type=semver,pattern={{major}}.{{minor}}
78+
79+
- name: Build and push
80+
uses: docker/build-push-action@v3
81+
with:
82+
platforms: linux/amd64,linux/arm64
83+
context: cosec-gateway-server
84+
push: true
85+
tags: ${{ steps.meta.outputs.tags }}
86+
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
#
2+
# Copyright [2021-present] [ahoo wang <[email protected]> (https://github.com/Ahoo-Wang)].
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
#
13+
14+
name: Integration Test
15+
on: [ push, pull_request ]
16+
jobs:
17+
cosec-core-test:
18+
name: CoSec Core Test
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@master
23+
24+
- name: Set up JDK 8
25+
uses: actions/setup-java@v3
26+
with:
27+
java-version: '8'
28+
distribution: 'adopt'
29+
server-id: github
30+
settings-path: ${{ github.workspace }}
31+
32+
- name: Test CoSec-Core
33+
run: gradle cosec-core:clean cosec-core:check
34+
35+
cosec-jwt-test:
36+
name: CoSec Jwt Test
37+
needs: [ cosec-core-test ]
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@master
42+
43+
- name: Set up JDK 8
44+
uses: actions/setup-java@v3
45+
with:
46+
java-version: '8'
47+
distribution: 'adopt'
48+
server-id: github
49+
settings-path: ${{ github.workspace }}
50+
51+
- name: Test CoSec-Jwt
52+
run: gradle cosec-jwt:clean cosec-jwt:check
53+
54+
cosec-oauth-test:
55+
name: CoSec OAuth Test
56+
needs: [ cosec-core-test ]
57+
runs-on: ubuntu-latest
58+
services:
59+
redis:
60+
image: redis
61+
options: >-
62+
--health-cmd "redis-cli ping"
63+
--health-interval 10s
64+
--health-timeout 5s
65+
--health-retries 5
66+
ports:
67+
- 6379:6379
68+
steps:
69+
- name: Checkout
70+
uses: actions/checkout@master
71+
72+
- name: Set up JDK 8
73+
uses: actions/setup-java@v3
74+
with:
75+
java-version: '8'
76+
distribution: 'adopt'
77+
server-id: github
78+
settings-path: ${{ github.workspace }}
79+
80+
- name: Test CoSec-OAuth
81+
run: gradle cosec-oauth:clean cosec-oauth:check
82+
83+
cosec-redis-test:
84+
name: CoSec Redis Test
85+
needs: [ cosec-core-test ]
86+
runs-on: ubuntu-latest
87+
services:
88+
redis:
89+
image: redis
90+
options: >-
91+
--health-cmd "redis-cli ping"
92+
--health-interval 10s
93+
--health-timeout 5s
94+
--health-retries 5
95+
ports:
96+
- 6379:6379
97+
steps:
98+
- name: Checkout
99+
uses: actions/checkout@master
100+
101+
- name: Set up JDK 8
102+
uses: actions/setup-java@v3
103+
with:
104+
java-version: '8'
105+
distribution: 'adopt'
106+
server-id: github
107+
settings-path: ${{ github.workspace }}
108+
109+
- name: Test CoSec-Redis
110+
run: gradle cosec-redis:clean cosec-redis:check
111+
112+
cosec-webflux-test:
113+
name: CoSec WebFlux Test
114+
needs: [ cosec-core-test ]
115+
runs-on: ubuntu-latest
116+
steps:
117+
- name: Checkout
118+
uses: actions/checkout@master
119+
120+
- name: Set up JDK 8
121+
uses: actions/setup-java@v3
122+
with:
123+
java-version: '8'
124+
distribution: 'adopt'
125+
server-id: github
126+
settings-path: ${{ github.workspace }}
127+
128+
- name: Test CoSec-WebFlux
129+
run: gradle cosec-webflux:clean cosec-webflux:check
130+
131+
cosec-webmvc-test:
132+
name: CoSec WebMvc Test
133+
needs: [ cosec-core-test ]
134+
runs-on: ubuntu-latest
135+
steps:
136+
- name: Checkout
137+
uses: actions/checkout@master
138+
139+
- name: Set up JDK 8
140+
uses: actions/setup-java@v3
141+
with:
142+
java-version: '8'
143+
distribution: 'adopt'
144+
server-id: github
145+
settings-path: ${{ github.workspace }}
146+
147+
- name: Test CoSec-WebMvc
148+
run: gradle cosec-webmvc:clean cosec-webmvc:check
149+
150+
cosec-spring-boot-starter-test:
151+
name: CoSec Spring Boot Starter Test
152+
needs: [ cosec-core-test ]
153+
runs-on: ubuntu-latest
154+
services:
155+
redis:
156+
image: redis
157+
options: >-
158+
--health-cmd "redis-cli ping"
159+
--health-interval 10s
160+
--health-timeout 5s
161+
--health-retries 5
162+
ports:
163+
- 6379:6379
164+
steps:
165+
- name: Checkout
166+
uses: actions/checkout@master
167+
168+
- name: Set up JDK 8
169+
uses: actions/setup-java@v3
170+
with:
171+
java-version: '8'
172+
distribution: 'adopt'
173+
server-id: github
174+
settings-path: ${{ github.workspace }}
175+
176+
- name: Test CoSec-Spring-Boot-Starter
177+
run: gradle cosec-spring-boot-starter:clean cosec-spring-boot-starter:check

0 commit comments

Comments
 (0)