Skip to content

Commit

Permalink
fix: only respect required modules for SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Oct 24, 2021
1 parent 884e031 commit 4c5677f
Show file tree
Hide file tree
Showing 74 changed files with 1,198 additions and 9,307 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ test-coverage: .bin/go-acc .bin/goveralls
.PHONY: sdk
sdk: .bin/swagger .bin/ory node_modules
swagger generate spec -m -o spec/swagger.json \
-x github.com/ory/kratos-client-go \
-x github.com/ory/dockertest
-c github.com/ory/kratos \
-c github.com/ory/x/healthx
ory dev swagger sanitize ./spec/swagger.json
swagger validate ./spec/swagger.json
CIRCLE_PROJECT_USERNAME=ory CIRCLE_PROJECT_REPONAME=kratos \
Expand All @@ -99,7 +99,7 @@ sdk: .bin/swagger .bin/ory node_modules
-p file://.schema/openapi/patches/generic_error.yaml \
spec/swagger.json spec/api.json

rm -rf internal/httpclient/models internal/httpclient/clients
rm -rf internal/httpclient
mkdir -p internal/httpclient/
npm run openapi-generator-cli -- generate -i "spec/api.json" \
-g go \
Expand Down
3 changes: 2 additions & 1 deletion internal/httpclient/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gitignore
.openapi-generator-ignore
.travis.yml
README.md
api/openapi.yaml
Expand Down Expand Up @@ -99,7 +100,7 @@ model_inline_response_200.go
model_inline_response_200_1.go
model_inline_response_503.go
model_json_error.go
model_session_refresh_required_error.go
model_needs_privileged_session_error.go
model_recovery_address.go
model_self_service_browser_location_change_required_error.go
model_self_service_error.go
Expand Down
1 change: 0 additions & 1 deletion internal/httpclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ Class | Method | HTTP request | Description
*MetadataApi* | [**GetVersion**](docs/MetadataApi.md#getversion) | **Get** /version | Return Running Software Version.
*MetadataApi* | [**IsAlive**](docs/MetadataApi.md#isalive) | **Get** /health/alive | Check HTTP Server Status
*MetadataApi* | [**IsReady**](docs/MetadataApi.md#isready) | **Get** /health/ready | Check HTTP Server and Database Status
*MetadataApi* | [**Prometheus**](docs/MetadataApi.md#prometheus) | **Get** /metrics/prometheus | Get snapshot metrics from the service. If you're using k8s, you can then add annotations to your deployment like so:
*V0alpha2Api* | [**AdminCreateIdentity**](docs/V0alpha2Api.md#admincreateidentity) | **Post** /identities | Create an Identity
*V0alpha2Api* | [**AdminCreateSelfServiceRecoveryLink**](docs/V0alpha2Api.md#admincreateselfservicerecoverylink) | **Post** /recovery/link | Create a Recovery Link
*V0alpha2Api* | [**AdminDeleteIdentity**](docs/V0alpha2Api.md#admindeleteidentity) | **Delete** /identities/{id} | Delete an Identity
Expand Down
123 changes: 96 additions & 27 deletions internal/httpclient/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,25 +388,6 @@ paths:
all sessions that belong to the given Identity.
tags:
- v0alpha2
/metrics/prometheus:
get:
description: |-
```
metadata:
annotations:
prometheus.io/port: "4434"
prometheus.io/path: "/metrics/prometheus"
```
operationId: prometheus
responses:
"200":
description: Empty responses are sent when, for example, resources are deleted.
The HTTP status code for empty responses is typically 201.
summary: |-
Get snapshot metrics from the service. If you're using k8s, you can then add annotations to
your deployment like so:
tags:
- metadata
/recovery/link:
post:
description: |-
Expand Down Expand Up @@ -2802,21 +2783,63 @@ components:
title: Is sent when a privileged session is required to perform the settings
update.
type: object
nullJsonRawMessage:
description: NullJSONRawMessage represents a json.RawMessage that works well
with JSON, SQL, and Swagger and is NULLable-
type: object
nullTime:
format: date-time
title: NullTime implements sql.NullTime functionality.
type: string
selfServiceBrowserLocationChangeRequiredError:
properties:
error:
$ref: '#/components/schemas/genericError'
code:
description: The status code
example: 404
format: int64
type: integer
debug:
description: |-
Debug information
This field is often not exposed to protect against leaking
sensitive information.
example: SQL field "foo" is not a bool.
type: string
details:
additionalProperties: true
description: Further error details
type: object
id:
description: |-
The error ID
Useful when trying to identify various errors in application logic.
type: string
message:
description: |-
Error message
The error's message.
example: The resource could not be found
type: string
reason:
description: A human-readable reason for the error
example: User with ID 1234 does not exist.
type: string
redirect_browser_to:
description: Since when the flow has expired
type: string
request:
description: |-
The request ID
The request ID is often exposed internally in order to trace
errors across service architectures. This is often a UUID.
example: d7ef54b1-ec15-46e6-bccb-524b82c035e6
type: string
status:
description: The status description
example: Not Found
type: string
required:
- message
title: Is sent when a flow requires a browser to change its location.
type: object
selfServiceError:
Expand Down Expand Up @@ -2845,18 +2868,64 @@ components:
selfServiceFlowExpiredError:
description: Is sent when a flow is expired
properties:
error:
$ref: '#/components/schemas/genericError'
code:
description: The status code
example: 404
format: int64
type: integer
debug:
description: |-
Debug information
This field is often not exposed to protect against leaking
sensitive information.
example: SQL field "foo" is not a bool.
type: string
details:
additionalProperties: true
description: Further error details
type: object
id:
description: |-
The error ID
Useful when trying to identify various errors in application logic.
type: string
message:
description: |-
Error message
The error's message.
example: The resource could not be found
type: string
reason:
description: A human-readable reason for the error
example: User with ID 1234 does not exist.
type: string
request:
description: |-
The request ID
The request ID is often exposed internally in order to trace
errors across service architectures. This is often a UUID.
example: d7ef54b1-ec15-46e6-bccb-524b82c035e6
type: string
since:
description: |-
A Duration represents the elapsed time between two instants
as an int64 nanosecond count. The representation limits the
largest representable duration to approximately 290 years.
format: int64
type: integer
status:
description: The status description
example: Not Found
type: string
use_flow_id:
format: uuid4
type: string
required:
- message
type: object
selfServiceFlowType:
description: The flow type can either be `api` or `browser`.
Expand Down
113 changes: 0 additions & 113 deletions internal/httpclient/api_metadata.go

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

0 comments on commit 4c5677f

Please sign in to comment.