mirror of
https://github.com/MirageNetwork/MirageServer.git
synced 2026-04-22 23:57:23 +08:00
修改: 在organization中添加Acl相关字段;AclRules和SSHPolicy不保存db,由ACLPolicy生成;减少重复查询,添加organization local缓存
This commit is contained in:
@@ -72,7 +72,16 @@ func (h *Mirage) generateMapResponse(
|
||||
)
|
||||
|
||||
now := time.Now()
|
||||
org, err := h.GetOrgnaizationByName(machine.User.OrgName)
|
||||
if err != nil {
|
||||
log.Error().
|
||||
Caller().
|
||||
Str("func", "generateMapResponse").
|
||||
Err(err).
|
||||
Msg("Failed to get organization of machine")
|
||||
|
||||
return nil, err
|
||||
}
|
||||
resp := tailcfg.MapResponse{
|
||||
KeepAlive: false,
|
||||
Node: node,
|
||||
@@ -102,12 +111,12 @@ func (h *Mirage) generateMapResponse(
|
||||
CollectServices: "false",
|
||||
|
||||
// TODO: Only send if updated
|
||||
PacketFilter: h.aclRules,
|
||||
PacketFilter: org.AclRules,
|
||||
|
||||
UserProfiles: profiles,
|
||||
|
||||
// TODO: Only send if updated
|
||||
SSHPolicy: h.sshPolicy,
|
||||
SSHPolicy: org.SshPolicy,
|
||||
|
||||
ControlTime: &now,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user