mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #10979 from rainzm/cloudproxy/fix
fix for creating proxy endpoint
This commit is contained in:
@@ -110,8 +110,8 @@ func (man *SProxyEndpointManager) PerformCreateFromServer(ctx context.Context, u
|
||||
IntranetIpAddr: nic.IpAddr,
|
||||
}
|
||||
proxyendpoint.Name = name
|
||||
proxyendpoint.DomainId = userCred.GetProjectDomainId()
|
||||
proxyendpoint.ProjectId = userCred.GetProjectId()
|
||||
proxyendpoint.DomainId = serverInfo.Server.DomainId
|
||||
proxyendpoint.ProjectId = serverInfo.Server.ProjectId
|
||||
if err := man.TableSpec().Insert(ctx, proxyendpoint); err != nil {
|
||||
return nil, httperrors.NewServerError("database insertion error: %v", err)
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ func AddSshKeysHandler(prefix string, app *appsrv.Application) {
|
||||
func adminSshKeysHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) {
|
||||
publicOnly := false
|
||||
userCred := auth.FetchUserCredential(ctx, policy.FilterPolicyCredential)
|
||||
if !userCred.IsAllow(rbacutils.ScopeSystem, consts.GetServiceType(), "sshkeypairs", policy.PolicyActionGet) {
|
||||
if !userCred.IsAllow(rbacutils.ScopeDomain, consts.GetServiceType(), "sshkeypairs", policy.PolicyActionGet) {
|
||||
publicOnly = true
|
||||
}
|
||||
params := appctx.AppContextParams(ctx)
|
||||
|
||||
@@ -77,6 +77,7 @@ type EnabledStatusStandaloneResource struct {
|
||||
type VirtualResource struct {
|
||||
StatusStandaloneResource
|
||||
|
||||
DomainId string
|
||||
ProjectId string
|
||||
IsSystem bool
|
||||
PendingDeletedAt time.Time
|
||||
|
||||
Reference in New Issue
Block a user