-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make guardian multi-tenant using postgres RLS (#389)
* feat: adding multi-tenancy in the application - using namespace_id in the database to shard different tenants - default namespace id will be a nil id, this will ensure if this app is not used in multi-tenant envs, it still works as usual Signed-off-by: Kush Sharma <[email protected]> * fixed postgres repositories to use namespace id Signed-off-by: Kush Sharma <[email protected]> --------- Signed-off-by: Kush Sharma <[email protected]>
- Loading branch information
1 parent
9954153
commit 5c8a46d
Showing
50 changed files
with
3,445 additions
and
1,183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
tmp | ||
guardian.yml | ||
guardian.yaml | ||
config.yaml | ||
config.yml | ||
.git | ||
.github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Main | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
dev: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20" | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: docker.io | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Publish dev image | ||
id: docker_dev_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
file: "./Dockerfile.dev" | ||
tags: raystack/guardian:dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM golang:1.20-alpine3.17 as builder | ||
|
||
RUN apk add make | ||
|
||
WORKDIR /go/src/app | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN make build | ||
|
||
FROM alpine:3.17 | ||
COPY --from=builder /go/src/app/dist/guardian /usr/bin/guardian | ||
RUN apk update | ||
RUN apk add ca-certificates | ||
|
||
# glibc compatibility library, since go binaries | ||
# don't work well with musl libc that alpine uses | ||
RUN apk add libc6-compat | ||
|
||
EXPOSE 8080 | ||
ENTRYPOINT ["./guardian"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.