mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-01 00:17:24 +00:00
fix: return absolute asset urls (#3676)
This commit is contained in:
parent
db0e7495e7
commit
62c4a4d08d
@ -164,13 +164,13 @@ func startAPIs(ctx context.Context, router *mux.Router, commands *command.Comman
|
|||||||
if err := authenticatedAPIs.RegisterServer(ctx, system.CreateServer(commands, queries, adminRepo, config.DefaultInstance)); err != nil {
|
if err := authenticatedAPIs.RegisterServer(ctx, system.CreateServer(commands, queries, adminRepo, config.DefaultInstance)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := authenticatedAPIs.RegisterServer(ctx, admin.CreateServer(commands, queries, adminRepo, assets.HandlerPrefix, keys.User)); err != nil {
|
if err := authenticatedAPIs.RegisterServer(ctx, admin.CreateServer(commands, queries, adminRepo, config.ExternalSecure, keys.User)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := authenticatedAPIs.RegisterServer(ctx, management.CreateServer(commands, queries, config.SystemDefaults, assets.HandlerPrefix, keys.User, config.ExternalSecure, oidc.HandlerPrefix, config.AuditLogRetention)); err != nil {
|
if err := authenticatedAPIs.RegisterServer(ctx, management.CreateServer(commands, queries, config.SystemDefaults, keys.User, config.ExternalSecure, oidc.HandlerPrefix, config.AuditLogRetention)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := authenticatedAPIs.RegisterServer(ctx, auth.CreateServer(commands, queries, authRepo, config.SystemDefaults, assets.HandlerPrefix, keys.User, config.ExternalSecure, config.AuditLogRetention)); err != nil {
|
if err := authenticatedAPIs.RegisterServer(ctx, auth.CreateServer(commands, queries, authRepo, config.SystemDefaults, keys.User, config.ExternalSecure, config.AuditLogRetention)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,12 @@ func (h *Handler) Storage() static.Storage {
|
|||||||
return h.storage
|
return h.storage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func AssetAPI(externalSecure bool) func(context.Context) string {
|
||||||
|
return func(ctx context.Context) string {
|
||||||
|
return http_util.BuildOrigin(authz.GetInstance(ctx).RequestedHost(), externalSecure) + HandlerPrefix
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
type Uploader interface {
|
type Uploader interface {
|
||||||
UploadAsset(ctx context.Context, info string, asset *command.AssetUpload, commands *command.Commands) error
|
UploadAsset(ctx context.Context, info string, asset *command.AssetUpload, commands *command.Commands) error
|
||||||
ObjectName(data authz.CtxData) (string, error)
|
ObjectName(data authz.CtxData) (string, error)
|
||||||
|
@ -13,7 +13,7 @@ func (s *Server) GetLabelPolicy(ctx context.Context, req *admin_pb.GetLabelPolic
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &admin_pb.GetLabelPolicyResponse{Policy: policy_grpc.ModelLabelPolicyToPb(policy, s.assetsAPIDomain)}, nil
|
return &admin_pb.GetLabelPolicyResponse{Policy: policy_grpc.ModelLabelPolicyToPb(policy, s.assetsAPIDomain(ctx))}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) GetPreviewLabelPolicy(ctx context.Context, req *admin_pb.GetPreviewLabelPolicyRequest) (*admin_pb.GetPreviewLabelPolicyResponse, error) {
|
func (s *Server) GetPreviewLabelPolicy(ctx context.Context, req *admin_pb.GetPreviewLabelPolicyRequest) (*admin_pb.GetPreviewLabelPolicyResponse, error) {
|
||||||
@ -21,7 +21,7 @@ func (s *Server) GetPreviewLabelPolicy(ctx context.Context, req *admin_pb.GetPre
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &admin_pb.GetPreviewLabelPolicyResponse{Policy: policy_grpc.ModelLabelPolicyToPb(policy, s.assetsAPIDomain)}, nil
|
return &admin_pb.GetPreviewLabelPolicyResponse{Policy: policy_grpc.ModelLabelPolicyToPb(policy, s.assetsAPIDomain(ctx))}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) UpdateLabelPolicy(ctx context.Context, req *admin_pb.UpdateLabelPolicyRequest) (*admin_pb.UpdateLabelPolicyResponse, error) {
|
func (s *Server) UpdateLabelPolicy(ctx context.Context, req *admin_pb.UpdateLabelPolicyRequest) (*admin_pb.UpdateLabelPolicyResponse, error) {
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
package admin
|
package admin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
"github.com/zitadel/zitadel/internal/admin/repository"
|
"github.com/zitadel/zitadel/internal/admin/repository"
|
||||||
"github.com/zitadel/zitadel/internal/admin/repository/eventsourcing"
|
"github.com/zitadel/zitadel/internal/admin/repository/eventsourcing"
|
||||||
|
"github.com/zitadel/zitadel/internal/api/assets"
|
||||||
"github.com/zitadel/zitadel/internal/api/authz"
|
"github.com/zitadel/zitadel/internal/api/authz"
|
||||||
"github.com/zitadel/zitadel/internal/api/grpc/server"
|
"github.com/zitadel/zitadel/internal/api/grpc/server"
|
||||||
"github.com/zitadel/zitadel/internal/command"
|
"github.com/zitadel/zitadel/internal/command"
|
||||||
@ -24,7 +27,7 @@ type Server struct {
|
|||||||
command *command.Commands
|
command *command.Commands
|
||||||
query *query.Queries
|
query *query.Queries
|
||||||
administrator repository.AdministratorRepository
|
administrator repository.AdministratorRepository
|
||||||
assetsAPIDomain string
|
assetsAPIDomain func(context.Context) string
|
||||||
userCodeAlg crypto.EncryptionAlgorithm
|
userCodeAlg crypto.EncryptionAlgorithm
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,14 +38,14 @@ type Config struct {
|
|||||||
func CreateServer(command *command.Commands,
|
func CreateServer(command *command.Commands,
|
||||||
query *query.Queries,
|
query *query.Queries,
|
||||||
repo repository.Repository,
|
repo repository.Repository,
|
||||||
assetsAPIDomain string,
|
externalSecure bool,
|
||||||
userCodeAlg crypto.EncryptionAlgorithm,
|
userCodeAlg crypto.EncryptionAlgorithm,
|
||||||
) *Server {
|
) *Server {
|
||||||
return &Server{
|
return &Server{
|
||||||
command: command,
|
command: command,
|
||||||
query: query,
|
query: query,
|
||||||
administrator: repo,
|
administrator: repo,
|
||||||
assetsAPIDomain: assetsAPIDomain,
|
assetsAPIDomain: assets.AssetAPI(externalSecure),
|
||||||
userCodeAlg: userCodeAlg,
|
userCodeAlg: userCodeAlg,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ func (s *Server) GetMyProfile(ctx context.Context, req *auth_pb.GetMyProfileRequ
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &auth_pb.GetMyProfileResponse{
|
return &auth_pb.GetMyProfileResponse{
|
||||||
Profile: user_grpc.ProfileToPb(profile, s.assetsAPIDomain),
|
Profile: user_grpc.ProfileToPb(profile, s.assetsAPIDomain(ctx)),
|
||||||
Details: object_grpc.ToViewDetailsPb(
|
Details: object_grpc.ToViewDetailsPb(
|
||||||
profile.Sequence,
|
profile.Sequence,
|
||||||
profile.CreationDate,
|
profile.CreationDate,
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package auth
|
package auth
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
|
"github.com/zitadel/zitadel/internal/api/assets"
|
||||||
"github.com/zitadel/zitadel/internal/api/authz"
|
"github.com/zitadel/zitadel/internal/api/authz"
|
||||||
"github.com/zitadel/zitadel/internal/api/grpc/server"
|
"github.com/zitadel/zitadel/internal/api/grpc/server"
|
||||||
"github.com/zitadel/zitadel/internal/auth/repository"
|
"github.com/zitadel/zitadel/internal/auth/repository"
|
||||||
@ -28,7 +30,7 @@ type Server struct {
|
|||||||
query *query.Queries
|
query *query.Queries
|
||||||
repo repository.Repository
|
repo repository.Repository
|
||||||
defaults systemdefaults.SystemDefaults
|
defaults systemdefaults.SystemDefaults
|
||||||
assetsAPIDomain string
|
assetsAPIDomain func(context.Context) string
|
||||||
userCodeAlg crypto.EncryptionAlgorithm
|
userCodeAlg crypto.EncryptionAlgorithm
|
||||||
externalSecure bool
|
externalSecure bool
|
||||||
auditLogRetention time.Duration
|
auditLogRetention time.Duration
|
||||||
@ -42,7 +44,6 @@ func CreateServer(command *command.Commands,
|
|||||||
query *query.Queries,
|
query *query.Queries,
|
||||||
authRepo repository.Repository,
|
authRepo repository.Repository,
|
||||||
defaults systemdefaults.SystemDefaults,
|
defaults systemdefaults.SystemDefaults,
|
||||||
assetsAPIDomain string,
|
|
||||||
userCodeAlg crypto.EncryptionAlgorithm,
|
userCodeAlg crypto.EncryptionAlgorithm,
|
||||||
externalSecure bool,
|
externalSecure bool,
|
||||||
auditLogRetention time.Duration,
|
auditLogRetention time.Duration,
|
||||||
@ -52,7 +53,7 @@ func CreateServer(command *command.Commands,
|
|||||||
query: query,
|
query: query,
|
||||||
repo: authRepo,
|
repo: authRepo,
|
||||||
defaults: defaults,
|
defaults: defaults,
|
||||||
assetsAPIDomain: assetsAPIDomain,
|
assetsAPIDomain: assets.AssetAPI(externalSecure),
|
||||||
userCodeAlg: userCodeAlg,
|
userCodeAlg: userCodeAlg,
|
||||||
externalSecure: externalSecure,
|
externalSecure: externalSecure,
|
||||||
auditLogRetention: auditLogRetention,
|
auditLogRetention: auditLogRetention,
|
||||||
|
@ -20,7 +20,7 @@ func (s *Server) GetMyUser(ctx context.Context, _ *auth_pb.GetMyUserRequest) (*a
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &auth_pb.GetMyUserResponse{User: user_grpc.UserToPb(user, s.assetsAPIDomain)}, nil
|
return &auth_pb.GetMyUserResponse{User: user_grpc.UserToPb(user, s.assetsAPIDomain(ctx))}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) RemoveMyUser(ctx context.Context, _ *auth_pb.RemoveMyUserRequest) (*auth_pb.RemoveMyUserResponse, error) {
|
func (s *Server) RemoveMyUser(ctx context.Context, _ *auth_pb.RemoveMyUserRequest) (*auth_pb.RemoveMyUserResponse, error) {
|
||||||
@ -61,7 +61,7 @@ func (s *Server) ListMyUserChanges(ctx context.Context, req *auth_pb.ListMyUserC
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &auth_pb.ListMyUserChangesResponse{
|
return &auth_pb.ListMyUserChangesResponse{
|
||||||
Result: change.ChangesToPb(changes.Changes, s.assetsAPIDomain),
|
Result: change.ChangesToPb(changes.Changes, s.assetsAPIDomain(ctx)),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ func (s *Server) ListOrgChanges(ctx context.Context, req *mgmt_pb.ListOrgChanges
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.ListOrgChangesResponse{
|
return &mgmt_pb.ListOrgChangesResponse{
|
||||||
Result: change_grpc.ChangesToPb(response.Changes, s.assetAPIPrefix),
|
Result: change_grpc.ChangesToPb(response.Changes, s.assetAPIPrefix(ctx)),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ func (s *Server) ListOrgMembers(ctx context.Context, req *mgmt_pb.ListOrgMembers
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.ListOrgMembersResponse{
|
return &mgmt_pb.ListOrgMembersResponse{
|
||||||
Result: member_grpc.MembersToPb(s.assetAPIPrefix, members.Members),
|
Result: member_grpc.MembersToPb(s.assetAPIPrefix(ctx), members.Members),
|
||||||
Details: object.ToListDetails(
|
Details: object.ToListDetails(
|
||||||
members.Count,
|
members.Count,
|
||||||
members.Sequence,
|
members.Sequence,
|
||||||
|
@ -14,7 +14,7 @@ func (s *Server) GetLabelPolicy(ctx context.Context, req *mgmt_pb.GetLabelPolicy
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.GetLabelPolicyResponse{Policy: policy_grpc.ModelLabelPolicyToPb(policy, s.assetAPIPrefix), IsDefault: policy.IsDefault}, nil
|
return &mgmt_pb.GetLabelPolicyResponse{Policy: policy_grpc.ModelLabelPolicyToPb(policy, s.assetAPIPrefix(ctx)), IsDefault: policy.IsDefault}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) GetPreviewLabelPolicy(ctx context.Context, req *mgmt_pb.GetPreviewLabelPolicyRequest) (*mgmt_pb.GetPreviewLabelPolicyResponse, error) {
|
func (s *Server) GetPreviewLabelPolicy(ctx context.Context, req *mgmt_pb.GetPreviewLabelPolicyRequest) (*mgmt_pb.GetPreviewLabelPolicyResponse, error) {
|
||||||
@ -22,7 +22,7 @@ func (s *Server) GetPreviewLabelPolicy(ctx context.Context, req *mgmt_pb.GetPrev
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.GetPreviewLabelPolicyResponse{Policy: policy_grpc.ModelLabelPolicyToPb(policy, s.assetAPIPrefix), IsDefault: policy.IsDefault}, nil
|
return &mgmt_pb.GetPreviewLabelPolicyResponse{Policy: policy_grpc.ModelLabelPolicyToPb(policy, s.assetAPIPrefix(ctx)), IsDefault: policy.IsDefault}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) GetDefaultLabelPolicy(ctx context.Context, req *mgmt_pb.GetDefaultLabelPolicyRequest) (*mgmt_pb.GetDefaultLabelPolicyResponse, error) {
|
func (s *Server) GetDefaultLabelPolicy(ctx context.Context, req *mgmt_pb.GetDefaultLabelPolicyRequest) (*mgmt_pb.GetDefaultLabelPolicyResponse, error) {
|
||||||
@ -30,7 +30,7 @@ func (s *Server) GetDefaultLabelPolicy(ctx context.Context, req *mgmt_pb.GetDefa
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.GetDefaultLabelPolicyResponse{Policy: policy_grpc.ModelLabelPolicyToPb(policy, s.assetAPIPrefix)}, nil
|
return &mgmt_pb.GetDefaultLabelPolicyResponse{Policy: policy_grpc.ModelLabelPolicyToPb(policy, s.assetAPIPrefix(ctx))}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) AddCustomLabelPolicy(ctx context.Context, req *mgmt_pb.AddCustomLabelPolicyRequest) (*mgmt_pb.AddCustomLabelPolicyResponse, error) {
|
func (s *Server) AddCustomLabelPolicy(ctx context.Context, req *mgmt_pb.AddCustomLabelPolicyRequest) (*mgmt_pb.AddCustomLabelPolicyResponse, error) {
|
||||||
|
@ -116,7 +116,7 @@ func (s *Server) ListProjectChanges(ctx context.Context, req *mgmt_pb.ListProjec
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.ListProjectChangesResponse{
|
return &mgmt_pb.ListProjectChangesResponse{
|
||||||
Result: change_grpc.ChangesToPb(res.Changes, s.assetAPIPrefix),
|
Result: change_grpc.ChangesToPb(res.Changes, s.assetAPIPrefix(ctx)),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ func (s *Server) ListProjectMembers(ctx context.Context, req *mgmt_pb.ListProjec
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.ListProjectMembersResponse{
|
return &mgmt_pb.ListProjectMembersResponse{
|
||||||
Result: member_grpc.MembersToPb(s.assetAPIPrefix, members.Members),
|
Result: member_grpc.MembersToPb(s.assetAPIPrefix(ctx), members.Members),
|
||||||
Details: object_grpc.ToListDetails(
|
Details: object_grpc.ToListDetails(
|
||||||
members.Count,
|
members.Count,
|
||||||
members.Sequence,
|
members.Sequence,
|
||||||
|
@ -49,7 +49,7 @@ func (s *Server) ListAppChanges(ctx context.Context, req *mgmt_pb.ListAppChanges
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.ListAppChangesResponse{
|
return &mgmt_pb.ListAppChangesResponse{
|
||||||
Result: change_grpc.ChangesToPb(res.Changes, s.assetAPIPrefix),
|
Result: change_grpc.ChangesToPb(res.Changes, s.assetAPIPrefix(ctx)),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ func (s *Server) ListProjectGrantMembers(ctx context.Context, req *mgmt_pb.ListP
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.ListProjectGrantMembersResponse{
|
return &mgmt_pb.ListProjectGrantMembersResponse{
|
||||||
Result: member_grpc.MembersToPb(s.assetAPIPrefix, response.Members),
|
Result: member_grpc.MembersToPb(s.assetAPIPrefix(ctx), response.Members),
|
||||||
Details: object_grpc.ToListDetails(
|
Details: object_grpc.ToListDetails(
|
||||||
response.Count,
|
response.Count,
|
||||||
response.Sequence,
|
response.Sequence,
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package management
|
package management
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
|
"github.com/zitadel/zitadel/internal/api/assets"
|
||||||
"github.com/zitadel/zitadel/internal/api/authz"
|
"github.com/zitadel/zitadel/internal/api/authz"
|
||||||
"github.com/zitadel/zitadel/internal/api/grpc/server"
|
"github.com/zitadel/zitadel/internal/api/grpc/server"
|
||||||
"github.com/zitadel/zitadel/internal/command"
|
"github.com/zitadel/zitadel/internal/command"
|
||||||
@ -25,7 +27,7 @@ type Server struct {
|
|||||||
command *command.Commands
|
command *command.Commands
|
||||||
query *query.Queries
|
query *query.Queries
|
||||||
systemDefaults systemdefaults.SystemDefaults
|
systemDefaults systemdefaults.SystemDefaults
|
||||||
assetAPIPrefix string
|
assetAPIPrefix func(context.Context) string
|
||||||
passwordHashAlg crypto.HashAlgorithm
|
passwordHashAlg crypto.HashAlgorithm
|
||||||
userCodeAlg crypto.EncryptionAlgorithm
|
userCodeAlg crypto.EncryptionAlgorithm
|
||||||
externalSecure bool
|
externalSecure bool
|
||||||
@ -37,7 +39,6 @@ func CreateServer(
|
|||||||
command *command.Commands,
|
command *command.Commands,
|
||||||
query *query.Queries,
|
query *query.Queries,
|
||||||
sd systemdefaults.SystemDefaults,
|
sd systemdefaults.SystemDefaults,
|
||||||
assetAPIPrefix string,
|
|
||||||
userCodeAlg crypto.EncryptionAlgorithm,
|
userCodeAlg crypto.EncryptionAlgorithm,
|
||||||
externalSecure bool,
|
externalSecure bool,
|
||||||
issuerPath string,
|
issuerPath string,
|
||||||
@ -47,7 +48,7 @@ func CreateServer(
|
|||||||
command: command,
|
command: command,
|
||||||
query: query,
|
query: query,
|
||||||
systemDefaults: sd,
|
systemDefaults: sd,
|
||||||
assetAPIPrefix: assetAPIPrefix,
|
assetAPIPrefix: assets.AssetAPI(externalSecure),
|
||||||
passwordHashAlg: crypto.NewBCrypt(sd.SecretGenerators.PasswordSaltCost),
|
passwordHashAlg: crypto.NewBCrypt(sd.SecretGenerators.PasswordSaltCost),
|
||||||
userCodeAlg: userCodeAlg,
|
userCodeAlg: userCodeAlg,
|
||||||
externalSecure: externalSecure,
|
externalSecure: externalSecure,
|
||||||
|
@ -35,7 +35,7 @@ func (s *Server) GetUserByID(ctx context.Context, req *mgmt_pb.GetUserByIDReques
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.GetUserByIDResponse{
|
return &mgmt_pb.GetUserByIDResponse{
|
||||||
User: user_grpc.UserToPb(user, s.assetAPIPrefix),
|
User: user_grpc.UserToPb(user, s.assetAPIPrefix(ctx)),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ func (s *Server) GetUserByLoginNameGlobal(ctx context.Context, req *mgmt_pb.GetU
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.GetUserByLoginNameGlobalResponse{
|
return &mgmt_pb.GetUserByLoginNameGlobalResponse{
|
||||||
User: user_grpc.UserToPb(user, s.assetAPIPrefix),
|
User: user_grpc.UserToPb(user, s.assetAPIPrefix(ctx)),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ func (s *Server) ListUsers(ctx context.Context, req *mgmt_pb.ListUsersRequest) (
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.ListUsersResponse{
|
return &mgmt_pb.ListUsersResponse{
|
||||||
Result: user_grpc.UsersToPb(res.Users, s.assetAPIPrefix),
|
Result: user_grpc.UsersToPb(res.Users, s.assetAPIPrefix(ctx)),
|
||||||
Details: obj_grpc.ToListDetails(
|
Details: obj_grpc.ToListDetails(
|
||||||
res.Count,
|
res.Count,
|
||||||
res.Sequence,
|
res.Sequence,
|
||||||
@ -84,7 +84,7 @@ func (s *Server) ListUserChanges(ctx context.Context, req *mgmt_pb.ListUserChang
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.ListUserChangesResponse{
|
return &mgmt_pb.ListUserChangesResponse{
|
||||||
Result: change_grpc.ChangesToPb(res.Changes, s.assetAPIPrefix),
|
Result: change_grpc.ChangesToPb(res.Changes, s.assetAPIPrefix(ctx)),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -383,7 +383,7 @@ func (s *Server) GetHumanProfile(ctx context.Context, req *mgmt_pb.GetHumanProfi
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.GetHumanProfileResponse{
|
return &mgmt_pb.GetHumanProfileResponse{
|
||||||
Profile: user_grpc.ProfileToPb(profile, s.assetAPIPrefix),
|
Profile: user_grpc.ProfileToPb(profile, s.assetAPIPrefix(ctx)),
|
||||||
Details: obj_grpc.ToViewDetailsPb(
|
Details: obj_grpc.ToViewDetailsPb(
|
||||||
profile.Sequence,
|
profile.Sequence,
|
||||||
profile.CreationDate,
|
profile.CreationDate,
|
||||||
|
@ -24,7 +24,7 @@ func (s *Server) GetUserGrantByID(ctx context.Context, req *mgmt_pb.GetUserGrant
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.GetUserGrantByIDResponse{
|
return &mgmt_pb.GetUserGrantByIDResponse{
|
||||||
UserGrant: user.UserGrantToPb(s.assetAPIPrefix, grant),
|
UserGrant: user.UserGrantToPb(s.assetAPIPrefix(ctx), grant),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ func (s *Server) ListUserGrants(ctx context.Context, req *mgmt_pb.ListUserGrantR
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &mgmt_pb.ListUserGrantResponse{
|
return &mgmt_pb.ListUserGrantResponse{
|
||||||
Result: user.UserGrantsToPb(s.assetAPIPrefix, res.UserGrants),
|
Result: user.UserGrantsToPb(s.assetAPIPrefix(ctx), res.UserGrants),
|
||||||
Details: obj_grpc.ToListDetails(
|
Details: obj_grpc.ToListDetails(
|
||||||
res.Count,
|
res.Count,
|
||||||
res.Sequence,
|
res.Sequence,
|
||||||
|
@ -42,5 +42,5 @@ func AssetURL(prefix, resourceOwner, key string) string {
|
|||||||
if prefix == "" || resourceOwner == "" || key == "" {
|
if prefix == "" || resourceOwner == "" || key == "" {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return prefix + resourceOwner + "/" + key
|
return prefix + "/" + resourceOwner + "/" + key
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user