Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore (docs): run docgen #413

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ get-version: ## Return version.


.PHONY: dev
dev: check-port install dev-env-up ## Start development environment.
dev: check-port dev-env-up ## Start development environment.
bash -c "trap 'make dev-env-down' EXIT; pnpm dev:start"


.PHONY: test
test: check-port install dev-env-up ## Run end-to-end tests.
test: check-port dev-env-up ## Run end-to-end tests.
pnpm test

.PHONY: check-port
check-port:
[ -z $$(lsof -t -i tcp:$(PORT)) ] || (echo "The port $(PORT) is already in use"; exit 1;)

.PHONY: docgen
docgen: check-port install dev-env-up ## Generate the openapi.json file.
docgen: check-port dev-env-up ## Generate the openapi.json file.
AUTH_CLIENT_URL=https://my-app.com AUTH_LOG_LEVEL=error AUTH_ACCESS_CONTROL_ALLOWED_REDIRECT_URLS= pnpm dev &
while [ "$$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:$(PORT)/healthz)" != "200" ]; do sleep 1; done
curl http://localhost:$(PORT)/openapi.json | json_pp > docs/openapi.json
Expand All @@ -45,28 +45,27 @@ docgen: check-port install dev-env-up ## Generate the openapi.json file.


.PHONY: watch
watch: check-port install dev-env-up ## Start tests in watch mode.
watch: check-port dev-env-up ## Start tests in watch mode.
bash -c "trap 'make dev-env-down' EXIT; pnpm test:watch"


.PHONY: build
build:
build:
docker build -t $(IMAGE) .


.PHONY: dev-env-down
.PHONY: dev-env-down
dev-env-up: ## Start required services (Hasura, Postgres, Mailhog).
docker-compose -f docker-compose.yaml up -d
docker compose -f docker-compose.yaml up -d
while [ "$$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/healthz)" != "200" ]; do sleep 1; done
@echo "Hasura is ready";


.PHONY: dev-env-down
dev-env-down: ## Stop required services (Hasura, Posgres, Mailhbg).
docker-compose -f docker-compose.yaml down
docker compose -f docker-compose.yaml down


.PHONY: install
install:
install:
pnpm install

156 changes: 153 additions & 3 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"status" : {
"enum" : [
404
409
]
}
},
Expand Down Expand Up @@ -232,6 +232,27 @@
},
"type" : "object"
},
"InvalidExpiryDateError" : {
"additionalProperties" : false,
"properties" : {
"error" : {
"enum" : [
"invalid-expiry-date"
]
},
"message" : {
"enum" : [
"The expiry date must be greater than the current date"
]
},
"status" : {
"enum" : [
400
]
}
},
"type" : "object"
},
"InvalidOauthConfigurationError" : {
"additionalProperties" : false,
"properties" : {
Expand Down Expand Up @@ -274,6 +295,27 @@
},
"type" : "object"
},
"InvalidPatError" : {
"additionalProperties" : false,
"properties" : {
"error" : {
"enum" : [
"invalid-pat"
]
},
"message" : {
"enum" : [
"Invalid or expired personal access token"
]
},
"status" : {
"enum" : [
401
]
}
},
"type" : "object"
},
"InvalidRefreshTokenError" : {
"additionalProperties" : false,
"properties" : {
Expand Down Expand Up @@ -1479,7 +1521,7 @@
"type" : "object"
},
"Version" : {
"example" : "0.17.1",
"example" : "0.21.2",
"type" : "string"
}
},
Expand All @@ -1498,7 +1540,7 @@
},
"termsOfService" : "",
"title" : "Hasura auth",
"version" : "0.17.1"
"version" : "0.21.2"
},
"openapi" : "3.0.0",
"paths" : {
Expand Down Expand Up @@ -1565,6 +1607,60 @@
]
}
},
"/pat" : {
"post" : {
"deprecated" : false,
"parameters" : [],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/CreatePATSchema"
}
}
},
"description" : "",
"required" : true
},
"responses" : {
"200" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/SessionModel"
}
}
},
"description" : "User successfully authenticated"
},
"400" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/InvalidRequestError"
}
}
},
"description" : "The payload is invalid"
},
"401" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/UnauthorizedError"
}
}
},
"description" : "Unauthenticated user or invalid token"
}
},
"security" : [],
"summary" : "Create a Personal Access Token (PAT)",
"tags" : [
"General"
]
}
},
"/signin/anonymous" : {
"post" : {
"deprecated" : false,
Expand Down Expand Up @@ -1919,6 +2015,60 @@
]
}
},
"/signin/pat" : {
"post" : {
"deprecated" : false,
"parameters" : [],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/SignInPATSchema"
}
}
},
"description" : "",
"required" : true
},
"responses" : {
"200" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/SessionPayload"
}
}
},
"description" : "User successfully authenticated"
},
"400" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/InvalidRequestError"
}
}
},
"description" : "The payload is invalid"
},
"404" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/DisabledEndpointError"
}
}
},
"description" : "The feature is not activated"
}
},
"security" : [],
"summary" : "Sign in with a Personal Access Token (PAT)",
"tags" : [
"Authentication"
]
}
},
"/signin/provider/{provider}" : {
"get" : {
"deprecated" : false,
Expand Down
77 changes: 77 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading