mirror of
https://github.com/openziti/zrok.git
synced 2025-08-09 00:04:43 +02:00
generalized implementation of public/private share (#34)
This commit is contained in:
@ -3,8 +3,8 @@ package controller
|
||||
import (
|
||||
"github.com/openziti/edge-api/rest_management_api_client"
|
||||
"github.com/openziti/zrok/controller/zrokEdgeSdk"
|
||||
"github.com/openziti/zrok/model"
|
||||
"github.com/openziti/zrok/rest_server_zrok/operations/share"
|
||||
"github.com/openziti/zrok/sdk"
|
||||
)
|
||||
|
||||
type publicResourceAllocator struct{}
|
||||
@ -14,9 +14,9 @@ func newPublicResourceAllocator() *publicResourceAllocator {
|
||||
}
|
||||
|
||||
func (a *publicResourceAllocator) allocate(envZId, shrToken string, frontendZIds, frontendTemplates []string, params share.ShareParams, edge *rest_management_api_client.ZitiEdgeManagement) (shrZId string, frontendEndpoints []string, err error) {
|
||||
var authUsers []*model.AuthUser
|
||||
var authUsers []*sdk.AuthUser
|
||||
for _, authUser := range params.Body.AuthUsers {
|
||||
authUsers = append(authUsers, &model.AuthUser{authUser.Username, authUser.Password})
|
||||
authUsers = append(authUsers, &sdk.AuthUser{authUser.Username, authUser.Password})
|
||||
}
|
||||
cfgId, err := zrokEdgeSdk.CreateConfig(zrokProxyConfigId, envZId, shrToken, params.Body.AuthScheme, authUsers, edge)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user