Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
05b4c3c
Update project struct
lakhansamani Oct 13, 2024
3f55e5f
fix: modify models
lakhansamani Nov 11, 2024
47eea51
fix: config & deps
lakhansamani Nov 18, 2024
3d66c46
update twilio provider
lakhansamani Nov 18, 2024
86c347c
feat: add common config + jwt provider
lakhansamani Dec 18, 2024
d2a3400
fix: warning
lakhansamani Dec 18, 2024
5ac2ac7
fix: setup dependency injection
lakhansamani Dec 19, 2024
2f31e48
chore: update all services
lakhansamani Jan 6, 2025
ec5aa48
chore: update graphql + http handler
lakhansamani Jan 7, 2025
f19438a
chore: fix remove logrus
lakhansamani Jan 7, 2025
a44eefe
chore: add logs for gql
lakhansamani Jan 7, 2025
fd4e983
chore: update encryption and make clientID & secret required
lakhansamani Feb 4, 2025
1ef6da6
chore: fix db tests
lakhansamani Apr 4, 2025
653e48c
chore: fix couchbase db test
lakhansamani Apr 4, 2025
7c57b92
chore: add test for memory store
lakhansamani Apr 4, 2025
f6d749d
chore: add test for magic link login
lakhansamani Apr 4, 2025
616a321
chore: add test for logout
lakhansamani Apr 7, 2025
eaa42d5
chore: add test for update profile
lakhansamani Apr 7, 2025
bcf2ab1
chore: add test for verify email
lakhansamani Apr 7, 2025
ab18f54
chore: add test for resend verify email
lakhansamani Apr 8, 2025
3a27638
chore: add test for forgot password
lakhansamani Apr 18, 2025
0528ba8
chore: add admin login and update user
lakhansamani Apr 18, 2025
5d69711
chore: add reset password test
lakhansamani Apr 22, 2025
e67ac9d
chore: add test for revoke gql
lakhansamani Apr 23, 2025
1e723ed
chore: fix http handler
lakhansamani Apr 23, 2025
fa1d239
chore add test for verify otp
lakhansamani Apr 26, 2025
1d1af6f
chore: add test for resend otp
lakhansamani Apr 26, 2025
568aa8f
chore: add test for account deactivation
lakhansamani Apr 26, 2025
4c44969
added admin integration tests
lemonnn-8 Apr 26, 2025
526ae5a
chore: add session test
lakhansamani May 10, 2025
7f77ba1
Merge pull request #468 from lemonnn-8/admin-test-cases
lakhansamani May 10, 2025
5b48761
chore: add profile test
lakhansamani May 10, 2025
c1c0ca7
chore: standardize params
lakhansamani May 10, 2025
bc2f06f
chore: add test for validate session
lakhansamani May 10, 2025
2381ec4
chore: add oauth config
lakhansamani May 19, 2025
4e7818e
chore: add logs deps
lakhansamani May 23, 2025
329a810
chore: fix add jwk config
lakhansamani May 23, 2025
c39a298
chore: fix context
lakhansamani May 23, 2025
dd7528d
chore: update web apps
lakhansamani Dec 31, 2025
002eca2
chore: delete node_modules
lakhansamani Dec 31, 2025
efdb8d6
chore: update gitignore
lakhansamani Dec 31, 2025
e36eaf4
chore: fix vulnerabilities
lakhansamani Jan 9, 2026
efa89e3
fix docker build
lakhansamani Jan 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 8 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ ROADMAP.md
build
.env
data.db
app/node_modules
app/build
web/app/node_modules
web/app/build
web/app/.vite
web/dashboard/node_modules
web/dashboard/build
web/dashboard/.vite
certs/
*.log
.DS_Store
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
server/server
server/.env
data
app/node_modules
app/build
dashboard/node_modules
dashboard/build
web/app/node_modules
web/app/build
web/dashboard/node_modules
web/dashboard/build
build
.env
data.db
Expand All @@ -20,3 +20,4 @@ certs/
*-wal
.idea
*.iml
node_modules/*
61 changes: 40 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,54 @@
FROM golang:1.21.3-alpine3.18 as go-builder
FROM golang:1.25.5-alpine3.23 as go-builder
WORKDIR /authorizer
COPY server server
COPY Makefile .

# Copy go mod files for dependency resolution
COPY go.mod go.sum ./

# Download dependencies
RUN go mod download

# Copy source code
COPY main.go ./
COPY cmd/ ./cmd/
COPY internal/ ./internal/
COPY gqlgen.yml ./

ARG VERSION="latest"
ENV VERSION="$VERSION"

RUN echo "$VERSION"
RUN apk add build-base &&\
make clean && make && \
# Build the server binary
RUN apk add build-base && \
go build -ldflags "-w -X main.VERSION=$(VERSION)" -o build/server . && \
chmod 777 build/server

FROM node:20-alpine3.18 as node-builder
FROM node:25-alpine3.22 as node-builder
WORKDIR /authorizer
COPY app app
COPY dashboard dashboard
COPY Makefile .
RUN apk add build-base &&\
make build-app && \
make build-dashboard
# Copy package files first for better layer caching
COPY web/app/package*.json web/app/
COPY web/dashboard/package*.json web/dashboard/
# Install dependencies
RUN cd web/app && npm ci && \
cd ../dashboard && npm ci
# Copy source files
COPY web/app web/app
COPY web/dashboard web/dashboard
# Build applications
RUN cd web/app && npm run build && \
cd ../dashboard && npm run build

FROM alpine:3.18
FROM alpine:3.23
RUN adduser -D -h /authorizer -u 1000 -k /dev/null authorizer
WORKDIR /authorizer
RUN mkdir app dashboard
COPY --from=node-builder --chown=nobody:nobody /authorizer/app/build app/build
COPY --from=node-builder --chown=nobody:nobody /authorizer/app/favicon_io app/favicon_io
COPY --from=node-builder --chown=nobody:nobody /authorizer/dashboard/build dashboard/build
COPY --from=node-builder --chown=nobody:nobody /authorizer/dashboard/favicon_io dashboard/favicon_io
RUN mkdir -p web/app web/dashboard
COPY --from=node-builder --chown=nobody:nobody /authorizer/web/app/build web/app/build
COPY --from=node-builder --chown=nobody:nobody /authorizer/web/app/favicon_io web/app/favicon_io
COPY --from=node-builder --chown=nobody:nobody /authorizer/web/dashboard/build web/dashboard/build
COPY --from=node-builder --chown=nobody:nobody /authorizer/web/dashboard/favicon_io web/dashboard/favicon_io
COPY --from=go-builder --chown=nobody:nobody /authorizer/build build
COPY templates templates
EXPOSE 8080
COPY web/templates web/templates
EXPOSE 8080 8081
USER authorizer
CMD [ "./build/server" ]
# Use ENTRYPOINT to allow passing CLI arguments
ENTRYPOINT [ "./build/server" ]
CMD []
36 changes: 32 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,41 @@ build:
-output="../build/{{.OS}}/{{.Arch}}/server" \
./...
build-app:
cd app && npm i && npm run build
cd web/app && npm ci && npm run build
build-dashboard:
cd dashboard && npm i && npm run build
cd web/dashboard && npm ci && npm run build
clean:
rm -rf build
dev:
go run main.go --database-type=sqlite --database-url=test.db --jwt-type=HS256 --jwt-secret=test --admin-secret=admin --client-id=123456 --client-secret=secret
# test:
# rm -rf server/test/test.db server/test/test.db-shm server/test/test.db-wal && rm -rf test.db test.db-shm test.db-wal && cd server && go clean --testcache && TEST_DBS="sqlite" go test -p 1 -v ./test
test:
rm -rf server/test/test.db server/test/test.db-shm server/test/test.db-wal && rm -rf test.db test.db-shm test.db-wal && cd server && go clean --testcache && TEST_DBS="sqlite" go test -p 1 -v ./test
docker rm -vf authorizer_postgres
docker rm -vf authorizer_scylla_db
docker rm -vf authorizer_mongodb_db
docker rm -vf authorizer_arangodb
docker rm -vf authorizer_dynamodb
docker rm -vf authorizer_couchbase
docker rm -vf authorizer_redis
docker run -d --name authorizer_redis -p 6380:6379 redis
docker run --name authorizer_postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres -d postgres
docker run -d --name authorizer_scylla_db -p 9042:9042 scylladb/scylla
docker run -d --name authorizer_mongodb_db -p 27017:27017 mongo:4.4.15
docker run -d --name authorizer_arangodb -p 8529:8529 -e ARANGO_NO_AUTH=1 arangodb/arangodb:3.10.3
docker run -d --name authorizer_dynamodb -p 8000:8000 amazon/dynamodb-local:latest
docker run -d --name authorizer_couchbase -p 8091-8097:8091-8097 -p 11210:11210 -p 11207:11207 -p 18091-18095:18091-18095 -p 18096:18096 -p 18097:18097 couchbase:latest
sh scripts/couchbase-test.sh

go test -v ./...

docker rm -vf authorizer_postgres
docker rm -vf authorizer_scylla_db
docker rm -vf authorizer_mongodb_db
docker rm -vf authorizer_arangodb
docker rm -vf authorizer_dynamodb
docker rm -vf authorizer_couchbase
docker rm -vf authorizer_redis
test-mongodb:
docker run -d --name authorizer_mongodb_db -p 27017:27017 mongo:4.4.15
cd server && go clean --testcache && TEST_DBS="mongodb" go test -p 1 -v ./test
Expand Down Expand Up @@ -53,7 +81,7 @@ test-all-db:
docker rm -vf dynamodb-local-test
docker rm -vf couchbase-local-test
generate-graphql:
cd server && go run github.com/99designs/gqlgen generate && go mod tidy
go run github.com/99designs/gqlgen --verbose generate && go mod tidy
generate-db-template:
cp -rf server/db/providers/provider_template server/db/providers/${dbname}
find server/db/providers/${dbname} -type f -exec sed -i -e 's/provider_template/${dbname}/g' {} \;
55 changes: 0 additions & 55 deletions ROADMAP.md

This file was deleted.

49 changes: 0 additions & 49 deletions TODO.md

This file was deleted.

11 changes: 0 additions & 11 deletions app/esbuild.config.js

This file was deleted.

Loading