Compare commits

...

2 Commits

3 changed files with 11 additions and 12 deletions

View File

@@ -19,7 +19,6 @@ import (
)
var (
DIDGateURL = "https://did-gate-v3.bttcdn.com/1.0/name/"
DIDGateTimeout = 10 * time.Second
DIDCachePath = "/var/lib/olares"
)
@@ -90,7 +89,7 @@ type CheckJWSResult struct {
}
// resolveDID resolves a DID either from cache or from the DID gate
func ResolveOlaresName(olares_id string) (*didcore.ResolutionResult, error) {
func ResolveOlaresName(gateUrl, olares_id string) (*didcore.ResolutionResult, error) {
name := strings.Replace(olares_id, "@", ".", -1)
// Try to get from cache first
cached, err := getDB().Get([]byte(name), nil)
@@ -105,7 +104,7 @@ func ResolveOlaresName(olares_id string) (*didcore.ResolutionResult, error) {
client := &http.Client{
Timeout: DIDGateTimeout,
}
resp, err := client.Get(DIDGateURL + name)
resp, err := client.Get(gateUrl + name)
if err != nil {
return nil, fmt.Errorf("failed to fetch DID from gate: %w", err)
}
@@ -135,7 +134,7 @@ func ResolveOlaresName(olares_id string) (*didcore.ResolutionResult, error) {
}
// CheckJWS verifies a JWS and returns the terminus name, body and kid
func CheckJWS(jws string, duration int64) (*CheckJWSResult, error) {
func CheckJWS(gateUrl, jws string, duration int64) (*CheckJWSResult, error) {
var kid string
var name string
var timestamp int64
@@ -198,7 +197,7 @@ func CheckJWS(jws string, duration int64) (*CheckJWSResult, error) {
}
// Resolve DID
resolutionResult, err := ResolveOlaresName(name)
resolutionResult, err := ResolveOlaresName(gateUrl, name)
if err != nil {
return nil, fmt.Errorf("failed to resolve DID: %w", err)
}

View File

@@ -7,4 +7,4 @@ output:
-
name: beclab/apecloud-kubeblocks:1.0.1
-
name: beclab/kubeblock-addon-charts:v1.0.1-ext
name: beclab/kubeblock-addon-charts:v1.0.1-ext2

View File

@@ -11,7 +11,7 @@ spec:
or cluster of machines.
helm:
chartLocationURL: file:///minio-1.0.1.tgz
chartsImage: beclab/kubeblock-addon-charts:v1.0.1-ext
chartsImage: beclab/kubeblock-addon-charts:v1.0.1-ext2
chartsPathInImage: /charts
installValues: {}
valuesMapping:
@@ -44,7 +44,7 @@ spec:
and scaling.
helm:
chartLocationURL: file:///mongodb-1.0.1.tgz
chartsImage: beclab/kubeblock-addon-charts:v1.0.1-ext
chartsImage: beclab/kubeblock-addon-charts:v1.0.1-ext2
installable:
autoInstall: true
type: Helm
@@ -68,7 +68,7 @@ spec:
speed and relevance on production-scale workloads.
helm:
chartLocationURL: file:///elasticsearch-1.0.1.tgz
chartsImage: beclab/kubeblock-addon-charts:v1.0.1-ext
chartsImage: beclab/kubeblock-addon-charts:v1.0.1-ext2
installable:
autoInstall: true
type: Helm
@@ -90,7 +90,7 @@ spec:
description: RabbitMQ is a reliable and mature messaging and streaming broker.
helm:
chartLocationURL: file:///rabbitmq-1.0.1.tgz
chartsImage: beclab/kubeblock-addon-charts:v1.0.1-ext
chartsImage: beclab/kubeblock-addon-charts:v1.0.1-ext2
installable:
autoInstall: true
type: Helm
@@ -113,7 +113,7 @@ spec:
system that is widely used for web and application servers
helm:
chartLocationURL: file:///mariadb-1.0.1.tgz
chartsImage: beclab/kubeblock-addon-charts:v1.0.1-ext
chartsImage: beclab/kubeblock-addon-charts:v1.0.1-ext2
installable:
autoInstall: true
type: Helm
@@ -136,7 +136,7 @@ spec:
system (RDBMS)
helm:
chartLocationURL: file:///mysql-1.0.1.tgz
chartsImage: beclab/kubeblock-addon-charts:v1.0.1-ext
chartsImage: beclab/kubeblock-addon-charts:v1.0.1-ext2
installable:
autoInstall: true
type: Helm