From 6a9da74f693ee6c15a775ab8d652582aea093601 Mon Sep 17 00:00:00 2001 From: arekkas Date: Sat, 21 Jul 2018 16:58:09 +0200 Subject: [PATCH] health: Introduces health and version endpoints Signed-off-by: arekkas --- cmd/server/serve.go | 3 + cmd/server/sql.go | 12 + docs/api.swagger.json | 115 ++++++++- health/doc.go | 38 +++ health/handler.go | 129 ++++++++++ health/handler_test.go | 74 ++++++ sdk/go/keto/swagger/README.md | 8 +- sdk/go/keto/swagger/docs/HealthApi.md | 62 +++++ .../keto/swagger/docs/HealthNotReadyStatus.md | 10 + sdk/go/keto/swagger/docs/HealthStatus.md | 10 + ...ineResponse401.md => InlineResponse500.md} | 2 +- sdk/go/keto/swagger/docs/Version.md | 10 + sdk/go/keto/swagger/docs/VersionApi.md | 35 +++ sdk/go/keto/swagger/health_api.go | 153 +++++++++++ .../keto/swagger/health_not_ready_status.go | 15 ++ sdk/go/keto/swagger/health_status.go | 15 ++ ...response_401.go => inline_response_500.go} | 2 +- sdk/go/keto/swagger/version.go | 13 + sdk/go/keto/swagger/version_api.go | 94 +++++++ sdk/js/swagger/README.md | 16 +- sdk/js/swagger/docs/HealthApi.md | 90 +++++++ sdk/js/swagger/docs/HealthNotReadyStatus.md | 8 + sdk/js/swagger/docs/HealthStatus.md | 8 + ...ineResponse401.md => InlineResponse500.md} | 2 +- sdk/js/swagger/docs/Version.md | 8 + sdk/js/swagger/docs/VersionApi.md | 49 ++++ sdk/js/swagger/src/ApiClient.js | 2 +- sdk/js/swagger/src/api/HealthApi.js | 158 ++++++++++++ sdk/js/swagger/src/api/PolicyApi.js | 16 +- sdk/js/swagger/src/api/RoleApi.js | 31 +-- sdk/js/swagger/src/api/VersionApi.js | 101 ++++++++ sdk/js/swagger/src/api/WardenApi.js | 39 ++- sdk/js/swagger/src/index.js | 135 ++++++---- .../src/model/AuthenticationDefaultSession.js | 2 +- ...nticationOAuth2ClientCredentialsRequest.js | 2 +- ...nticationOAuth2ClientCredentialsSession.js | 2 +- ...uthenticationOAuth2IntrospectionRequest.js | 2 +- .../src/model/AuthenticationOAuth2Session.js | 2 +- sdk/js/swagger/src/model/Authenticator.js | 2 +- sdk/js/swagger/src/model/Firewall.js | 2 +- sdk/js/swagger/src/model/Handler.js | 2 +- .../swagger/src/model/HealthNotReadyStatus.js | 78 ++++++ sdk/js/swagger/src/model/HealthStatus.js | 74 ++++++ ...ineResponse401.js => InlineResponse500.js} | 18 +- .../src/model/IntrospectionResponse.js | 2 +- sdk/js/swagger/src/model/Manager.js | 2 +- .../OAuth2ClientCredentialsAuthentication.js | 2 +- .../OAuth2IntrospectionAuthentication.js | 2 +- sdk/js/swagger/src/model/Policy.js | 2 +- sdk/js/swagger/src/model/PolicyConditions.js | 2 +- sdk/js/swagger/src/model/Role.js | 2 +- sdk/js/swagger/src/model/RoleMembers.js | 2 +- sdk/js/swagger/src/model/Session.js | 2 +- .../model/SwaggerCreatePolicyParameters.js | 2 +- ...rDoesWardenAllowAccessRequestParameters.js | 2 +- ...rDoesWardenAllowClientRequestParameters.js | 10 +- ...WardenAllowTokenAccessRequestParameters.js | 10 +- .../src/model/SwaggerGetPolicyParameters.js | 2 +- .../src/model/SwaggerListPolicyParameters.js | 2 +- .../src/model/SwaggerListPolicyResponse.js | 2 +- .../model/SwaggerUpdatePolicyParameters.js | 2 +- .../src/model/SwaggerWardenBaseRequest.js | 2 +- sdk/js/swagger/src/model/Version.js | 73 ++++++ ...enOAuth2AccessTokenAuthorizationRequest.js | 2 +- ...nOAuth2AccessTokenAuthorizationResponse.js | 2 +- .../WardenOAuth2ClientAuthorizationRequest.js | 2 +- ...WardenOAuth2ClientAuthorizationResponse.js | 2 +- .../WardenSubjectAuthorizationRequest.js | 2 +- .../WardenSubjectAuthorizationResponse.js | 2 +- sdk/js/swagger/src/model/Writer.js | 2 +- sdk/php/swagger/README.md | 15 +- sdk/php/swagger/docs/Api/HealthApi.md | 93 +++++++ sdk/php/swagger/docs/Api/VersionApi.md | 51 ++++ .../docs/Model/HealthNotReadyStatus.md | 10 + sdk/php/swagger/docs/Model/HealthStatus.md | 10 + ...ineResponse401.md => InlineResponse500.md} | 2 +- sdk/php/swagger/docs/Model/Version.md | 10 + sdk/php/swagger/lib/Api/HealthApi.php | 239 +++++++++++++++++ sdk/php/swagger/lib/Api/PolicyApi.php | 30 +-- sdk/php/swagger/lib/Api/RoleApi.php | 42 +-- sdk/php/swagger/lib/Api/VersionApi.php | 159 ++++++++++++ sdk/php/swagger/lib/Api/WardenApi.php | 18 +- .../lib/Model/HealthNotReadyStatus.php | 240 ++++++++++++++++++ sdk/php/swagger/lib/Model/HealthStatus.php | 240 ++++++++++++++++++ ...eResponse401.php => InlineResponse500.php} | 8 +- sdk/php/swagger/lib/Model/Version.php | 240 ++++++++++++++++++ 86 files changed, 2969 insertions(+), 226 deletions(-) create mode 100644 health/doc.go create mode 100644 health/handler.go create mode 100644 health/handler_test.go create mode 100644 sdk/go/keto/swagger/docs/HealthApi.md create mode 100644 sdk/go/keto/swagger/docs/HealthNotReadyStatus.md create mode 100644 sdk/go/keto/swagger/docs/HealthStatus.md rename sdk/go/keto/swagger/docs/{InlineResponse401.md => InlineResponse500.md} (97%) create mode 100644 sdk/go/keto/swagger/docs/Version.md create mode 100644 sdk/go/keto/swagger/docs/VersionApi.md create mode 100644 sdk/go/keto/swagger/health_api.go create mode 100644 sdk/go/keto/swagger/health_not_ready_status.go create mode 100644 sdk/go/keto/swagger/health_status.go rename sdk/go/keto/swagger/{inline_response_401.go => inline_response_500.go} (93%) create mode 100644 sdk/go/keto/swagger/version.go create mode 100644 sdk/go/keto/swagger/version_api.go create mode 100644 sdk/js/swagger/docs/HealthApi.md create mode 100644 sdk/js/swagger/docs/HealthNotReadyStatus.md create mode 100644 sdk/js/swagger/docs/HealthStatus.md rename sdk/js/swagger/docs/{InlineResponse401.md => InlineResponse500.md} (91%) create mode 100644 sdk/js/swagger/docs/Version.md create mode 100644 sdk/js/swagger/docs/VersionApi.md create mode 100644 sdk/js/swagger/src/api/HealthApi.js create mode 100644 sdk/js/swagger/src/api/VersionApi.js create mode 100644 sdk/js/swagger/src/model/HealthNotReadyStatus.js create mode 100644 sdk/js/swagger/src/model/HealthStatus.js rename sdk/js/swagger/src/model/{InlineResponse401.js => InlineResponse500.js} (85%) create mode 100644 sdk/js/swagger/src/model/Version.js create mode 100644 sdk/php/swagger/docs/Api/HealthApi.md create mode 100644 sdk/php/swagger/docs/Api/VersionApi.md create mode 100644 sdk/php/swagger/docs/Model/HealthNotReadyStatus.md create mode 100644 sdk/php/swagger/docs/Model/HealthStatus.md rename sdk/php/swagger/docs/Model/{InlineResponse401.md => InlineResponse500.md} (96%) create mode 100644 sdk/php/swagger/docs/Model/Version.md create mode 100644 sdk/php/swagger/lib/Api/HealthApi.php create mode 100644 sdk/php/swagger/lib/Api/VersionApi.php create mode 100644 sdk/php/swagger/lib/Model/HealthNotReadyStatus.php create mode 100644 sdk/php/swagger/lib/Model/HealthStatus.php rename sdk/php/swagger/lib/Model/{InlineResponse401.php => InlineResponse500.php} (97%) create mode 100644 sdk/php/swagger/lib/Model/Version.php diff --git a/cmd/server/serve.go b/cmd/server/serve.go index 4ad1bf8f3..ba85a426e 100644 --- a/cmd/server/serve.go +++ b/cmd/server/serve.go @@ -33,6 +33,7 @@ import ( "github.com/ory/graceful" "github.com/ory/herodot" "github.com/ory/keto/authentication" + "github.com/ory/keto/health" "github.com/ory/keto/policy" "github.com/ory/keto/role" "github.com/ory/keto/warden" @@ -98,10 +99,12 @@ func RunServe( roleHandler := role.NewHandler(m.roleManager, writer) policyHandler := policy.NewHandler(m.policyManager, writer) wardenHandler := warden.NewHandler(writer, firewall, authenticators) + healthHandler := health.NewHandler(writer, buildVersion, m.readyCheckers) roleHandler.SetRoutes(router) policyHandler.SetRoutes(router) wardenHandler.SetRoutes(router) + healthHandler.SetRoutes(router) n := negroni.New() n.Use(negronilogrus.NewMiddlewareFromLogger(logger, "keto")) diff --git a/cmd/server/sql.go b/cmd/server/sql.go index d0cb6a33e..0eb4f2039 100644 --- a/cmd/server/sql.go +++ b/cmd/server/sql.go @@ -27,6 +27,7 @@ import ( _ "github.com/go-sql-driver/mysql" _ "github.com/lib/pq" + "github.com/ory/keto/health" "github.com/ory/keto/role" "github.com/ory/ladon" "github.com/ory/ladon/manager/memory" @@ -39,11 +40,17 @@ import ( type managers struct { roleManager role.Manager policyManager ladon.Manager + readyCheckers map[string]health.ReadyChecker } func newManagers(db string, logger logrus.FieldLogger) (*managers, error) { if db == "memory" { return &managers{ + readyCheckers: map[string]health.ReadyChecker{ + "database": func() error { + return nil + }, + }, roleManager: role.NewMemoryManager(), policyManager: memory.NewMemoryManager(), }, nil @@ -66,6 +73,11 @@ func newManagers(db string, logger logrus.FieldLogger) (*managers, error) { } return &managers{ + readyCheckers: map[string]health.ReadyChecker{ + "database": func() error { + return sdb.GetDatabase().Ping() + }, + }, roleManager: role.NewSQLManager(sdb.GetDatabase()), policyManager: sql.NewSQLManager(sdb.GetDatabase(), nil), }, nil diff --git a/docs/api.swagger.json b/docs/api.swagger.json index 809a018a0..5721529f3 100644 --- a/docs/api.swagger.json +++ b/docs/api.swagger.json @@ -25,6 +25,51 @@ }, "basePath": "/", "paths": { + "/health/alive": { + "get": { + "description": "This endpoint returns a 200 status code when the HTTP server is up running.\nThis status does currently not include checks whether the database connection is working.\nThis endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set.\n\nBe aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance.", + "tags": [ + "health" + ], + "summary": "Check the Alive Status", + "operationId": "isInstanceAlive", + "responses": { + "200": { + "description": "healthStatus", + "schema": { + "$ref": "#/definitions/healthStatus" + } + }, + "500": { + "$ref": "#/responses/genericError" + } + } + } + }, + "/health/ready": { + "get": { + "description": "This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g.\nthe database) are responsive as well.\n\nThis status does currently not include checks whether the database connection is working.\nThis endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set.\n\nBe aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance.", + "tags": [ + "health" + ], + "summary": "Check the Readiness Status", + "operationId": "isInstanceReady", + "responses": { + "200": { + "description": "healthStatus", + "schema": { + "$ref": "#/definitions/healthStatus" + } + }, + "503": { + "description": "healthNotReadyStatus", + "schema": { + "$ref": "#/definitions/healthNotReadyStatus" + } + } + } + } + }, "/policies": { "get": { "description": "List Access Control Policies", @@ -165,13 +210,6 @@ } }, "put": { - "security": [ - { - "oauth2": [ - "hydra.policies" - ] - } - ], "description": "Update an Access Control Policy", "consumes": [ "application/json" @@ -223,13 +261,6 @@ } }, "delete": { - "security": [ - { - "oauth2": [ - "hydra.policies" - ] - } - ], "description": "Delete an Access Control Policy", "consumes": [ "application/json" @@ -595,6 +626,24 @@ } } }, + "/version": { + "get": { + "description": "This endpoint returns the version as `{ \"version\": \"VERSION\" }`. The version is only correct with the prebuilt binary and not custom builds.", + "tags": [ + "version" + ], + "summary": "Get the version of Keto", + "operationId": "getVersion", + "responses": { + "200": { + "description": "version", + "schema": { + "$ref": "#/definitions/version" + } + } + } + } + }, "/warden/oauth2/access-tokens/authorize": { "post": { "description": "Checks if a token is valid and if the token subject is allowed to perform an action on a resource.\nThis endpoint requires a token, a scope, a resource name, an action name and a context.\n\n\nIf a token is expired/invalid, has not been granted the requested scope or the subject is not allowed to\nperform the action on the resource, this endpoint returns a 200 response with `{ \"allowed\": false }`.\n\n\nThis endpoint passes all data from the upstream OAuth 2.0 token introspection endpoint. If you use ORY Hydra as an\nupstream OAuth 2.0 provider, data set through the `accessTokenExtra` field in the consent flow will be included in this\nresponse as well.", @@ -1022,6 +1071,33 @@ "x-go-name": "OAuth2Session", "x-go-package": "github.com/ory/keto/authentication" }, + "healthNotReadyStatus": { + "type": "object", + "properties": { + "errors": { + "description": "Errors contains a list of errors that caused the not ready status.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-go-name": "Errors" + } + }, + "x-go-name": "swaggerNotReadyStatus", + "x-go-package": "github.com/ory/keto/health" + }, + "healthStatus": { + "type": "object", + "properties": { + "status": { + "description": "Status always contains \"ok\".", + "type": "string", + "x-go-name": "Status" + } + }, + "x-go-name": "swaggerHealthStatus", + "x-go-package": "github.com/ory/keto/health" + }, "policy": { "type": "object", "properties": { @@ -1242,6 +1318,17 @@ }, "x-go-package": "github.com/ory/keto/warden" }, + "version": { + "type": "object", + "properties": { + "version": { + "type": "string", + "x-go-name": "Version" + } + }, + "x-go-name": "swaggerVersion", + "x-go-package": "github.com/ory/keto/health" + }, "wardenOAuth2AccessTokenAuthorizationRequest": { "type": "object", "properties": { diff --git a/health/doc.go b/health/doc.go new file mode 100644 index 000000000..8afc89a16 --- /dev/null +++ b/health/doc.go @@ -0,0 +1,38 @@ +/* + * Copyright © 2015-2018 Aeneas Rekkas + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @author Aeneas Rekkas + * @copyright 2015-2018 Aeneas Rekkas + * @license Apache-2.0 + */ + +package health + +// swagger:model healthStatus +type swaggerHealthStatus struct { + // Status always contains "ok". + Status string `json:"status"` +} + +// swagger:model healthNotReadyStatus +type swaggerNotReadyStatus struct { + // Errors contains a list of errors that caused the not ready status. + Errors map[string]string `json:"errors"` +} + +// swagger:model version +type swaggerVersion struct { + Version string `json:"version"` +} diff --git a/health/handler.go b/health/handler.go new file mode 100644 index 000000000..d034141ec --- /dev/null +++ b/health/handler.go @@ -0,0 +1,129 @@ +/* + * Copyright © 2015-2018 Aeneas Rekkas + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @author Aeneas Rekkas + * @copyright 2015-2018 Aeneas Rekkas + * @license Apache-2.0 + */ + +package health + +import ( + "net/http" + + "github.com/julienschmidt/httprouter" + "github.com/ory/herodot" +) + +const ( + AliveCheckPath = "/health/alive" + ReadyCheckPath = "/health/ready" + VersionPath = "/version" +) + +type ReadyChecker func() error + +type Handler struct { + H *herodot.JSONWriter + VersionString string + ReadyChecks map[string]ReadyChecker +} + +func NewHandler( + h *herodot.JSONWriter, + version string, + readyChecks map[string]ReadyChecker, +) *Handler { + return &Handler{ + H: h, + VersionString: version, + ReadyChecks: readyChecks, + } +} + +func (h *Handler) SetRoutes(r *httprouter.Router) { + r.GET(AliveCheckPath, h.Alive) + r.GET(ReadyCheckPath, h.Ready) + r.GET(VersionPath, h.Version) +} + +// swagger:route GET /health/alive health isInstanceAlive +// +// Check the Alive Status +// +// This endpoint returns a 200 status code when the HTTP server is up running. +// This status does currently not include checks whether the database connection is working. +// This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. +// +// Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. +// +// Responses: +// 200: healthStatus +// 500: genericError +func (h *Handler) Alive(rw http.ResponseWriter, r *http.Request, _ httprouter.Params) { + h.H.Write(rw, r, &swaggerHealthStatus{ + Status: "ok", + }) +} + +// swagger:route GET /health/ready health isInstanceReady +// +// Check the Readiness Status +// +// This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. +// the database) are responsive as well. +// +// This status does currently not include checks whether the database connection is working. +// This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. +// +// Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. +// +// Responses: +// 200: healthStatus +// 503: healthNotReadyStatus +func (h *Handler) Ready(rw http.ResponseWriter, r *http.Request, _ httprouter.Params) { + var notReady = swaggerNotReadyStatus{ + Errors: map[string]string{}, + } + + for n, c := range h.ReadyChecks { + if err := c(); err != nil { + notReady.Errors[n] = err.Error() + } + } + + if len(notReady.Errors) > 0 { + h.H.WriteCode(rw, r, http.StatusServiceUnavailable, notReady) + return + } + + h.H.Write(rw, r, &swaggerHealthStatus{ + Status: "ok", + }) +} + +// swagger:route GET /version version getVersion +// +// Get the version of Keto +// +// This endpoint returns the version as `{ "version": "VERSION" }`. The version is only correct with the prebuilt binary and not custom builds. +// +// Responses: +// 200: version +func (h *Handler) Version(rw http.ResponseWriter, r *http.Request, _ httprouter.Params) { + h.H.Write(rw, r, &swaggerVersion{ + Version: h.VersionString, + }) +} diff --git a/health/handler_test.go b/health/handler_test.go new file mode 100644 index 000000000..26f8b239a --- /dev/null +++ b/health/handler_test.go @@ -0,0 +1,74 @@ +/* + * Copyright © 2015-2018 Aeneas Rekkas + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @author Aeneas Rekkas + * @Copyright 2017-2018 Aeneas Rekkas + * @license Apache-2.0 + */ + +package health + +import ( + "errors" + "net/http" + "net/http/httptest" + "testing" + + "github.com/julienschmidt/httprouter" + "github.com/ory/herodot" + "github.com/ory/keto/sdk/go/keto/swagger" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestHealth(t *testing.T) { + alive := errors.New("not alive") + handler := &Handler{ + H: herodot.NewJSONWriter(nil), + VersionString: "test version", + ReadyChecks: map[string]ReadyChecker{ + "test": func() error { + return alive + }, + }, + } + router := httprouter.New() + handler.SetRoutes(router) + ts := httptest.NewServer(router) + + healthClient := swagger.NewHealthApiWithBasePath(ts.URL) + + body, response, err := healthClient.IsInstanceAlive() + require.NoError(t, err) + require.EqualValues(t, http.StatusOK, response.StatusCode) + assert.EqualValues(t, "ok", body.Status) + + versionClient := swagger.NewVersionApiWithBasePath(ts.URL) + version, response, err := versionClient.GetVersion() + require.NoError(t, err) + require.EqualValues(t, http.StatusOK, response.StatusCode) + require.EqualValues(t, version.Version, handler.VersionString) + + _, response, err = healthClient.IsInstanceReady() + require.NoError(t, err) + require.EqualValues(t, http.StatusServiceUnavailable, response.StatusCode) + assert.Equal(t, `{"errors":{"test":"not alive"}}`, string(response.Payload)) + + alive = nil + body, response, err = healthClient.IsInstanceReady() + require.NoError(t, err) + require.EqualValues(t, http.StatusOK, response.StatusCode) + assert.EqualValues(t, "ok", body.Status) +} diff --git a/sdk/go/keto/swagger/README.md b/sdk/go/keto/swagger/README.md index 7139d35df..3824e67c2 100644 --- a/sdk/go/keto/swagger/README.md +++ b/sdk/go/keto/swagger/README.md @@ -22,6 +22,8 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*HealthApi* | [**IsInstanceAlive**](docs/HealthApi.md#isinstancealive) | **Get** /health/alive | Check the Alive Status +*HealthApi* | [**IsInstanceReady**](docs/HealthApi.md#isinstanceready) | **Get** /health/ready | Check the Readiness Status *PolicyApi* | [**CreatePolicy**](docs/PolicyApi.md#createpolicy) | **Post** /policies | *PolicyApi* | [**DeletePolicy**](docs/PolicyApi.md#deletepolicy) | **Delete** /policies/{id} | *PolicyApi* | [**GetPolicy**](docs/PolicyApi.md#getpolicy) | **Get** /policies/{id} | @@ -34,6 +36,7 @@ Class | Method | HTTP request | Description *RoleApi* | [**ListRoles**](docs/RoleApi.md#listroles) | **Get** /roles | List all roles *RoleApi* | [**RemoveMembersFromRole**](docs/RoleApi.md#removemembersfromrole) | **Delete** /roles/{id}/members | Remove members from a role *RoleApi* | [**SetRole**](docs/RoleApi.md#setrole) | **Put** /roles/{id} | A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role. +*VersionApi* | [**GetVersion**](docs/VersionApi.md#getversion) | **Get** /version | Get the version of Keto *WardenApi* | [**IsOAuth2AccessTokenAuthorized**](docs/WardenApi.md#isoauth2accesstokenauthorized) | **Post** /warden/oauth2/access-tokens/authorize | Check if an OAuth 2.0 access token is authorized to access a resource *WardenApi* | [**IsOAuth2ClientAuthorized**](docs/WardenApi.md#isoauth2clientauthorized) | **Post** /warden/oauth2/clients/authorize | Check if an OAuth 2.0 Client is authorized to access a resource *WardenApi* | [**IsSubjectAuthorized**](docs/WardenApi.md#issubjectauthorized) | **Post** /warden/subjects/authorize | Check if a subject is authorized to access a resource @@ -49,7 +52,9 @@ Class | Method | HTTP request | Description - [Authenticator](docs/Authenticator.md) - [Firewall](docs/Firewall.md) - [Handler](docs/Handler.md) - - [InlineResponse401](docs/InlineResponse401.md) + - [HealthNotReadyStatus](docs/HealthNotReadyStatus.md) + - [HealthStatus](docs/HealthStatus.md) + - [InlineResponse500](docs/InlineResponse500.md) - [IntrospectionResponse](docs/IntrospectionResponse.md) - [Manager](docs/Manager.md) - [OAuth2ClientCredentialsAuthentication](docs/OAuth2ClientCredentialsAuthentication.md) @@ -68,6 +73,7 @@ Class | Method | HTTP request | Description - [SwaggerListPolicyResponse](docs/SwaggerListPolicyResponse.md) - [SwaggerUpdatePolicyParameters](docs/SwaggerUpdatePolicyParameters.md) - [SwaggerWardenBaseRequest](docs/SwaggerWardenBaseRequest.md) + - [Version](docs/Version.md) - [WardenOAuth2AccessTokenAuthorizationRequest](docs/WardenOAuth2AccessTokenAuthorizationRequest.md) - [WardenOAuth2AccessTokenAuthorizationResponse](docs/WardenOAuth2AccessTokenAuthorizationResponse.md) - [WardenOAuth2ClientAuthorizationRequest](docs/WardenOAuth2ClientAuthorizationRequest.md) diff --git a/sdk/go/keto/swagger/docs/HealthApi.md b/sdk/go/keto/swagger/docs/HealthApi.md new file mode 100644 index 000000000..eaa3ebe94 --- /dev/null +++ b/sdk/go/keto/swagger/docs/HealthApi.md @@ -0,0 +1,62 @@ +# \HealthApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**IsInstanceAlive**](HealthApi.md#IsInstanceAlive) | **Get** /health/alive | Check the Alive Status +[**IsInstanceReady**](HealthApi.md#IsInstanceReady) | **Get** /health/ready | Check the Readiness Status + + +# **IsInstanceAlive** +> HealthStatus IsInstanceAlive() + +Check the Alive Status + +This endpoint returns a 200 status code when the HTTP server is up running. This status does currently not include checks whether the database connection is working. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthStatus**](healthStatus.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **IsInstanceReady** +> HealthStatus IsInstanceReady() + +Check the Readiness Status + +This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well. This status does currently not include checks whether the database connection is working. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthStatus**](healthStatus.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/sdk/go/keto/swagger/docs/HealthNotReadyStatus.md b/sdk/go/keto/swagger/docs/HealthNotReadyStatus.md new file mode 100644 index 000000000..478dd1f4a --- /dev/null +++ b/sdk/go/keto/swagger/docs/HealthNotReadyStatus.md @@ -0,0 +1,10 @@ +# HealthNotReadyStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | **map[string]string** | Errors contains a list of errors that caused the not ready status. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/go/keto/swagger/docs/HealthStatus.md b/sdk/go/keto/swagger/docs/HealthStatus.md new file mode 100644 index 000000000..b6522dc06 --- /dev/null +++ b/sdk/go/keto/swagger/docs/HealthStatus.md @@ -0,0 +1,10 @@ +# HealthStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | Status always contains \"ok\". | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/go/keto/swagger/docs/InlineResponse401.md b/sdk/go/keto/swagger/docs/InlineResponse500.md similarity index 97% rename from sdk/go/keto/swagger/docs/InlineResponse401.md rename to sdk/go/keto/swagger/docs/InlineResponse500.md index 0ac1e5d99..b8223d1dd 100644 --- a/sdk/go/keto/swagger/docs/InlineResponse401.md +++ b/sdk/go/keto/swagger/docs/InlineResponse500.md @@ -1,4 +1,4 @@ -# InlineResponse401 +# InlineResponse500 ## Properties Name | Type | Description | Notes diff --git a/sdk/go/keto/swagger/docs/Version.md b/sdk/go/keto/swagger/docs/Version.md new file mode 100644 index 000000000..fb09e432a --- /dev/null +++ b/sdk/go/keto/swagger/docs/Version.md @@ -0,0 +1,10 @@ +# Version + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Version** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/go/keto/swagger/docs/VersionApi.md b/sdk/go/keto/swagger/docs/VersionApi.md new file mode 100644 index 000000000..688ebf590 --- /dev/null +++ b/sdk/go/keto/swagger/docs/VersionApi.md @@ -0,0 +1,35 @@ +# \VersionApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetVersion**](VersionApi.md#GetVersion) | **Get** /version | Get the version of Keto + + +# **GetVersion** +> Version GetVersion() + +Get the version of Keto + +This endpoint returns the version as `{ \"version\": \"VERSION\" }`. The version is only correct with the prebuilt binary and not custom builds. + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Version**](version.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/sdk/go/keto/swagger/health_api.go b/sdk/go/keto/swagger/health_api.go new file mode 100644 index 000000000..86fdd3e6e --- /dev/null +++ b/sdk/go/keto/swagger/health_api.go @@ -0,0 +1,153 @@ +/* + * Package main ORY Keto + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +package swagger + +import ( + "encoding/json" + "net/url" + "strings" +) + +type HealthApi struct { + Configuration *Configuration +} + +func NewHealthApi() *HealthApi { + configuration := NewConfiguration() + return &HealthApi{ + Configuration: configuration, + } +} + +func NewHealthApiWithBasePath(basePath string) *HealthApi { + configuration := NewConfiguration() + configuration.BasePath = basePath + + return &HealthApi{ + Configuration: configuration, + } +} + +/** + * Check the Alive Status + * This endpoint returns a 200 status code when the HTTP server is up running. This status does currently not include checks whether the database connection is working. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. + * + * @return *HealthStatus + */ +func (a HealthApi) IsInstanceAlive() (*HealthStatus, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Get") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/health/alive" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(HealthStatus) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "IsInstanceAlive", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} + +/** + * Check the Readiness Status + * This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well. This status does currently not include checks whether the database connection is working. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. + * + * @return *HealthStatus + */ +func (a HealthApi) IsInstanceReady() (*HealthStatus, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Get") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/health/ready" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(HealthStatus) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "IsInstanceReady", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} diff --git a/sdk/go/keto/swagger/health_not_ready_status.go b/sdk/go/keto/swagger/health_not_ready_status.go new file mode 100644 index 000000000..72d26ac95 --- /dev/null +++ b/sdk/go/keto/swagger/health_not_ready_status.go @@ -0,0 +1,15 @@ +/* + * Package main ORY Keto + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +package swagger + +type HealthNotReadyStatus struct { + + // Errors contains a list of errors that caused the not ready status. + Errors map[string]string `json:"errors,omitempty"` +} diff --git a/sdk/go/keto/swagger/health_status.go b/sdk/go/keto/swagger/health_status.go new file mode 100644 index 000000000..acbec5107 --- /dev/null +++ b/sdk/go/keto/swagger/health_status.go @@ -0,0 +1,15 @@ +/* + * Package main ORY Keto + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +package swagger + +type HealthStatus struct { + + // Status always contains \"ok\". + Status string `json:"status,omitempty"` +} diff --git a/sdk/go/keto/swagger/inline_response_401.go b/sdk/go/keto/swagger/inline_response_500.go similarity index 93% rename from sdk/go/keto/swagger/inline_response_401.go rename to sdk/go/keto/swagger/inline_response_500.go index 180359d20..8356ece18 100644 --- a/sdk/go/keto/swagger/inline_response_401.go +++ b/sdk/go/keto/swagger/inline_response_500.go @@ -8,7 +8,7 @@ package swagger -type InlineResponse401 struct { +type InlineResponse500 struct { Code int64 `json:"code,omitempty"` Details []map[string]interface{} `json:"details,omitempty"` diff --git a/sdk/go/keto/swagger/version.go b/sdk/go/keto/swagger/version.go new file mode 100644 index 000000000..c232b3e2a --- /dev/null +++ b/sdk/go/keto/swagger/version.go @@ -0,0 +1,13 @@ +/* + * Package main ORY Keto + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +package swagger + +type Version struct { + Version string `json:"version,omitempty"` +} diff --git a/sdk/go/keto/swagger/version_api.go b/sdk/go/keto/swagger/version_api.go new file mode 100644 index 000000000..95dbd9beb --- /dev/null +++ b/sdk/go/keto/swagger/version_api.go @@ -0,0 +1,94 @@ +/* + * Package main ORY Keto + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +package swagger + +import ( + "encoding/json" + "net/url" + "strings" +) + +type VersionApi struct { + Configuration *Configuration +} + +func NewVersionApi() *VersionApi { + configuration := NewConfiguration() + return &VersionApi{ + Configuration: configuration, + } +} + +func NewVersionApiWithBasePath(basePath string) *VersionApi { + configuration := NewConfiguration() + configuration.BasePath = basePath + + return &VersionApi{ + Configuration: configuration, + } +} + +/** + * Get the version of Keto + * This endpoint returns the version as `{ \"version\": \"VERSION\" }`. The version is only correct with the prebuilt binary and not custom builds. + * + * @return *Version + */ +func (a VersionApi) GetVersion() (*Version, *APIResponse, error) { + + var localVarHttpMethod = strings.ToUpper("Get") + // create path and map variables + localVarPath := a.Configuration.BasePath + "/version" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := make(map[string]string) + var localVarPostBody interface{} + var localVarFileName string + var localVarFileBytes []byte + // add default headers if any + for key := range a.Configuration.DefaultHeader { + localVarHeaderParams[key] = a.Configuration.DefaultHeader[key] + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + var successPayload = new(Version) + localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + + var localVarURL, _ = url.Parse(localVarPath) + localVarURL.RawQuery = localVarQueryParams.Encode() + var localVarAPIResponse = &APIResponse{Operation: "GetVersion", Method: localVarHttpMethod, RequestURL: localVarURL.String()} + if localVarHttpResponse != nil { + localVarAPIResponse.Response = localVarHttpResponse.RawResponse + localVarAPIResponse.Payload = localVarHttpResponse.Body() + } + + if err != nil { + return successPayload, localVarAPIResponse, err + } + err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload) + return successPayload, localVarAPIResponse, err +} diff --git a/sdk/js/swagger/README.md b/sdk/js/swagger/README.md index 481f22457..e78334e66 100644 --- a/sdk/js/swagger/README.md +++ b/sdk/js/swagger/README.md @@ -96,11 +96,7 @@ Please follow the [installation](#installation) instruction and execute the foll ```javascript var SwaggerJsClient = require('swagger-js-client'); -var api = new SwaggerJsClient.PolicyApi() - -var opts = { - 'body': new SwaggerJsClient.Policy() // {Policy} -}; +var api = new SwaggerJsClient.HealthApi() var callback = function(error, data, response) { if (error) { @@ -109,7 +105,7 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -api.createPolicy(opts, callback); +api.isInstanceAlive(callback); ``` @@ -119,6 +115,8 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*SwaggerJsClient.HealthApi* | [**isInstanceAlive**](docs/HealthApi.md#isInstanceAlive) | **GET** /health/alive | Check the Alive Status +*SwaggerJsClient.HealthApi* | [**isInstanceReady**](docs/HealthApi.md#isInstanceReady) | **GET** /health/ready | Check the Readiness Status *SwaggerJsClient.PolicyApi* | [**createPolicy**](docs/PolicyApi.md#createPolicy) | **POST** /policies | *SwaggerJsClient.PolicyApi* | [**deletePolicy**](docs/PolicyApi.md#deletePolicy) | **DELETE** /policies/{id} | *SwaggerJsClient.PolicyApi* | [**getPolicy**](docs/PolicyApi.md#getPolicy) | **GET** /policies/{id} | @@ -131,6 +129,7 @@ Class | Method | HTTP request | Description *SwaggerJsClient.RoleApi* | [**listRoles**](docs/RoleApi.md#listRoles) | **GET** /roles | List all roles *SwaggerJsClient.RoleApi* | [**removeMembersFromRole**](docs/RoleApi.md#removeMembersFromRole) | **DELETE** /roles/{id}/members | Remove members from a role *SwaggerJsClient.RoleApi* | [**setRole**](docs/RoleApi.md#setRole) | **PUT** /roles/{id} | A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role. +*SwaggerJsClient.VersionApi* | [**getVersion**](docs/VersionApi.md#getVersion) | **GET** /version | Get the version of Keto *SwaggerJsClient.WardenApi* | [**isOAuth2AccessTokenAuthorized**](docs/WardenApi.md#isOAuth2AccessTokenAuthorized) | **POST** /warden/oauth2/access-tokens/authorize | Check if an OAuth 2.0 access token is authorized to access a resource *SwaggerJsClient.WardenApi* | [**isOAuth2ClientAuthorized**](docs/WardenApi.md#isOAuth2ClientAuthorized) | **POST** /warden/oauth2/clients/authorize | Check if an OAuth 2.0 Client is authorized to access a resource *SwaggerJsClient.WardenApi* | [**isSubjectAuthorized**](docs/WardenApi.md#isSubjectAuthorized) | **POST** /warden/subjects/authorize | Check if a subject is authorized to access a resource @@ -146,7 +145,9 @@ Class | Method | HTTP request | Description - [SwaggerJsClient.Authenticator](docs/Authenticator.md) - [SwaggerJsClient.Firewall](docs/Firewall.md) - [SwaggerJsClient.Handler](docs/Handler.md) - - [SwaggerJsClient.InlineResponse401](docs/InlineResponse401.md) + - [SwaggerJsClient.HealthNotReadyStatus](docs/HealthNotReadyStatus.md) + - [SwaggerJsClient.HealthStatus](docs/HealthStatus.md) + - [SwaggerJsClient.InlineResponse500](docs/InlineResponse500.md) - [SwaggerJsClient.IntrospectionResponse](docs/IntrospectionResponse.md) - [SwaggerJsClient.Manager](docs/Manager.md) - [SwaggerJsClient.OAuth2ClientCredentialsAuthentication](docs/OAuth2ClientCredentialsAuthentication.md) @@ -165,6 +166,7 @@ Class | Method | HTTP request | Description - [SwaggerJsClient.SwaggerListPolicyResponse](docs/SwaggerListPolicyResponse.md) - [SwaggerJsClient.SwaggerUpdatePolicyParameters](docs/SwaggerUpdatePolicyParameters.md) - [SwaggerJsClient.SwaggerWardenBaseRequest](docs/SwaggerWardenBaseRequest.md) + - [SwaggerJsClient.Version](docs/Version.md) - [SwaggerJsClient.WardenOAuth2AccessTokenAuthorizationRequest](docs/WardenOAuth2AccessTokenAuthorizationRequest.md) - [SwaggerJsClient.WardenOAuth2AccessTokenAuthorizationResponse](docs/WardenOAuth2AccessTokenAuthorizationResponse.md) - [SwaggerJsClient.WardenOAuth2ClientAuthorizationRequest](docs/WardenOAuth2ClientAuthorizationRequest.md) diff --git a/sdk/js/swagger/docs/HealthApi.md b/sdk/js/swagger/docs/HealthApi.md new file mode 100644 index 000000000..076e8179c --- /dev/null +++ b/sdk/js/swagger/docs/HealthApi.md @@ -0,0 +1,90 @@ +# SwaggerJsClient.HealthApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**isInstanceAlive**](HealthApi.md#isInstanceAlive) | **GET** /health/alive | Check the Alive Status +[**isInstanceReady**](HealthApi.md#isInstanceReady) | **GET** /health/ready | Check the Readiness Status + + + +# **isInstanceAlive** +> HealthStatus isInstanceAlive() + +Check the Alive Status + +This endpoint returns a 200 status code when the HTTP server is up running. This status does currently not include checks whether the database connection is working. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. + +### Example +```javascript +var SwaggerJsClient = require('swagger-js-client'); + +var apiInstance = new SwaggerJsClient.HealthApi(); + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +apiInstance.isInstanceAlive(callback); +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthStatus**](HealthStatus.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **isInstanceReady** +> HealthStatus isInstanceReady() + +Check the Readiness Status + +This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well. This status does currently not include checks whether the database connection is working. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. + +### Example +```javascript +var SwaggerJsClient = require('swagger-js-client'); + +var apiInstance = new SwaggerJsClient.HealthApi(); + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +apiInstance.isInstanceReady(callback); +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthStatus**](HealthStatus.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/sdk/js/swagger/docs/HealthNotReadyStatus.md b/sdk/js/swagger/docs/HealthNotReadyStatus.md new file mode 100644 index 000000000..edc4bfd28 --- /dev/null +++ b/sdk/js/swagger/docs/HealthNotReadyStatus.md @@ -0,0 +1,8 @@ +# SwaggerJsClient.HealthNotReadyStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | **{String: String}** | Errors contains a list of errors that caused the not ready status. | [optional] + + diff --git a/sdk/js/swagger/docs/HealthStatus.md b/sdk/js/swagger/docs/HealthStatus.md new file mode 100644 index 000000000..89cdaa388 --- /dev/null +++ b/sdk/js/swagger/docs/HealthStatus.md @@ -0,0 +1,8 @@ +# SwaggerJsClient.HealthStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **String** | Status always contains \"ok\". | [optional] + + diff --git a/sdk/js/swagger/docs/InlineResponse401.md b/sdk/js/swagger/docs/InlineResponse500.md similarity index 91% rename from sdk/js/swagger/docs/InlineResponse401.md rename to sdk/js/swagger/docs/InlineResponse500.md index d4a3c3129..4ed86eba2 100644 --- a/sdk/js/swagger/docs/InlineResponse401.md +++ b/sdk/js/swagger/docs/InlineResponse500.md @@ -1,4 +1,4 @@ -# SwaggerJsClient.InlineResponse401 +# SwaggerJsClient.InlineResponse500 ## Properties Name | Type | Description | Notes diff --git a/sdk/js/swagger/docs/Version.md b/sdk/js/swagger/docs/Version.md new file mode 100644 index 000000000..e1c6b4ed1 --- /dev/null +++ b/sdk/js/swagger/docs/Version.md @@ -0,0 +1,8 @@ +# SwaggerJsClient.Version + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | **String** | | [optional] + + diff --git a/sdk/js/swagger/docs/VersionApi.md b/sdk/js/swagger/docs/VersionApi.md new file mode 100644 index 000000000..6bbe9901a --- /dev/null +++ b/sdk/js/swagger/docs/VersionApi.md @@ -0,0 +1,49 @@ +# SwaggerJsClient.VersionApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getVersion**](VersionApi.md#getVersion) | **GET** /version | Get the version of Keto + + + +# **getVersion** +> Version getVersion() + +Get the version of Keto + +This endpoint returns the version as `{ \"version\": \"VERSION\" }`. The version is only correct with the prebuilt binary and not custom builds. + +### Example +```javascript +var SwaggerJsClient = require('swagger-js-client'); + +var apiInstance = new SwaggerJsClient.VersionApi(); + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +apiInstance.getVersion(callback); +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Version**](Version.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/sdk/js/swagger/src/ApiClient.js b/sdk/js/swagger/src/ApiClient.js index 106697af9..f463d4eb2 100644 --- a/sdk/js/swagger/src/ApiClient.js +++ b/sdk/js/swagger/src/ApiClient.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/api/HealthApi.js b/sdk/js/swagger/src/api/HealthApi.js new file mode 100644 index 000000000..cd06ae24c --- /dev/null +++ b/sdk/js/swagger/src/api/HealthApi.js @@ -0,0 +1,158 @@ +/** + * + * Package main ORY Keto + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([ + 'ApiClient', + 'model/HealthNotReadyStatus', + 'model/HealthStatus', + 'model/InlineResponse500' + ], factory) + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory( + require('../ApiClient'), + require('../model/HealthNotReadyStatus'), + require('../model/HealthStatus'), + require('../model/InlineResponse500') + ) + } else { + // Browser globals (root is window) + if (!root.SwaggerJsClient) { + root.SwaggerJsClient = {} + } + root.SwaggerJsClient.HealthApi = factory( + root.SwaggerJsClient.ApiClient, + root.SwaggerJsClient.HealthNotReadyStatus, + root.SwaggerJsClient.HealthStatus, + root.SwaggerJsClient.InlineResponse500 + ) + } +})(this, function( + ApiClient, + HealthNotReadyStatus, + HealthStatus, + InlineResponse500 +) { + 'use strict' + + /** + * Health service. + * @module api/HealthApi + * @version Latest + */ + + /** + * Constructs a new HealthApi. + * @alias module:api/HealthApi + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + var exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance + + /** + * Callback function to receive the result of the isInstanceAlive operation. + * @callback module:api/HealthApi~isInstanceAliveCallback + * @param {String} error Error message, if any. + * @param {module:model/HealthStatus} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Check the Alive Status + * This endpoint returns a 200 status code when the HTTP server is up running. This status does currently not include checks whether the database connection is working. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. + * @param {module:api/HealthApi~isInstanceAliveCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/HealthStatus} + */ + this.isInstanceAlive = function(callback) { + var postBody = null + + var pathParams = {} + var queryParams = {} + var headerParams = {} + var formParams = {} + + var authNames = [] + var contentTypes = ['application/json'] + var accepts = ['application/json'] + var returnType = HealthStatus + + return this.apiClient.callApi( + '/health/alive', + 'GET', + pathParams, + queryParams, + headerParams, + formParams, + postBody, + authNames, + contentTypes, + accepts, + returnType, + callback + ) + } + + /** + * Callback function to receive the result of the isInstanceReady operation. + * @callback module:api/HealthApi~isInstanceReadyCallback + * @param {String} error Error message, if any. + * @param {module:model/HealthStatus} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Check the Readiness Status + * This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well. This status does currently not include checks whether the database connection is working. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. + * @param {module:api/HealthApi~isInstanceReadyCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/HealthStatus} + */ + this.isInstanceReady = function(callback) { + var postBody = null + + var pathParams = {} + var queryParams = {} + var headerParams = {} + var formParams = {} + + var authNames = [] + var contentTypes = ['application/json'] + var accepts = ['application/json'] + var returnType = HealthStatus + + return this.apiClient.callApi( + '/health/ready', + 'GET', + pathParams, + queryParams, + headerParams, + formParams, + postBody, + authNames, + contentTypes, + accepts, + returnType, + callback + ) + } + } + + return exports +}) diff --git a/sdk/js/swagger/src/api/PolicyApi.js b/sdk/js/swagger/src/api/PolicyApi.js index daa4f5e30..ec637ed41 100644 --- a/sdk/js/swagger/src/api/PolicyApi.js +++ b/sdk/js/swagger/src/api/PolicyApi.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest @@ -17,12 +17,12 @@ ;(function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/InlineResponse401', 'model/Policy'], factory) + define(['ApiClient', 'model/InlineResponse500', 'model/Policy'], factory) } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory( require('../ApiClient'), - require('../model/InlineResponse401'), + require('../model/InlineResponse500'), require('../model/Policy') ) } else { @@ -32,11 +32,11 @@ } root.SwaggerJsClient.PolicyApi = factory( root.SwaggerJsClient.ApiClient, - root.SwaggerJsClient.InlineResponse401, + root.SwaggerJsClient.InlineResponse500, root.SwaggerJsClient.Policy ) } -})(this, function(ApiClient, InlineResponse401, Policy) { +})(this, function(ApiClient, InlineResponse500, Policy) { 'use strict' /** @@ -46,7 +46,7 @@ */ /** - * Constructs a new PolicyApi. + * Constructs a new PolicyApi. * @alias module:api/PolicyApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -66,7 +66,7 @@ /** * Create an Access Control Policy * @param {Object} opts Optional parameters - * @param {module:model/Policy} opts.body + * @param {module:model/Policy} opts.body * @param {module:api/PolicyApi~createPolicyCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Policy} */ @@ -264,7 +264,7 @@ * Update an Access Control Policy * @param {String} id The id of the policy. * @param {Object} opts Optional parameters - * @param {module:model/Policy} opts.body + * @param {module:model/Policy} opts.body * @param {module:api/PolicyApi~updatePolicyCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Policy} */ diff --git a/sdk/js/swagger/src/api/RoleApi.js b/sdk/js/swagger/src/api/RoleApi.js index f6fdf4f0e..2f6d1252e 100644 --- a/sdk/js/swagger/src/api/RoleApi.js +++ b/sdk/js/swagger/src/api/RoleApi.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest @@ -17,20 +17,17 @@ ;(function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define( - [ - 'ApiClient', - 'model/InlineResponse401', - 'model/Role', - 'model/RoleMembers' - ], - factory - ) + define([ + 'ApiClient', + 'model/InlineResponse500', + 'model/Role', + 'model/RoleMembers' + ], factory) } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory( require('../ApiClient'), - require('../model/InlineResponse401'), + require('../model/InlineResponse500'), require('../model/Role'), require('../model/RoleMembers') ) @@ -41,12 +38,12 @@ } root.SwaggerJsClient.RoleApi = factory( root.SwaggerJsClient.ApiClient, - root.SwaggerJsClient.InlineResponse401, + root.SwaggerJsClient.InlineResponse500, root.SwaggerJsClient.Role, root.SwaggerJsClient.RoleMembers ) } -})(this, function(ApiClient, InlineResponse401, Role, RoleMembers) { +})(this, function(ApiClient, InlineResponse500, Role, RoleMembers) { 'use strict' /** @@ -56,7 +53,7 @@ */ /** - * Constructs a new RoleApi. + * Constructs a new RoleApi. * @alias module:api/RoleApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -78,7 +75,7 @@ * A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role. This endpoint allows you to add members (users, applications, ...) to a specific role. You have to know the role's ID. * @param {String} id The id of the role to modify. * @param {Object} opts Optional parameters - * @param {module:model/RoleMembers} opts.body + * @param {module:model/RoleMembers} opts.body * @param {module:api/RoleApi~addMembersToRoleCallback} callback The callback function, accepting three arguments: error, data, response */ this.addMembersToRole = function(id, opts, callback) { @@ -132,7 +129,7 @@ * Create a role * A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role. This endpoint allows you to create a new role. You may define members as well but you don't have to. * @param {Object} opts Optional parameters - * @param {module:model/Role} opts.body + * @param {module:model/Role} opts.body * @param {module:api/RoleApi~createRoleCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Role} */ @@ -336,7 +333,7 @@ * A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role. This endpoint allows you to remove members (users, applications, ...) from a specific role. You have to know the role's ID. * @param {String} id The id of the role to modify. * @param {Object} opts Optional parameters - * @param {module:model/RoleMembers} opts.body + * @param {module:model/RoleMembers} opts.body * @param {module:api/RoleApi~removeMembersFromRoleCallback} callback The callback function, accepting three arguments: error, data, response */ this.removeMembersFromRole = function(id, opts, callback) { diff --git a/sdk/js/swagger/src/api/VersionApi.js b/sdk/js/swagger/src/api/VersionApi.js new file mode 100644 index 000000000..5933816e4 --- /dev/null +++ b/sdk/js/swagger/src/api/VersionApi.js @@ -0,0 +1,101 @@ +/** + * + * Package main ORY Keto + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Version'], factory) + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory( + require('../ApiClient'), + require('../model/Version') + ) + } else { + // Browser globals (root is window) + if (!root.SwaggerJsClient) { + root.SwaggerJsClient = {} + } + root.SwaggerJsClient.VersionApi = factory( + root.SwaggerJsClient.ApiClient, + root.SwaggerJsClient.Version + ) + } +})(this, function(ApiClient, Version) { + 'use strict' + + /** + * Version service. + * @module api/VersionApi + * @version Latest + */ + + /** + * Constructs a new VersionApi. + * @alias module:api/VersionApi + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + var exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance + + /** + * Callback function to receive the result of the getVersion operation. + * @callback module:api/VersionApi~getVersionCallback + * @param {String} error Error message, if any. + * @param {module:model/Version} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Get the version of Keto + * This endpoint returns the version as `{ \"version\": \"VERSION\" }`. The version is only correct with the prebuilt binary and not custom builds. + * @param {module:api/VersionApi~getVersionCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/Version} + */ + this.getVersion = function(callback) { + var postBody = null + + var pathParams = {} + var queryParams = {} + var headerParams = {} + var formParams = {} + + var authNames = [] + var contentTypes = ['application/json'] + var accepts = ['application/json'] + var returnType = Version + + return this.apiClient.callApi( + '/version', + 'GET', + pathParams, + queryParams, + headerParams, + formParams, + postBody, + authNames, + contentTypes, + accepts, + returnType, + callback + ) + } + } + + return exports +}) diff --git a/sdk/js/swagger/src/api/WardenApi.js b/sdk/js/swagger/src/api/WardenApi.js index 8d9ac52bb..b12d4b84b 100644 --- a/sdk/js/swagger/src/api/WardenApi.js +++ b/sdk/js/swagger/src/api/WardenApi.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest @@ -17,24 +17,21 @@ ;(function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define( - [ - 'ApiClient', - 'model/InlineResponse401', - 'model/WardenOAuth2AccessTokenAuthorizationRequest', - 'model/WardenOAuth2AccessTokenAuthorizationResponse', - 'model/WardenOAuth2ClientAuthorizationRequest', - 'model/WardenOAuth2ClientAuthorizationResponse', - 'model/WardenSubjectAuthorizationRequest', - 'model/WardenSubjectAuthorizationResponse' - ], - factory - ) + define([ + 'ApiClient', + 'model/InlineResponse500', + 'model/WardenOAuth2AccessTokenAuthorizationRequest', + 'model/WardenOAuth2AccessTokenAuthorizationResponse', + 'model/WardenOAuth2ClientAuthorizationRequest', + 'model/WardenOAuth2ClientAuthorizationResponse', + 'model/WardenSubjectAuthorizationRequest', + 'model/WardenSubjectAuthorizationResponse' + ], factory) } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory( require('../ApiClient'), - require('../model/InlineResponse401'), + require('../model/InlineResponse500'), require('../model/WardenOAuth2AccessTokenAuthorizationRequest'), require('../model/WardenOAuth2AccessTokenAuthorizationResponse'), require('../model/WardenOAuth2ClientAuthorizationRequest'), @@ -49,7 +46,7 @@ } root.SwaggerJsClient.WardenApi = factory( root.SwaggerJsClient.ApiClient, - root.SwaggerJsClient.InlineResponse401, + root.SwaggerJsClient.InlineResponse500, root.SwaggerJsClient.WardenOAuth2AccessTokenAuthorizationRequest, root.SwaggerJsClient.WardenOAuth2AccessTokenAuthorizationResponse, root.SwaggerJsClient.WardenOAuth2ClientAuthorizationRequest, @@ -60,7 +57,7 @@ } })(this, function( ApiClient, - InlineResponse401, + InlineResponse500, WardenOAuth2AccessTokenAuthorizationRequest, WardenOAuth2AccessTokenAuthorizationResponse, WardenOAuth2ClientAuthorizationRequest, @@ -77,7 +74,7 @@ */ /** - * Constructs a new WardenApi. + * Constructs a new WardenApi. * @alias module:api/WardenApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -98,7 +95,7 @@ * Check if an OAuth 2.0 access token is authorized to access a resource * Checks if a token is valid and if the token subject is allowed to perform an action on a resource. This endpoint requires a token, a scope, a resource name, an action name and a context. If a token is expired/invalid, has not been granted the requested scope or the subject is not allowed to perform the action on the resource, this endpoint returns a 200 response with `{ \"allowed\": false }`. This endpoint passes all data from the upstream OAuth 2.0 token introspection endpoint. If you use ORY Hydra as an upstream OAuth 2.0 provider, data set through the `accessTokenExtra` field in the consent flow will be included in this response as well. * @param {Object} opts Optional parameters - * @param {module:model/WardenOAuth2AccessTokenAuthorizationRequest} opts.body + * @param {module:model/WardenOAuth2AccessTokenAuthorizationRequest} opts.body * @param {module:api/WardenApi~isOAuth2AccessTokenAuthorizedCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/WardenOAuth2AccessTokenAuthorizationResponse} */ @@ -144,7 +141,7 @@ * Check if an OAuth 2.0 Client is authorized to access a resource * Checks if an OAuth 2.0 Client provided the correct access credentials and and if the client is allowed to perform an action on a resource. This endpoint requires a client id, a client secret, a scope, a resource name, an action name and a context. * @param {Object} opts Optional parameters - * @param {module:model/WardenOAuth2ClientAuthorizationRequest} opts.body + * @param {module:model/WardenOAuth2ClientAuthorizationRequest} opts.body * @param {module:api/WardenApi~isOAuth2ClientAuthorizedCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/WardenOAuth2ClientAuthorizationResponse} */ @@ -190,7 +187,7 @@ * Check if a subject is authorized to access a resource * Checks if a subject (e.g. user ID, API key, ...) is allowed to perform a certain action on a resource. * @param {Object} opts Optional parameters - * @param {module:model/WardenSubjectAuthorizationRequest} opts.body + * @param {module:model/WardenSubjectAuthorizationRequest} opts.body * @param {module:api/WardenApi~isSubjectAuthorizedCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/WardenSubjectAuthorizationResponse} */ diff --git a/sdk/js/swagger/src/index.js b/sdk/js/swagger/src/index.js index 6c5153eae..181e32b07 100644 --- a/sdk/js/swagger/src/index.js +++ b/sdk/js/swagger/src/index.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest @@ -17,49 +17,51 @@ ;(function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define( - [ - 'ApiClient', - 'model/AuthenticationDefaultSession', - 'model/AuthenticationOAuth2ClientCredentialsRequest', - 'model/AuthenticationOAuth2ClientCredentialsSession', - 'model/AuthenticationOAuth2IntrospectionRequest', - 'model/AuthenticationOAuth2Session', - 'model/Authenticator', - 'model/Firewall', - 'model/Handler', - 'model/InlineResponse401', - 'model/IntrospectionResponse', - 'model/Manager', - 'model/OAuth2ClientCredentialsAuthentication', - 'model/OAuth2IntrospectionAuthentication', - 'model/Policy', - 'model/PolicyConditions', - 'model/Role', - 'model/RoleMembers', - 'model/Session', - 'model/SwaggerCreatePolicyParameters', - 'model/SwaggerDoesWardenAllowAccessRequestParameters', - 'model/SwaggerDoesWardenAllowClientRequestParameters', - 'model/SwaggerDoesWardenAllowTokenAccessRequestParameters', - 'model/SwaggerGetPolicyParameters', - 'model/SwaggerListPolicyParameters', - 'model/SwaggerListPolicyResponse', - 'model/SwaggerUpdatePolicyParameters', - 'model/SwaggerWardenBaseRequest', - 'model/WardenOAuth2AccessTokenAuthorizationRequest', - 'model/WardenOAuth2AccessTokenAuthorizationResponse', - 'model/WardenOAuth2ClientAuthorizationRequest', - 'model/WardenOAuth2ClientAuthorizationResponse', - 'model/WardenSubjectAuthorizationRequest', - 'model/WardenSubjectAuthorizationResponse', - 'model/Writer', - 'api/PolicyApi', - 'api/RoleApi', - 'api/WardenApi' - ], - factory - ) + define([ + 'ApiClient', + 'model/AuthenticationDefaultSession', + 'model/AuthenticationOAuth2ClientCredentialsRequest', + 'model/AuthenticationOAuth2ClientCredentialsSession', + 'model/AuthenticationOAuth2IntrospectionRequest', + 'model/AuthenticationOAuth2Session', + 'model/Authenticator', + 'model/Firewall', + 'model/Handler', + 'model/HealthNotReadyStatus', + 'model/HealthStatus', + 'model/InlineResponse500', + 'model/IntrospectionResponse', + 'model/Manager', + 'model/OAuth2ClientCredentialsAuthentication', + 'model/OAuth2IntrospectionAuthentication', + 'model/Policy', + 'model/PolicyConditions', + 'model/Role', + 'model/RoleMembers', + 'model/Session', + 'model/SwaggerCreatePolicyParameters', + 'model/SwaggerDoesWardenAllowAccessRequestParameters', + 'model/SwaggerDoesWardenAllowClientRequestParameters', + 'model/SwaggerDoesWardenAllowTokenAccessRequestParameters', + 'model/SwaggerGetPolicyParameters', + 'model/SwaggerListPolicyParameters', + 'model/SwaggerListPolicyResponse', + 'model/SwaggerUpdatePolicyParameters', + 'model/SwaggerWardenBaseRequest', + 'model/Version', + 'model/WardenOAuth2AccessTokenAuthorizationRequest', + 'model/WardenOAuth2AccessTokenAuthorizationResponse', + 'model/WardenOAuth2ClientAuthorizationRequest', + 'model/WardenOAuth2ClientAuthorizationResponse', + 'model/WardenSubjectAuthorizationRequest', + 'model/WardenSubjectAuthorizationResponse', + 'model/Writer', + 'api/HealthApi', + 'api/PolicyApi', + 'api/RoleApi', + 'api/VersionApi', + 'api/WardenApi' + ], factory) } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory( @@ -72,7 +74,9 @@ require('./model/Authenticator'), require('./model/Firewall'), require('./model/Handler'), - require('./model/InlineResponse401'), + require('./model/HealthNotReadyStatus'), + require('./model/HealthStatus'), + require('./model/InlineResponse500'), require('./model/IntrospectionResponse'), require('./model/Manager'), require('./model/OAuth2ClientCredentialsAuthentication'), @@ -91,6 +95,7 @@ require('./model/SwaggerListPolicyResponse'), require('./model/SwaggerUpdatePolicyParameters'), require('./model/SwaggerWardenBaseRequest'), + require('./model/Version'), require('./model/WardenOAuth2AccessTokenAuthorizationRequest'), require('./model/WardenOAuth2AccessTokenAuthorizationResponse'), require('./model/WardenOAuth2ClientAuthorizationRequest'), @@ -98,8 +103,10 @@ require('./model/WardenSubjectAuthorizationRequest'), require('./model/WardenSubjectAuthorizationResponse'), require('./model/Writer'), + require('./api/HealthApi'), require('./api/PolicyApi'), require('./api/RoleApi'), + require('./api/VersionApi'), require('./api/WardenApi') ) } @@ -113,7 +120,9 @@ Authenticator, Firewall, Handler, - InlineResponse401, + HealthNotReadyStatus, + HealthStatus, + InlineResponse500, IntrospectionResponse, Manager, OAuth2ClientCredentialsAuthentication, @@ -132,6 +141,7 @@ SwaggerListPolicyResponse, SwaggerUpdatePolicyParameters, SwaggerWardenBaseRequest, + Version, WardenOAuth2AccessTokenAuthorizationRequest, WardenOAuth2AccessTokenAuthorizationResponse, WardenOAuth2ClientAuthorizationRequest, @@ -139,8 +149,10 @@ WardenSubjectAuthorizationRequest, WardenSubjectAuthorizationResponse, Writer, + HealthApi, PolicyApi, RoleApi, + VersionApi, WardenApi ) { 'use strict' @@ -223,10 +235,20 @@ */ Handler: Handler, /** - * The InlineResponse401 model constructor. - * @property {module:model/InlineResponse401} + * The HealthNotReadyStatus model constructor. + * @property {module:model/HealthNotReadyStatus} + */ + HealthNotReadyStatus: HealthNotReadyStatus, + /** + * The HealthStatus model constructor. + * @property {module:model/HealthStatus} + */ + HealthStatus: HealthStatus, + /** + * The InlineResponse500 model constructor. + * @property {module:model/InlineResponse500} */ - InlineResponse401: InlineResponse401, + InlineResponse500: InlineResponse500, /** * The IntrospectionResponse model constructor. * @property {module:model/IntrospectionResponse} @@ -317,6 +339,11 @@ * @property {module:model/SwaggerWardenBaseRequest} */ SwaggerWardenBaseRequest: SwaggerWardenBaseRequest, + /** + * The Version model constructor. + * @property {module:model/Version} + */ + Version: Version, /** * The WardenOAuth2AccessTokenAuthorizationRequest model constructor. * @property {module:model/WardenOAuth2AccessTokenAuthorizationRequest} @@ -352,6 +379,11 @@ * @property {module:model/Writer} */ Writer: Writer, + /** + * The HealthApi service constructor. + * @property {module:api/HealthApi} + */ + HealthApi: HealthApi, /** * The PolicyApi service constructor. * @property {module:api/PolicyApi} @@ -362,6 +394,11 @@ * @property {module:api/RoleApi} */ RoleApi: RoleApi, + /** + * The VersionApi service constructor. + * @property {module:api/VersionApi} + */ + VersionApi: VersionApi, /** * The WardenApi service constructor. * @property {module:api/WardenApi} diff --git a/sdk/js/swagger/src/model/AuthenticationDefaultSession.js b/sdk/js/swagger/src/model/AuthenticationDefaultSession.js index ca35674ab..a53b07e8a 100644 --- a/sdk/js/swagger/src/model/AuthenticationDefaultSession.js +++ b/sdk/js/swagger/src/model/AuthenticationDefaultSession.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/AuthenticationOAuth2ClientCredentialsRequest.js b/sdk/js/swagger/src/model/AuthenticationOAuth2ClientCredentialsRequest.js index 0009d773d..8b52084c1 100644 --- a/sdk/js/swagger/src/model/AuthenticationOAuth2ClientCredentialsRequest.js +++ b/sdk/js/swagger/src/model/AuthenticationOAuth2ClientCredentialsRequest.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/AuthenticationOAuth2ClientCredentialsSession.js b/sdk/js/swagger/src/model/AuthenticationOAuth2ClientCredentialsSession.js index f417033ca..f16e16a33 100644 --- a/sdk/js/swagger/src/model/AuthenticationOAuth2ClientCredentialsSession.js +++ b/sdk/js/swagger/src/model/AuthenticationOAuth2ClientCredentialsSession.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/AuthenticationOAuth2IntrospectionRequest.js b/sdk/js/swagger/src/model/AuthenticationOAuth2IntrospectionRequest.js index 68efc4bd6..5a4ecda59 100644 --- a/sdk/js/swagger/src/model/AuthenticationOAuth2IntrospectionRequest.js +++ b/sdk/js/swagger/src/model/AuthenticationOAuth2IntrospectionRequest.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/AuthenticationOAuth2Session.js b/sdk/js/swagger/src/model/AuthenticationOAuth2Session.js index c1b26e16e..85b7d5418 100644 --- a/sdk/js/swagger/src/model/AuthenticationOAuth2Session.js +++ b/sdk/js/swagger/src/model/AuthenticationOAuth2Session.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/Authenticator.js b/sdk/js/swagger/src/model/Authenticator.js index 380632232..a575d6178 100644 --- a/sdk/js/swagger/src/model/Authenticator.js +++ b/sdk/js/swagger/src/model/Authenticator.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/Firewall.js b/sdk/js/swagger/src/model/Firewall.js index 245a6a881..4a39475bb 100644 --- a/sdk/js/swagger/src/model/Firewall.js +++ b/sdk/js/swagger/src/model/Firewall.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/Handler.js b/sdk/js/swagger/src/model/Handler.js index 0d85785ec..0ca74467d 100644 --- a/sdk/js/swagger/src/model/Handler.js +++ b/sdk/js/swagger/src/model/Handler.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/HealthNotReadyStatus.js b/sdk/js/swagger/src/model/HealthNotReadyStatus.js new file mode 100644 index 000000000..66468de2f --- /dev/null +++ b/sdk/js/swagger/src/model/HealthNotReadyStatus.js @@ -0,0 +1,78 @@ +/** + * + * Package main ORY Keto + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory) + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')) + } else { + // Browser globals (root is window) + if (!root.SwaggerJsClient) { + root.SwaggerJsClient = {} + } + root.SwaggerJsClient.HealthNotReadyStatus = factory( + root.SwaggerJsClient.ApiClient + ) + } +})(this, function(ApiClient) { + 'use strict' + + /** + * The HealthNotReadyStatus model module. + * @module model/HealthNotReadyStatus + * @version Latest + */ + + /** + * Constructs a new HealthNotReadyStatus. + * @alias module:model/HealthNotReadyStatus + * @class + */ + var exports = function() { + var _this = this + } + + /** + * Constructs a HealthNotReadyStatus from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/HealthNotReadyStatus} obj Optional instance to populate. + * @return {module:model/HealthNotReadyStatus} The populated HealthNotReadyStatus instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports() + + if (data.hasOwnProperty('errors')) { + obj['errors'] = ApiClient.convertToType(data['errors'], { + String: 'String' + }) + } + } + return obj + } + + /** + * Errors contains a list of errors that caused the not ready status. + * @member {Object.} errors + */ + exports.prototype['errors'] = undefined + + return exports +}) diff --git a/sdk/js/swagger/src/model/HealthStatus.js b/sdk/js/swagger/src/model/HealthStatus.js new file mode 100644 index 000000000..43c7243c7 --- /dev/null +++ b/sdk/js/swagger/src/model/HealthStatus.js @@ -0,0 +1,74 @@ +/** + * + * Package main ORY Keto + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory) + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')) + } else { + // Browser globals (root is window) + if (!root.SwaggerJsClient) { + root.SwaggerJsClient = {} + } + root.SwaggerJsClient.HealthStatus = factory(root.SwaggerJsClient.ApiClient) + } +})(this, function(ApiClient) { + 'use strict' + + /** + * The HealthStatus model module. + * @module model/HealthStatus + * @version Latest + */ + + /** + * Constructs a new HealthStatus. + * @alias module:model/HealthStatus + * @class + */ + var exports = function() { + var _this = this + } + + /** + * Constructs a HealthStatus from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/HealthStatus} obj Optional instance to populate. + * @return {module:model/HealthStatus} The populated HealthStatus instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports() + + if (data.hasOwnProperty('status')) { + obj['status'] = ApiClient.convertToType(data['status'], 'String') + } + } + return obj + } + + /** + * Status always contains \"ok\". + * @member {String} status + */ + exports.prototype['status'] = undefined + + return exports +}) diff --git a/sdk/js/swagger/src/model/InlineResponse401.js b/sdk/js/swagger/src/model/InlineResponse500.js similarity index 85% rename from sdk/js/swagger/src/model/InlineResponse401.js rename to sdk/js/swagger/src/model/InlineResponse500.js index fc7df7c7f..82248da1c 100644 --- a/sdk/js/swagger/src/model/InlineResponse401.js +++ b/sdk/js/swagger/src/model/InlineResponse500.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest @@ -26,7 +26,7 @@ if (!root.SwaggerJsClient) { root.SwaggerJsClient = {} } - root.SwaggerJsClient.InlineResponse401 = factory( + root.SwaggerJsClient.InlineResponse500 = factory( root.SwaggerJsClient.ApiClient ) } @@ -34,14 +34,14 @@ 'use strict' /** - * The InlineResponse401 model module. - * @module model/InlineResponse401 + * The InlineResponse500 model module. + * @module model/InlineResponse500 * @version Latest */ /** - * Constructs a new InlineResponse401. - * @alias module:model/InlineResponse401 + * Constructs a new InlineResponse500. + * @alias module:model/InlineResponse500 * @class */ var exports = function() { @@ -49,11 +49,11 @@ } /** - * Constructs a InlineResponse401 from a plain JavaScript object, optionally creating a new instance. + * Constructs a InlineResponse500 from a plain JavaScript object, optionally creating a new instance. * Copies all relevant properties from data to obj if supplied or a new instance if not. * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/InlineResponse401} obj Optional instance to populate. - * @return {module:model/InlineResponse401} The populated InlineResponse401 instance. + * @param {module:model/InlineResponse500} obj Optional instance to populate. + * @return {module:model/InlineResponse500} The populated InlineResponse500 instance. */ exports.constructFromObject = function(data, obj) { if (data) { diff --git a/sdk/js/swagger/src/model/IntrospectionResponse.js b/sdk/js/swagger/src/model/IntrospectionResponse.js index a21e21b2f..e873fb660 100644 --- a/sdk/js/swagger/src/model/IntrospectionResponse.js +++ b/sdk/js/swagger/src/model/IntrospectionResponse.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/Manager.js b/sdk/js/swagger/src/model/Manager.js index 23c7e52ff..8f3a0f78c 100644 --- a/sdk/js/swagger/src/model/Manager.js +++ b/sdk/js/swagger/src/model/Manager.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/OAuth2ClientCredentialsAuthentication.js b/sdk/js/swagger/src/model/OAuth2ClientCredentialsAuthentication.js index ac3ea3d37..ee1f550ab 100644 --- a/sdk/js/swagger/src/model/OAuth2ClientCredentialsAuthentication.js +++ b/sdk/js/swagger/src/model/OAuth2ClientCredentialsAuthentication.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/OAuth2IntrospectionAuthentication.js b/sdk/js/swagger/src/model/OAuth2IntrospectionAuthentication.js index fdf8cc89f..0edd69f8a 100644 --- a/sdk/js/swagger/src/model/OAuth2IntrospectionAuthentication.js +++ b/sdk/js/swagger/src/model/OAuth2IntrospectionAuthentication.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/Policy.js b/sdk/js/swagger/src/model/Policy.js index e536ecb64..f22ba2f74 100644 --- a/sdk/js/swagger/src/model/Policy.js +++ b/sdk/js/swagger/src/model/Policy.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/PolicyConditions.js b/sdk/js/swagger/src/model/PolicyConditions.js index c420d35bc..21cf08bb4 100644 --- a/sdk/js/swagger/src/model/PolicyConditions.js +++ b/sdk/js/swagger/src/model/PolicyConditions.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/Role.js b/sdk/js/swagger/src/model/Role.js index a16acedb8..738e5c857 100644 --- a/sdk/js/swagger/src/model/Role.js +++ b/sdk/js/swagger/src/model/Role.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/RoleMembers.js b/sdk/js/swagger/src/model/RoleMembers.js index 038363279..0468c6e65 100644 --- a/sdk/js/swagger/src/model/RoleMembers.js +++ b/sdk/js/swagger/src/model/RoleMembers.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/Session.js b/sdk/js/swagger/src/model/Session.js index fc6ba8ae4..9d7631fe4 100644 --- a/sdk/js/swagger/src/model/Session.js +++ b/sdk/js/swagger/src/model/Session.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/SwaggerCreatePolicyParameters.js b/sdk/js/swagger/src/model/SwaggerCreatePolicyParameters.js index 21b5d6ee4..d8b9284cd 100644 --- a/sdk/js/swagger/src/model/SwaggerCreatePolicyParameters.js +++ b/sdk/js/swagger/src/model/SwaggerCreatePolicyParameters.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/SwaggerDoesWardenAllowAccessRequestParameters.js b/sdk/js/swagger/src/model/SwaggerDoesWardenAllowAccessRequestParameters.js index dec030288..c41bfb066 100644 --- a/sdk/js/swagger/src/model/SwaggerDoesWardenAllowAccessRequestParameters.js +++ b/sdk/js/swagger/src/model/SwaggerDoesWardenAllowAccessRequestParameters.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/SwaggerDoesWardenAllowClientRequestParameters.js b/sdk/js/swagger/src/model/SwaggerDoesWardenAllowClientRequestParameters.js index aed75e400..0201d7c60 100644 --- a/sdk/js/swagger/src/model/SwaggerDoesWardenAllowClientRequestParameters.js +++ b/sdk/js/swagger/src/model/SwaggerDoesWardenAllowClientRequestParameters.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest @@ -17,10 +17,10 @@ ;(function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define( - ['ApiClient', 'model/WardenOAuth2ClientAuthorizationRequest'], - factory - ) + define([ + 'ApiClient', + 'model/WardenOAuth2ClientAuthorizationRequest' + ], factory) } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory( diff --git a/sdk/js/swagger/src/model/SwaggerDoesWardenAllowTokenAccessRequestParameters.js b/sdk/js/swagger/src/model/SwaggerDoesWardenAllowTokenAccessRequestParameters.js index ab8a384a4..b2ba4b3f4 100644 --- a/sdk/js/swagger/src/model/SwaggerDoesWardenAllowTokenAccessRequestParameters.js +++ b/sdk/js/swagger/src/model/SwaggerDoesWardenAllowTokenAccessRequestParameters.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest @@ -17,10 +17,10 @@ ;(function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define( - ['ApiClient', 'model/WardenOAuth2AccessTokenAuthorizationRequest'], - factory - ) + define([ + 'ApiClient', + 'model/WardenOAuth2AccessTokenAuthorizationRequest' + ], factory) } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory( diff --git a/sdk/js/swagger/src/model/SwaggerGetPolicyParameters.js b/sdk/js/swagger/src/model/SwaggerGetPolicyParameters.js index 7b3639f85..545405dda 100644 --- a/sdk/js/swagger/src/model/SwaggerGetPolicyParameters.js +++ b/sdk/js/swagger/src/model/SwaggerGetPolicyParameters.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/SwaggerListPolicyParameters.js b/sdk/js/swagger/src/model/SwaggerListPolicyParameters.js index 44500fc22..d35c227b9 100644 --- a/sdk/js/swagger/src/model/SwaggerListPolicyParameters.js +++ b/sdk/js/swagger/src/model/SwaggerListPolicyParameters.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/SwaggerListPolicyResponse.js b/sdk/js/swagger/src/model/SwaggerListPolicyResponse.js index 20c5c86a6..94aabe1b2 100644 --- a/sdk/js/swagger/src/model/SwaggerListPolicyResponse.js +++ b/sdk/js/swagger/src/model/SwaggerListPolicyResponse.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/SwaggerUpdatePolicyParameters.js b/sdk/js/swagger/src/model/SwaggerUpdatePolicyParameters.js index 127c05a2f..a0cdea359 100644 --- a/sdk/js/swagger/src/model/SwaggerUpdatePolicyParameters.js +++ b/sdk/js/swagger/src/model/SwaggerUpdatePolicyParameters.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/SwaggerWardenBaseRequest.js b/sdk/js/swagger/src/model/SwaggerWardenBaseRequest.js index 81fbb224b..59cd38ffe 100644 --- a/sdk/js/swagger/src/model/SwaggerWardenBaseRequest.js +++ b/sdk/js/swagger/src/model/SwaggerWardenBaseRequest.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/Version.js b/sdk/js/swagger/src/model/Version.js new file mode 100644 index 000000000..cd76ca48c --- /dev/null +++ b/sdk/js/swagger/src/model/Version.js @@ -0,0 +1,73 @@ +/** + * + * Package main ORY Keto + * + * OpenAPI spec version: Latest + * Contact: hi@ory.am + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.2.3 + * + * Do not edit the class manually. + * + */ + +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory) + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')) + } else { + // Browser globals (root is window) + if (!root.SwaggerJsClient) { + root.SwaggerJsClient = {} + } + root.SwaggerJsClient.Version = factory(root.SwaggerJsClient.ApiClient) + } +})(this, function(ApiClient) { + 'use strict' + + /** + * The Version model module. + * @module model/Version + * @version Latest + */ + + /** + * Constructs a new Version. + * @alias module:model/Version + * @class + */ + var exports = function() { + var _this = this + } + + /** + * Constructs a Version from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Version} obj Optional instance to populate. + * @return {module:model/Version} The populated Version instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports() + + if (data.hasOwnProperty('version')) { + obj['version'] = ApiClient.convertToType(data['version'], 'String') + } + } + return obj + } + + /** + * @member {String} version + */ + exports.prototype['version'] = undefined + + return exports +}) diff --git a/sdk/js/swagger/src/model/WardenOAuth2AccessTokenAuthorizationRequest.js b/sdk/js/swagger/src/model/WardenOAuth2AccessTokenAuthorizationRequest.js index 553822e1f..9d72d0244 100644 --- a/sdk/js/swagger/src/model/WardenOAuth2AccessTokenAuthorizationRequest.js +++ b/sdk/js/swagger/src/model/WardenOAuth2AccessTokenAuthorizationRequest.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/WardenOAuth2AccessTokenAuthorizationResponse.js b/sdk/js/swagger/src/model/WardenOAuth2AccessTokenAuthorizationResponse.js index b8a0aaa8d..0b292b844 100644 --- a/sdk/js/swagger/src/model/WardenOAuth2AccessTokenAuthorizationResponse.js +++ b/sdk/js/swagger/src/model/WardenOAuth2AccessTokenAuthorizationResponse.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/WardenOAuth2ClientAuthorizationRequest.js b/sdk/js/swagger/src/model/WardenOAuth2ClientAuthorizationRequest.js index ba26638fa..6e677a151 100644 --- a/sdk/js/swagger/src/model/WardenOAuth2ClientAuthorizationRequest.js +++ b/sdk/js/swagger/src/model/WardenOAuth2ClientAuthorizationRequest.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/WardenOAuth2ClientAuthorizationResponse.js b/sdk/js/swagger/src/model/WardenOAuth2ClientAuthorizationResponse.js index e2a247812..baea52ee5 100644 --- a/sdk/js/swagger/src/model/WardenOAuth2ClientAuthorizationResponse.js +++ b/sdk/js/swagger/src/model/WardenOAuth2ClientAuthorizationResponse.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/WardenSubjectAuthorizationRequest.js b/sdk/js/swagger/src/model/WardenSubjectAuthorizationRequest.js index d8d107eb4..c43ae959c 100644 --- a/sdk/js/swagger/src/model/WardenSubjectAuthorizationRequest.js +++ b/sdk/js/swagger/src/model/WardenSubjectAuthorizationRequest.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/WardenSubjectAuthorizationResponse.js b/sdk/js/swagger/src/model/WardenSubjectAuthorizationResponse.js index 79ff14f3b..4b2bc315f 100644 --- a/sdk/js/swagger/src/model/WardenSubjectAuthorizationResponse.js +++ b/sdk/js/swagger/src/model/WardenSubjectAuthorizationResponse.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/js/swagger/src/model/Writer.js b/sdk/js/swagger/src/model/Writer.js index 7500249c4..e81281602 100644 --- a/sdk/js/swagger/src/model/Writer.js +++ b/sdk/js/swagger/src/model/Writer.js @@ -1,5 +1,5 @@ /** - * + * * Package main ORY Keto * * OpenAPI spec version: Latest diff --git a/sdk/php/swagger/README.md b/sdk/php/swagger/README.md index 78df9a13e..648c8b1a0 100644 --- a/sdk/php/swagger/README.md +++ b/sdk/php/swagger/README.md @@ -57,14 +57,13 @@ Please follow the [installation procedure](#installation--usage) and then run th createPolicy($body); + $result = $api_instance->isInstanceAlive(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PolicyApi->createPolicy: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling HealthApi->isInstanceAlive: ', $e->getMessage(), PHP_EOL; } ?> @@ -76,6 +75,8 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*HealthApi* | [**isInstanceAlive**](docs/Api/HealthApi.md#isinstancealive) | **GET** /health/alive | Check the Alive Status +*HealthApi* | [**isInstanceReady**](docs/Api/HealthApi.md#isinstanceready) | **GET** /health/ready | Check the Readiness Status *PolicyApi* | [**createPolicy**](docs/Api/PolicyApi.md#createpolicy) | **POST** /policies | *PolicyApi* | [**deletePolicy**](docs/Api/PolicyApi.md#deletepolicy) | **DELETE** /policies/{id} | *PolicyApi* | [**getPolicy**](docs/Api/PolicyApi.md#getpolicy) | **GET** /policies/{id} | @@ -88,6 +89,7 @@ Class | Method | HTTP request | Description *RoleApi* | [**listRoles**](docs/Api/RoleApi.md#listroles) | **GET** /roles | List all roles *RoleApi* | [**removeMembersFromRole**](docs/Api/RoleApi.md#removemembersfromrole) | **DELETE** /roles/{id}/members | Remove members from a role *RoleApi* | [**setRole**](docs/Api/RoleApi.md#setrole) | **PUT** /roles/{id} | A Role represents a group of users that share the same role and thus permissions. A role could be an administrator, a moderator, a regular user or some other sort of role. +*VersionApi* | [**getVersion**](docs/Api/VersionApi.md#getversion) | **GET** /version | Get the version of Keto *WardenApi* | [**isOAuth2AccessTokenAuthorized**](docs/Api/WardenApi.md#isoauth2accesstokenauthorized) | **POST** /warden/oauth2/access-tokens/authorize | Check if an OAuth 2.0 access token is authorized to access a resource *WardenApi* | [**isOAuth2ClientAuthorized**](docs/Api/WardenApi.md#isoauth2clientauthorized) | **POST** /warden/oauth2/clients/authorize | Check if an OAuth 2.0 Client is authorized to access a resource *WardenApi* | [**isSubjectAuthorized**](docs/Api/WardenApi.md#issubjectauthorized) | **POST** /warden/subjects/authorize | Check if a subject is authorized to access a resource @@ -103,7 +105,9 @@ Class | Method | HTTP request | Description - [Authenticator](docs/Model/Authenticator.md) - [Firewall](docs/Model/Firewall.md) - [Handler](docs/Model/Handler.md) - - [InlineResponse401](docs/Model/InlineResponse401.md) + - [HealthNotReadyStatus](docs/Model/HealthNotReadyStatus.md) + - [HealthStatus](docs/Model/HealthStatus.md) + - [InlineResponse500](docs/Model/InlineResponse500.md) - [IntrospectionResponse](docs/Model/IntrospectionResponse.md) - [Manager](docs/Model/Manager.md) - [OAuth2ClientCredentialsAuthentication](docs/Model/OAuth2ClientCredentialsAuthentication.md) @@ -122,6 +126,7 @@ Class | Method | HTTP request | Description - [SwaggerListPolicyResponse](docs/Model/SwaggerListPolicyResponse.md) - [SwaggerUpdatePolicyParameters](docs/Model/SwaggerUpdatePolicyParameters.md) - [SwaggerWardenBaseRequest](docs/Model/SwaggerWardenBaseRequest.md) + - [Version](docs/Model/Version.md) - [WardenOAuth2AccessTokenAuthorizationRequest](docs/Model/WardenOAuth2AccessTokenAuthorizationRequest.md) - [WardenOAuth2AccessTokenAuthorizationResponse](docs/Model/WardenOAuth2AccessTokenAuthorizationResponse.md) - [WardenOAuth2ClientAuthorizationRequest](docs/Model/WardenOAuth2ClientAuthorizationRequest.md) diff --git a/sdk/php/swagger/docs/Api/HealthApi.md b/sdk/php/swagger/docs/Api/HealthApi.md new file mode 100644 index 000000000..669ac73c5 --- /dev/null +++ b/sdk/php/swagger/docs/Api/HealthApi.md @@ -0,0 +1,93 @@ +# keto\SDK\HealthApi +Client for keto + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**isInstanceAlive**](HealthApi.md#isInstanceAlive) | **GET** /health/alive | Check the Alive Status +[**isInstanceReady**](HealthApi.md#isInstanceReady) | **GET** /health/ready | Check the Readiness Status + + +# **isInstanceAlive** +> \keto\SDK\Model\HealthStatus isInstanceAlive() + +Check the Alive Status + +This endpoint returns a 200 status code when the HTTP server is up running. This status does currently not include checks whether the database connection is working. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. + +### Example +```php +isInstanceAlive(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling HealthApi->isInstanceAlive: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**\keto\SDK\Model\HealthStatus**](../Model/HealthStatus.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **isInstanceReady** +> \keto\SDK\Model\HealthStatus isInstanceReady() + +Check the Readiness Status + +This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well. This status does currently not include checks whether the database connection is working. This endpoint does not require the `X-Forwarded-Proto` header when TLS termination is set. Be aware that if you are running multiple nodes of ORY Keto, the health status will never refer to the cluster state, only to a single instance. + +### Example +```php +isInstanceReady(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling HealthApi->isInstanceReady: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**\keto\SDK\Model\HealthStatus**](../Model/HealthStatus.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/sdk/php/swagger/docs/Api/VersionApi.md b/sdk/php/swagger/docs/Api/VersionApi.md new file mode 100644 index 000000000..082a3efd6 --- /dev/null +++ b/sdk/php/swagger/docs/Api/VersionApi.md @@ -0,0 +1,51 @@ +# keto\SDK\VersionApi +Client for keto + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getVersion**](VersionApi.md#getVersion) | **GET** /version | Get the version of Keto + + +# **getVersion** +> \keto\SDK\Model\Version getVersion() + +Get the version of Keto + +This endpoint returns the version as `{ \"version\": \"VERSION\" }`. The version is only correct with the prebuilt binary and not custom builds. + +### Example +```php +getVersion(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling VersionApi->getVersion: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**\keto\SDK\Model\Version**](../Model/Version.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/sdk/php/swagger/docs/Model/HealthNotReadyStatus.md b/sdk/php/swagger/docs/Model/HealthNotReadyStatus.md new file mode 100644 index 000000000..f7c425090 --- /dev/null +++ b/sdk/php/swagger/docs/Model/HealthNotReadyStatus.md @@ -0,0 +1,10 @@ +# HealthNotReadyStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | **map[string,string]** | Errors contains a list of errors that caused the not ready status. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/HealthStatus.md b/sdk/php/swagger/docs/Model/HealthStatus.md new file mode 100644 index 000000000..6d7575b07 --- /dev/null +++ b/sdk/php/swagger/docs/Model/HealthStatus.md @@ -0,0 +1,10 @@ +# HealthStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | Status always contains \"ok\". | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/docs/Model/InlineResponse401.md b/sdk/php/swagger/docs/Model/InlineResponse500.md similarity index 96% rename from sdk/php/swagger/docs/Model/InlineResponse401.md rename to sdk/php/swagger/docs/Model/InlineResponse500.md index 9505aca20..02865d950 100644 --- a/sdk/php/swagger/docs/Model/InlineResponse401.md +++ b/sdk/php/swagger/docs/Model/InlineResponse500.md @@ -1,4 +1,4 @@ -# InlineResponse401 +# InlineResponse500 ## Properties Name | Type | Description | Notes diff --git a/sdk/php/swagger/docs/Model/Version.md b/sdk/php/swagger/docs/Model/Version.md new file mode 100644 index 000000000..ac06487cc --- /dev/null +++ b/sdk/php/swagger/docs/Model/Version.md @@ -0,0 +1,10 @@ +# Version + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/php/swagger/lib/Api/HealthApi.php b/sdk/php/swagger/lib/Api/HealthApi.php new file mode 100644 index 000000000..84285ab1e --- /dev/null +++ b/sdk/php/swagger/lib/Api/HealthApi.php @@ -0,0 +1,239 @@ +apiClient = $apiClient; + } + + /** + * Get API client + * + * @return \keto\SDK\ApiClient get the API client + */ + public function getApiClient() + { + return $this->apiClient; + } + + /** + * Set the API client + * + * @param \keto\SDK\ApiClient $apiClient set the API client + * + * @return HealthApi + */ + public function setApiClient(\keto\SDK\ApiClient $apiClient) + { + $this->apiClient = $apiClient; + return $this; + } + + /** + * Operation isInstanceAlive + * + * Check the Alive Status + * + * Client for keto + * + * @throws \keto\SDK\ApiException on non-2xx response + * @return \keto\SDK\Model\HealthStatus + */ + public function isInstanceAlive() + { + list($response) = $this->isInstanceAliveWithHttpInfo(); + return $response; + } + + /** + * Operation isInstanceAliveWithHttpInfo + * + * Check the Alive Status + * + * Client for keto + * + * @throws \keto\SDK\ApiException on non-2xx response + * @return array of \keto\SDK\Model\HealthStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function isInstanceAliveWithHttpInfo() + { + // parse inputs + $resourcePath = "/health/alive"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\keto\SDK\Model\HealthStatus', + '/health/alive' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\keto\SDK\Model\HealthStatus', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\HealthStatus', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 500: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation isInstanceReady + * + * Check the Readiness Status + * + * Client for keto + * + * @throws \keto\SDK\ApiException on non-2xx response + * @return \keto\SDK\Model\HealthStatus + */ + public function isInstanceReady() + { + list($response) = $this->isInstanceReadyWithHttpInfo(); + return $response; + } + + /** + * Operation isInstanceReadyWithHttpInfo + * + * Check the Readiness Status + * + * Client for keto + * + * @throws \keto\SDK\ApiException on non-2xx response + * @return array of \keto\SDK\Model\HealthStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function isInstanceReadyWithHttpInfo() + { + // parse inputs + $resourcePath = "/health/ready"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\keto\SDK\Model\HealthStatus', + '/health/ready' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\keto\SDK\Model\HealthStatus', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\HealthStatus', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + case 503: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\HealthNotReadyStatus', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } +} diff --git a/sdk/php/swagger/lib/Api/PolicyApi.php b/sdk/php/swagger/lib/Api/PolicyApi.php index 4c19cd87c..feeede07a 100644 --- a/sdk/php/swagger/lib/Api/PolicyApi.php +++ b/sdk/php/swagger/lib/Api/PolicyApi.php @@ -155,15 +155,15 @@ public function createPolicyWithHttpInfo($body = null) $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -245,15 +245,15 @@ public function deletePolicyWithHttpInfo($id) } catch (ApiException $e) { switch ($e->getCode()) { case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -339,15 +339,15 @@ public function getPolicyWithHttpInfo($id) $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -431,15 +431,15 @@ public function listPoliciesWithHttpInfo($offset = null, $limit = null) $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -532,15 +532,15 @@ public function updatePolicyWithHttpInfo($id, $body = null) $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } diff --git a/sdk/php/swagger/lib/Api/RoleApi.php b/sdk/php/swagger/lib/Api/RoleApi.php index 50c8ba66d..e157cb7cb 100644 --- a/sdk/php/swagger/lib/Api/RoleApi.php +++ b/sdk/php/swagger/lib/Api/RoleApi.php @@ -169,15 +169,15 @@ public function addMembersToRoleWithHttpInfo($id, $body = null) } catch (ApiException $e) { switch ($e->getCode()) { case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -260,15 +260,15 @@ public function createRoleWithHttpInfo($body = null) $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -354,15 +354,15 @@ public function deleteRoleWithHttpInfo($id) } catch (ApiException $e) { switch ($e->getCode()) { case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -452,15 +452,15 @@ public function getRoleWithHttpInfo($id) $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -554,15 +554,15 @@ public function listRolesWithHttpInfo($member = null, $limit = null, $offset = n $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -655,15 +655,15 @@ public function removeMembersFromRoleWithHttpInfo($id, $body = null) } catch (ApiException $e) { switch ($e->getCode()) { case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -735,15 +735,15 @@ public function setRoleWithHttpInfo() } catch (ApiException $e) { switch ($e->getCode()) { case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } diff --git a/sdk/php/swagger/lib/Api/VersionApi.php b/sdk/php/swagger/lib/Api/VersionApi.php new file mode 100644 index 000000000..56b40b5ea --- /dev/null +++ b/sdk/php/swagger/lib/Api/VersionApi.php @@ -0,0 +1,159 @@ +apiClient = $apiClient; + } + + /** + * Get API client + * + * @return \keto\SDK\ApiClient get the API client + */ + public function getApiClient() + { + return $this->apiClient; + } + + /** + * Set the API client + * + * @param \keto\SDK\ApiClient $apiClient set the API client + * + * @return VersionApi + */ + public function setApiClient(\keto\SDK\ApiClient $apiClient) + { + $this->apiClient = $apiClient; + return $this; + } + + /** + * Operation getVersion + * + * Get the version of Keto + * + * Client for keto + * + * @throws \keto\SDK\ApiException on non-2xx response + * @return \keto\SDK\Model\Version + */ + public function getVersion() + { + list($response) = $this->getVersionWithHttpInfo(); + return $response; + } + + /** + * Operation getVersionWithHttpInfo + * + * Get the version of Keto + * + * Client for keto + * + * @throws \keto\SDK\ApiException on non-2xx response + * @return array of \keto\SDK\Model\Version, HTTP status code, HTTP response headers (array of strings) + */ + public function getVersionWithHttpInfo() + { + // parse inputs + $resourcePath = "/version"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); + + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\keto\SDK\Model\Version', + '/version' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\keto\SDK\Model\Version', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\Version', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } +} diff --git a/sdk/php/swagger/lib/Api/WardenApi.php b/sdk/php/swagger/lib/Api/WardenApi.php index ed4ee15c9..956cf749e 100644 --- a/sdk/php/swagger/lib/Api/WardenApi.php +++ b/sdk/php/swagger/lib/Api/WardenApi.php @@ -159,15 +159,15 @@ public function isOAuth2AccessTokenAuthorizedWithHttpInfo($body = null) $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -250,15 +250,15 @@ public function isOAuth2ClientAuthorizedWithHttpInfo($body = null) $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -341,15 +341,15 @@ public function isSubjectAuthorizedWithHttpInfo($body = null) $e->setResponseObject($data); break; case 401: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 403: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; case 500: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse401', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\keto\SDK\Model\InlineResponse500', $e->getResponseHeaders()); $e->setResponseObject($data); break; } diff --git a/sdk/php/swagger/lib/Model/HealthNotReadyStatus.php b/sdk/php/swagger/lib/Model/HealthNotReadyStatus.php new file mode 100644 index 000000000..8c9ccdc1d --- /dev/null +++ b/sdk/php/swagger/lib/Model/HealthNotReadyStatus.php @@ -0,0 +1,240 @@ + 'map[string,string]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'errors' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'errors' => 'errors' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'errors' => 'setErrors' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'errors' => 'getErrors' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets errors + * @return map[string,string] + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * @param map[string,string] $errors Errors contains a list of errors that caused the not ready status. + * @return $this + */ + public function setErrors($errors) + { + $this->container['errors'] = $errors; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\keto\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\keto\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/HealthStatus.php b/sdk/php/swagger/lib/Model/HealthStatus.php new file mode 100644 index 000000000..dbb524790 --- /dev/null +++ b/sdk/php/swagger/lib/Model/HealthStatus.php @@ -0,0 +1,240 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'status' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets status + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * @param string $status Status always contains \"ok\". + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\keto\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\keto\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/sdk/php/swagger/lib/Model/InlineResponse401.php b/sdk/php/swagger/lib/Model/InlineResponse500.php similarity index 97% rename from sdk/php/swagger/lib/Model/InlineResponse401.php rename to sdk/php/swagger/lib/Model/InlineResponse500.php index 0ef6dfa5f..165e2f404 100644 --- a/sdk/php/swagger/lib/Model/InlineResponse401.php +++ b/sdk/php/swagger/lib/Model/InlineResponse500.php @@ -1,6 +1,6 @@ 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'version' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'version' => 'version' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'version' => 'setVersion' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'version' => 'getVersion' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['version'] = isset($data['version']) ? $data['version'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets version + * @return string + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * @param string $version + * @return $this + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode(\keto\SDK\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\keto\SDK\ObjectSerializer::sanitizeForSerialization($this)); + } +} + +