You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Fork the [authorizer](https://github.com/authorizerdev/authorizer) repository (**Skip this step if you have access to repo**)
46
48
2. Clone repo: `git clone https://github.com/authorizerdev/authorizer.git` or use the forked url from step 1
47
-
3. Change directory to authorizer: `cd authorizer`
48
-
4. Create Env file `cp .env.sample .env`. Check all the supported env [here](https://docs.authorizer.dev/core/env/)
49
-
5. Build Dashboard `make build-dashboard`
50
-
6. Build App `make build-app`
51
-
7. Build Server `make clean && make`
52
-
> Note: if you don't have [`make`](https://www.ibm.com/docs/en/aix/7.2?topic=concepts-make-command), you can `cd` into `server` dir and build using the `go build` command. In that case you will have to build `dashboard` & `app` manually using `npm run build` on both dirs.
5. (Optional) Build the web app and dashboard: `make build-app` and `make build-dashboard`
52
+
6. Run locally: `make dev` (uses SQLite and demo secrets for development)
53
+
54
+
> **v2:** The server does **not** read from `.env`. All configuration is passed via CLI arguments. See [MIGRATION.md](../MIGRATION.md).
54
55
55
56
### Updating GraphQL schema
56
57
57
-
- Modify `server/graph/schema.graphqls` file
58
-
- Run `make generate-graphql` this will update the models and required methods
59
-
- If a new mutation or query is added
60
-
- Write the implementation for the new resolver in `server/resolvers/NEW_RESOLVER.GO`
61
-
- Update `server/graph/schema.resolvers.go` with the new resolver method
58
+
- Modify `internal/graph/schema.graphqls` (or other files in `internal/graph/`)
59
+
- Run `make generate-graphql` to regenerate models and resolvers
60
+
- If a new mutation or query is added, implement the resolver in `internal/graph/` (resolver layout follows schema)
62
61
63
62
### Adding support for new database
64
63
65
64
- Run `make generate-db-template dbname=NEW_DB_NAME`
66
-
eg`make generate-db-template dbname=dynamodb`
65
+
- e.g.`make generate-db-template dbname=dynamodb`
67
66
68
-
This command will generate a folder in server/db/providers/ with name specified in the above command.
69
-
One will have to implement methods present in that folder.
67
+
This generates a folder in `internal/storage/db/` with the specified name. Implement the methods in that folder.
70
68
71
-
> Note: Connection for database and schema changes are written in `server/db/providers/DB_NAME/provider.go` > `NewProvider`method is called for any given db based on the env variables present.
69
+
> Note: Database connection and schema changes are in `internal/storage/db/DB_NAME/provider.go`; `NewProvider` is called for the configured database type.
72
70
73
71
### Testing
74
72
75
-
Make sure you test before creating PR.
76
-
77
-
If you want to test for all the databases that authorizer supports you will have to run `mongodb` & `arangodb` instances locally.
73
+
Make sure you test before creating a PR.
78
74
79
-
Setup mongodb & arangodb using Docker
75
+
The main `make test` target spins up Postgres, Redis, ScyllaDB, MongoDB, ArangoDB, DynamoDB, and Couchbase via Docker, runs the Go test suite, then tears down containers.
80
76
81
-
```
82
-
docker run --name mongodb -d -p 27017:27017 mongo
77
+
For local development without full DB matrix:
83
78
84
-
// -e ARANGO_ROOT_PASSWORD=root
85
-
docker run --name arangodb -d -p 8529:8529 -e ARANGO_NO_AUTH=1 arangodb/arangodb:3.8.4
79
+
```sh
80
+
make dev # run server for manual testing
81
+
go test -v ./... # run tests (requires Docker for full suite)
86
82
```
87
83
88
-
> Note: If you are not making any changes in db schema / db operations, you can disable those db tests [here](https://github.com/authorizerdev/authorizer/blob/main/server/__test__/resolvers_test.go#L14)
89
-
90
-
If you are adding new resolver,
84
+
If you are adding a new resolver:
91
85
92
-
1. create new resolver test file [here](https://github.com/authorizerdev/authorizer/tree/main/server/__test__)
93
-
Naming convention filename: `resolver_name_test.go` function name: `resolverNameTest(t *testing.T, s TestSetup)`
94
-
2. Add your tests [here](https://github.com/authorizerdev/authorizer/blob/main/server/__test__/resolvers_test.go#L38)
86
+
1. Create a new test file in `internal/integration_tests/` (naming: `resolver_name_test.go`)
87
+
2. Follow the existing pattern using `getTestConfig()` and `initTestSetup()`
All notable changes to Authorizer will be documented in this file.
4
+
5
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+
## [2.0.0] - 2025-02-28
9
+
10
+
### Added
11
+
12
+
-**CLI-based configuration**: All configuration is now passed at server start via CLI root arguments. No env store in cache or database.
13
+
-**New security flags**:
14
+
-`--disable-admin-header-auth`: When `true`, server does not accept `X-Authorizer-Admin-Secret` header; only secure admin cookie is honored. Recommended for production.
15
+
-`--enable-graphql-introspection`: Controls GraphQL introspection on `/graphql` (default `true`; set `false` for hardened production).
16
+
-**Metrics endpoint**: Metrics server on port 8081 (configurable via `--metrics-port`).
17
+
-**Restructured project layout**:
18
+
- Root-level `main.go` and `cmd/` for CLI
19
+
-`internal/` for core packages (config, graph, storage, etc.)
20
+
-`web/app` and `web/dashboard` for embedded UIs
21
+
-`web/templates` for HTML templates
22
+
-**Build outputs**: Binary named `authorizer`; output to `build/<os>/<arch>/authorizer`.
23
+
-**Docker improvements**:
24
+
- Multi-arch builds (linux/amd64, linux/arm64)
25
+
-`ENTRYPOINT [ "./authorizer" ]` for passing CLI args at runtime
- Corrected Makefile `generate-db-template` and DB-specific test targets to use current project structure.
51
+
- Docker build and release workflow updated for v2 layout and binary name.
52
+
53
+
### Migration
54
+
55
+
See [MIGRATION.md](MIGRATION.md) for a detailed guide from v1 to v2.
56
+
57
+
---
58
+
59
+
## [1.x] - Legacy
60
+
61
+
Authorizer v1 used environment-based configuration stored in cache/DB and configurable via dashboard or `_update_env` mutation. For v1 documentation, see [docs.authorizer.dev](https://docs.authorizer.dev/) and the [v1 release branch](https://github.com/authorizerdev/authorizer).
0 commit comments