mirror of
https://github.com/openziti/zrok.git
synced 2025-06-23 19:22:19 +02:00
make the old GET endpoint return an upgrade message (#859)
This commit is contained in:
parent
7d6feba2e9
commit
e8691803b2
@ -18,6 +18,8 @@ CHANGE: Refactored API implementation. Cleanup, lint removal, additional data el
|
||||
|
||||
CHANGE: Deprecated the `passwords` configuration stanza. The zrok controller and API console now use a hard-coded set of (what we believe to be) reasonable assumptions about password quality (https://github.com/openziti/zrok/issues/834)
|
||||
|
||||
CHANGE: The protocol for determining valid client versions has been changed. Previously a zrok client would do a `GET` against the `/api/v1/version` endpoint and do a local version string comparison (as a normal precondition to any API call) to see if the controller version matched. The protocol has been amended so that any out-of-date client using the old protocol will receive a version string indicating that they need to uprade their client. New clients will do a `POST` against the `/api/v1/version` endpoint, posting their client version, and the server will check for compatibility. Does not change the security posture in any significant way, but gives more flexibility on the server side for managing client compatibility (https://github.com/openziti/zrok/issues/859)
|
||||
|
||||
## v0.4.48
|
||||
|
||||
FIX: the Python SDK erroneously assumed the enabled zrok environment contained a config.json file, and was changed to only load it if the file was present (https://github.com/openziti/zrok/pull/853/).
|
||||
|
@ -2,11 +2,12 @@ package controller
|
||||
|
||||
import (
|
||||
"github.com/go-openapi/runtime/middleware"
|
||||
"github.com/openziti/zrok/build"
|
||||
"github.com/openziti/zrok/rest_model_zrok"
|
||||
"github.com/openziti/zrok/rest_server_zrok/operations/metadata"
|
||||
)
|
||||
|
||||
func versionHandler(_ metadata.VersionParams) middleware.Responder {
|
||||
return metadata.NewVersionOK().WithPayload(rest_model_zrok.Version(build.String()))
|
||||
outOfDate := "your local zrok installation is out of date and needs to be upgraded! " +
|
||||
"please visit 'https://github.com/openziti/zrok/releases' for the latest build!"
|
||||
return metadata.NewVersionOK().WithPayload(rest_model_zrok.Version(outOfDate))
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ func NewVersionOK() *VersionOK {
|
||||
/*
|
||||
VersionOK describes a response with status code 200, with default header values.
|
||||
|
||||
current server version
|
||||
legacy upgrade required
|
||||
*/
|
||||
type VersionOK struct {
|
||||
Payload rest_model_zrok.Version
|
||||
|
@ -1903,7 +1903,7 @@ func init() {
|
||||
"operationId": "version",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "current server version",
|
||||
"description": "legacy upgrade required",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/version"
|
||||
}
|
||||
@ -4108,7 +4108,7 @@ func init() {
|
||||
"operationId": "version",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "current server version",
|
||||
"description": "legacy upgrade required",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/version"
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import (
|
||||
const VersionOKCode int = 200
|
||||
|
||||
/*
|
||||
VersionOK current server version
|
||||
VersionOK legacy upgrade required
|
||||
|
||||
swagger:response versionOK
|
||||
*/
|
||||
|
@ -988,7 +988,7 @@ paths:
|
||||
operationId: version
|
||||
responses:
|
||||
200:
|
||||
description: current server version
|
||||
description: legacy upgrade required
|
||||
schema:
|
||||
$ref: "#/definitions/version"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user