Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit ccbc12f

Browse files
authored
chore: update from urface/cli/v2 to v3 and fix a few outdated files (#672)
### **PR Type** Enhancement ___ ### **Description** - Migrate from urfave/cli/v2 to v3 with API changes - Update CLI flag configuration to use Sources instead of EnvVars - Refactor function signatures to use cli.Command instead of cli.Context - Add CLI documentation generation command ___ ### Diagram Walkthrough ```mermaid flowchart LR A["urfave/cli/v2"] --> B["urfave/cli/v3"] B --> C["Updated Flag Configuration"] B --> D["Function Signature Changes"] B --> E["CLI Documentation Generation"] C --> F["EnvVars → Sources"] D --> G["cli.Context → cli.Command"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>10 files</summary><table> <tr> <td><strong>config.go</strong><dd><code>Update config functions for cli/v3 compatibility</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-6ed50c9d309f6e7cf03742253995dfc65ae67702ae9c4aeb650b24a9b87cf377">+46/-46</a>&nbsp; </td> </tr> <tr> <td><strong>db.go</strong><dd><code>Refactor database pool creation for new CLI</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-644e121bc5cd81a5aeca411a3b94f595b16b01f59917f5d2bf604a659e73ccdd">+5/-4</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>email.go</strong><dd><code>Update email configuration and error handling</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-a6364ed092c8bd789262322ec1e0108c274323462a0af0b7c7dd10a07f0bc449">+27/-27</a>&nbsp; </td> </tr> <tr> <td><strong>enum.go</strong><dd><code>Simplify enum value handling and remove helpers</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-0172565db430c88e75447650002d7f88f34d425f694332142dd16350d79c19d3">+8/-29</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>jwt_getter.go</strong><dd><code>Update JWT getter configuration for cli/v3</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-7e1ff4031caa178d9066e3eb8e9055636a219fc8517cac9bcf34c63033586006">+11/-11</a>&nbsp; </td> </tr> <tr> <td><strong>logger.go</strong><dd><code>Refactor logging configuration and flag processing</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-94894c27740fc35b5b4808f22d4a897030db993d1d9343221de51e505594612c">+20/-12</a>&nbsp; </td> </tr> <tr> <td><strong>migrations.go</strong><dd><code>Update migration functions for new CLI interface</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-8902ab7f0135be38b5d4c9e50105df8c79a3f7c4ce73c6006ed9cc751d652a7b">+10/-10</a>&nbsp; </td> </tr> <tr> <td><strong>oauth.go</strong><dd><code>Update OAuth provider configuration functions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-82367f3f24a804b47ced852a588881c0846894bc0edf1ca3bdc6aa5aef7c37b2">+96/-94</a>&nbsp; </td> </tr> <tr> <td><strong>serve.go</strong><dd><code>Major CLI flag migration and server configuration</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-a900f3187c126bacf5c9c5b1745b5d14bc583c01ab8f1ca84ae449751c224b68">+218/-218</a></td> </tr> <tr> <td><strong>main.go</strong><dd><code>Add CLI documentation generation and update app structure</code></dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-2873f79a86c0d8b3335cd7731b0ecf7dd4301eb19a82ef7a1cba7589b5252261">+57/-9</a>&nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Miscellaneous</strong></td><td><details><summary>5 files</summary><table> <tr> <td><strong>add_security_key_test.go</strong><dd><code>Add nolintlint directive to test constant</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-e4bf9e60809ed847fc55d2859540ba867f91b5534f5ea339d689f5a80c832c10">+1/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>elevate_webauthn_test.go</strong><dd><code>Add nolintlint directive to test constant</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-47ef225c96c0aa63c67e926b18c922a14e7ccbd71145ffe646da196d3cc13880">+1/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>sign_in_webauthn_test.go</strong><dd><code>Add nolintlint directive to test constant</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-a920a6aad3937fe5b208622b01177a4b04a182240e113b6fd1a231b12e7ed20f">+1/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>index.html</strong><dd><code>Remove WebAuthn test HTML file</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-0eb547304658805aad788d320f10bf1f292797b5e6d745a3bf617584da017051">+0/-194</a>&nbsp; </td> </tr> <tr> <td><strong>audit-ci.jsonc</strong><dd><code>Remove Node.js audit configuration file</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-4ede69da2a1704e53e08b8d647a315c202f037cc9277f16c94176d9622d261c6">+0/-7</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>7 files</summary><table> <tr> <td><strong>CLAUDE.md</strong><dd><code>Update development guide title and content</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-6ebdb617a8104a7756d0cf36578ab01103dc9f07e4dc6feb751296b9c402faf7">+51/-42</a>&nbsp; </td> </tr> <tr> <td><strong>DEVELOPERS.md</strong><dd><code>Remove outdated Node.js development guide</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-bd017515eb79a7fb7569b1d15e8963ea380123d4fdf779978dd4b3ab7500fd10">+0/-77</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>README.md</strong><dd><code>Update installation and configuration documentation</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5">+11/-9</a>&nbsp; &nbsp; </td> </tr> <tr> <td><strong>SECURITY.md</strong><dd><code>Update security vulnerability reporting URL</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-f6ed156e4bf5c791680662464b94ea5d753f219ee816b385f67870e2c0d7d4c7">+1/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>cli.md</strong><dd><code>Add comprehensive CLI documentation</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-27c8c22b45605a0ddf42ce8017b6b2a68cb3b10534c18bf4a781e230d7b92361">+481/-0</a>&nbsp; </td> </tr> <tr> <td><strong>configuration.md</strong><dd><code>Update configuration documentation references</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-17ed18489a956f326ec0fe4040850c5bc9261d4631fb42da4c52891d74a59180">+1/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>environment-variables.md</strong><dd><code>Remove outdated environment variables documentation</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-24284b831e81f770335038e710187e2feb0c7c3f46148c31fea108516ce1ae59">+0/-127</a>&nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Dependencies</strong></td><td><details><summary>2 files</summary><table> <tr> <td><strong>go.mod</strong><dd><code>Update dependencies for urfave/cli/v3 migration</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+7/-4</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td><strong>go.sum</strong><dd><code>Update dependency checksums for new versions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td> <td><a href="https://github.com/nhost/hasura-auth/pull/672/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+6/-8</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr></tr></tbody></table> </details> ___
1 parent d070758 commit ccbc12f

135 files changed

Lines changed: 8987 additions & 11299 deletions

File tree

Some content is hidden

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

CLAUDE.md

Lines changed: 51 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Nhost Hasura Auth - Go Migration Guide
1+
# Nhost Hasura Auth - Go Development Guide
22

3-
We are migrating from Node.js to Go. This document contains patterns, conventions, and workflows for implementing new endpoints and features.
3+
This document contains patterns, conventions, and workflows for implementing new endpoints and features in the Nhost Hasura Auth Go codebase.
44

55
## Core Principles
66

@@ -14,20 +14,23 @@ We are migrating from Node.js to Go. This document contains patterns, convention
1414
```
1515
go/
1616
├── api/ # OpenAPI specs and generated types
17-
│ ├── openapi.yaml # API specification
17+
│ ├── server.cfg.yaml # oapi-codegen server generation config
18+
│ ├── types.cfg.yaml # oapi-codegen types generation config
1819
│ ├── server.gen.go # Generated server code
1920
│ └── types.gen.go # Generated types
2021
├── controller/ # HTTP handlers and business logic
21-
│ ├── post_*.go # Endpoint handlers
22-
│ ├── *_test.go # Tests
23-
│ ├── workflows.go # Business logic workflows
24-
│ ├── errors.go # Error definitions and handling
25-
│ └── mock/ # Generated mocks
26-
├── sql/ # Database layer
27-
│ ├── query.sql # SQL queries
28-
│ ├── query.sql.go # Generated Go code
29-
│ └── models.go # Database models
30-
└── middleware/ # HTTP middleware
22+
│ ├── sign_in_*.go # Endpoint handlers (following naming pattern)
23+
│ ├── *_test.go # Tests
24+
│ ├── workflows.go # Business logic workflows
25+
│ ├── errors.go # Error definitions and handling
26+
│ ├── controller.go # Main controller and interfaces
27+
│ └── mock/ # Generated mocks
28+
├── sql/ # Database layer
29+
│ ├── query.sql # SQL queries
30+
│ ├── query.sql.go # Generated Go code
31+
│ ├── sqlc.yaml # sqlc configuration
32+
│ └── models.go # Database models
33+
└── middleware/ # HTTP middleware
3134
```
3235

3336
## Implementing New Endpoints
@@ -42,7 +45,7 @@ paths:
4245
post:
4346
summary: Description of what this does
4447
tags:
45-
- your-tag
48+
- authentication # Use existing tags: authentication, security, session, user, system, verification
4649
security:
4750
- BearerAuth: [] # For authenticated endpoints
4851
- {} # For optional auth
@@ -103,7 +106,7 @@ WHERE condition = $1;
103106

104107
### 3. Controller Implementation
105108

106-
Create `go/controller/post_your_endpoint.go`:
109+
Create `go/controller/your_endpoint.go`:
107110

108111
```go
109112
package controller
@@ -115,29 +118,29 @@ import (
115118
"github.com/nhost/hasura-auth/go/middleware"
116119
)
117120
118-
func (ctrl *Controller) PostYourEndpoint( //nolint:ireturn
119-
ctx context.Context, request api.PostYourEndpointRequestObject,
120-
) (api.PostYourEndpointResponseObject, error) {
121+
func (ctrl *Controller) YourEndpoint( //nolint:ireturn
122+
ctx context.Context, request api.YourEndpointRequestObject,
123+
) (api.YourEndpointResponseObject, error) {
121124
logger := middleware.LoggerFromContext(ctx)
122125
123126
// Validate inputs
124127
if apiErr := ctrl.wf.ValidateInput(request.Body.Field, logger); apiErr != nil {
125-
return api.PostYourEndpoint401JSONResponse(ctrl.respondWithError(apiErr)), nil
128+
return ctrl.respondWithError(apiErr), nil
126129
}
127130
128131
// Get authenticated user if needed
129132
user, apiErr := ctrl.wf.GetUserFromJWTInContext(ctx, logger)
130133
if apiErr != nil {
131-
return api.PostYourEndpoint401JSONResponse(ctrl.sendError(ErrUnauthenticatedUser)), nil
134+
return ctrl.sendError(ErrUnauthenticatedUser), nil
132135
}
133136
134137
// Business logic
135138
result, apiErr := ctrl.wf.DoSomething(ctx, user.ID, request.Body.Field, logger)
136139
if apiErr != nil {
137-
return api.PostYourEndpoint401JSONResponse(ctrl.respondWithError(apiErr)), nil
140+
return ctrl.respondWithError(apiErr), nil
138141
}
139142
140-
return api.PostYourEndpoint200JSONResponse(*result), nil
143+
return api.YourEndpoint200JSONResponse(*result), nil
141144
}
142145
```
143146

@@ -186,7 +189,7 @@ func (wf *Workflows) DoSomething(
186189
- Take context, relevant IDs, inputs, and logger as parameters
187190
- Return result and `*APIError` (not Go error)
188191
- Log warnings for user errors, errors for system errors
189-
- Use `pgtype.Text{String: value, Valid: true}` for nullable text fields
192+
- Use `pgtype.Text{String: value, Valid: true}` for nullable text fields or `sql.Text(value)` helper
190193
- Handle `pgx.ErrNoRows` specifically for not found cases
191194

192195
### 5. Error Handling
@@ -211,14 +214,14 @@ If adding new database methods, update `go/controller/controller.go`:
211214

212215
```go
213216
type DBClient interface {
214-
// ... existing methods
217+
// ... existing composed interfaces
215218
YourNewMethod(ctx context.Context, params YourParams) (YourResult, error)
216219
}
217220
```
218221

219222
### 7. Testing
220223

221-
Create `go/controller/post_your_endpoint_test.go`:
224+
Create `go/controller/your_endpoint_test.go`:
222225

223226
```go
224227
package controller_test
@@ -235,12 +238,12 @@ import (
235238
"go.uber.org/mock/gomock"
236239
)
237240
238-
func TestPostYourEndpoint(t *testing.T) {
241+
func TestYourEndpoint(t *testing.T) {
239242
t.Parallel()
240243
241244
userID := uuid.MustParse("db477732-48fa-4289-b694-2886a646b6eb")
242245
243-
cases := []testRequest[api.PostYourEndpointRequestObject, api.PostYourEndpointResponseObject]{
246+
cases := []testRequest[api.YourEndpointRequestObject, api.YourEndpointResponseObject]{
244247
{
245248
name: "success case",
246249
config: getConfig,
@@ -254,12 +257,12 @@ func TestPostYourEndpoint(t *testing.T) {
254257
255258
return mock
256259
},
257-
request: api.PostYourEndpointRequestObject{
260+
request: api.YourEndpointRequestObject{
258261
Body: &api.YourRequest{
259262
Field: "test-value",
260263
},
261264
},
262-
expectedResponse: api.PostYourEndpoint200JSONResponse(expectedResponse),
265+
expectedResponse: api.YourEndpoint200JSONResponse(expectedResponse),
263266
expectedJWT: nil,
264267
jwtTokenFn: nil,
265268
getControllerOpts: []getControllerOptsFunc{},
@@ -276,7 +279,7 @@ func TestPostYourEndpoint(t *testing.T) {
276279
277280
c, _ := getController(t, ctrl, tc.config, tc.db, tc.getControllerOpts...)
278281
279-
resp, err := c.PostYourEndpoint(context.Background(), tc.request)
282+
resp, err := c.YourEndpoint(context.Background(), tc.request)
280283
if err != nil {
281284
t.Fatalf("unexpected error: %v", err)
282285
}
@@ -309,6 +312,10 @@ This generates:
309312
- SQL client code from queries (`sql/query.sql.go`)
310313
- Mocks from interfaces (`controller/mock/`)
311314

315+
**Generation directives**:
316+
- OpenAPI: `//go:generate oapi-codegen -config go/api/server.cfg.yaml docs/openapi.yaml`
317+
- Mocks: `//go:generate mockgen -package mock -destination mock/controller.go --source=controller.go`
318+
312319
## Authentication Patterns
313320

314321
### JWT Authentication
@@ -317,7 +324,7 @@ This generates:
317324
// Get authenticated user
318325
user, apiErr := ctrl.wf.GetUserFromJWTInContext(ctx, logger)
319326
if apiErr != nil {
320-
return api.PostEndpoint401JSONResponse(ctrl.sendError(ErrUnauthenticatedUser)), nil
327+
return ctrl.sendError(ErrUnauthenticatedUser), nil
321328
}
322329
```
323330

@@ -337,6 +344,8 @@ hashedToken := hashRefreshToken([]byte(refreshToken))
337344
338345
// Use proper pgtype for database parameters
339346
pgtype.Text{String: hashedToken, Valid: true}
347+
// Or use helper
348+
sql.Text(hashedToken)
340349
```
341350

342351
## Security Best Practices
@@ -350,7 +359,7 @@ pgtype.Text{String: hashedToken, Valid: true}
350359
## Database Best Practices
351360

352361
1. **Use Transactions**: For multi-step operations
353-
2. **Handle NULL**: Use `pgtype.Text` for nullable fields
362+
2. **Handle NULL**: Use `pgtype.Text` for nullable fields or `sql.Text()` helper
354363
3. **Error Handling**: Always check for `pgx.ErrNoRows`
355364
4. **Parameterized Queries**: Never build SQL strings dynamically
356365
5. **Naming**: Use descriptive query names following existing patterns
@@ -379,10 +388,10 @@ if apiErr := wf.ValidateUser(user, logger); apiErr != nil {
379388

380389
```go
381390
// For client errors (400-level)
382-
return api.PostEndpoint401JSONResponse(ctrl.sendError(ErrInvalidRequest)), nil
391+
return ctrl.sendError(ErrInvalidRequest), nil
383392
384393
// For server errors (500-level)
385-
return api.PostEndpoint401JSONResponse(ctrl.respondWithError(apiErr)), nil
394+
return ctrl.respondWithError(apiErr), nil
386395
```
387396

388397
## Development Workflow
@@ -404,12 +413,12 @@ return api.PostEndpoint401JSONResponse(ctrl.respondWithError(apiErr)), nil
404413
- **Tests**: `go test -v ./...`
405414
- **Coverage**: `go test -v -cover ./...`
406415

407-
## Migration Notes
416+
## Additional Notes
408417

409-
When migrating from Node.js:
410-
1. Check existing Node.js implementation for business logic
411-
2. Identify database operations needed
412-
3. Map validation rules to Go workflows
413-
4. Ensure error codes match existing API
414-
5. Test authentication flows carefully
415-
6. Verify response formats match exactly
418+
When implementing new features:
419+
1. Review existing similar implementations for business logic patterns
420+
2. Identify required database operations and add appropriate queries
421+
3. Follow established validation patterns in workflows
422+
4. Ensure error codes match existing API conventions
423+
5. Test authentication flows thoroughly
424+
6. Verify response formats match API specifications

DEVELOPERS.md

Lines changed: 0 additions & 77 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,19 @@ Use [Nhost](https://nhost.io) to start using Hasura Auth in seconds.
4646

4747
### Using Docker-compose
4848

49+
```sh
50+
git clone https://github.com/nhost/hasura-auth.git
51+
cd hasura-auth/build/docker-compose
52+
docker compose up
53+
```
54+
55+
### Building from Source
56+
4957
```sh
5058
git clone https://github.com/nhost/hasura-auth.git
5159
cd hasura-auth
52-
cp .env.example .env
53-
docker-compose -f docker-compose-example.yaml up
60+
go build -o hasura-auth main.go
61+
./hasura-auth --help
5462
```
5563

5664
## Configuration
@@ -88,16 +96,10 @@ When using asymmetric keys, you can get the JWK Set from the endpoing `.well-kno
8896

8997
## Reference
9098

91-
- List of the available [environment variables](./docs/environment-variables.md).
99+
- CLI options and configuration available in the [CLI documentation](./docs/cli.md).
92100
- The service comes with an [OpenAPI definition](./docs/openapi.yaml) which you can also see [online](https://editor.swagger.io/?url=https://raw.githubusercontent.com/nhost/hasura-auth/main/docs/openapi.yaml).
93101
- [Database Schema](./docs/schema.md)
94102

95-
## 🤝 Contributing
96-
97-
Contributions and issues are welcome. Please have a look at the [developer's guide](./DEVELOPERS.md) if you want to prepare a pull request.
98-
99-
Feel free to check the issues page.
100-
101103
## Show your support
102104

103105
Give a ⭐️ if this project helped you!

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
## Reporting a Vulnerability
44

5-
At Nhost, we take security vulnerabilities seriously and appreciate the assistance of the community in bringing any issues to our attention. If you discover a security vulnerability, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/nhost/hasura-auth/security/advisories/new) tab.
5+
At Nhost, we take security vulnerabilities seriously and appreciate the assistance of the community in bringing any issues to our attention. If you discover a security vulnerability, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/nhost/nhost/security/advisories/new) tab.
66

77
Once you have submitted the report, we will promptly conduct a thorough investigation within 72 hours. In case we need further information, we may contact you for additional details. Rest assured that addressing the reported vulnerability in a timely manner is our top priority.

audit-ci.jsonc

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)