mirror of
https://github.com/openziti/zrok.git
synced 2025-06-19 17:27:54 +02:00
Merge branch 'main' into v0.3.0
This commit is contained in:
commit
4b70a8a0d3
@ -39,4 +39,4 @@ The `zrok test loop` command now includes a shutdown hook to allow premature can
|
|||||||
|
|
||||||
# v0.2.18
|
# v0.2.18
|
||||||
|
|
||||||
* First official release in the `v0.2.x` series.
|
* DEFECT: Token generation has been improved to use an alphabet consisting of `[a-zA-Z0-9]`. Service token generation continues to use a case-insensitive alphabet consisting of `[a-z0-9]` to be DNS-safe.
|
||||||
|
@ -9,7 +9,6 @@ import (
|
|||||||
"github.com/openziti-test-kitchen/zrok/rest_model_zrok"
|
"github.com/openziti-test-kitchen/zrok/rest_model_zrok"
|
||||||
"github.com/openziti/edge/rest_management_api_client"
|
"github.com/openziti/edge/rest_management_api_client"
|
||||||
"github.com/openziti/edge/rest_util"
|
"github.com/openziti/edge/rest_util"
|
||||||
"github.com/teris-io/shortid"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -44,10 +43,6 @@ func edgeClient() (*rest_management_api_client.ZitiEdgeManagement, error) {
|
|||||||
return rest_util.NewEdgeManagementClientWithUpdb(cfg.Ziti.Username, cfg.Ziti.Password, cfg.Ziti.ApiEndpoint, caPool)
|
return rest_util.NewEdgeManagementClientWithUpdb(cfg.Ziti.Username, cfg.Ziti.Password, cfg.Ziti.ApiEndpoint, caPool)
|
||||||
}
|
}
|
||||||
|
|
||||||
func createToken() (string, error) {
|
|
||||||
return shortid.Generate()
|
|
||||||
}
|
|
||||||
|
|
||||||
func createServiceName() (string, error) {
|
func createServiceName() (string, error) {
|
||||||
gen, err := nanoid.CustomASCII("abcdefghijklmnopqrstuvwxyz0123456789", 12)
|
gen, err := nanoid.CustomASCII("abcdefghijklmnopqrstuvwxyz0123456789", 12)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -56,18 +51,12 @@ func createServiceName() (string, error) {
|
|||||||
return gen(), nil
|
return gen(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func dnsSafeShortId() (string, error) {
|
func createToken() (string, error) {
|
||||||
sid, err := shortid.Generate()
|
gen, err := nanoid.CustomASCII("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", 12)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
for sid[0] == '-' || sid[0] == '_' {
|
return gen(), nil
|
||||||
sid, err = shortid.Generate()
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sid, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func hashPassword(raw string) string {
|
func hashPassword(raw string) string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user