fix policy
This commit is contained in:
parent
3ab82a13b5
commit
082fb1547e
@ -261,7 +261,7 @@ extension SDLContextActor {
|
||||
await self.handleEvent(event: event)
|
||||
case .policyReponse(let policyResponse):
|
||||
// 处理权限的请求问题
|
||||
await self.policyService.identifyStore.applyPolicyResponse(policyResponse)
|
||||
await self.policyService.applyPolicyResponse(policyResponse)
|
||||
case .arpResponse(let arpResponse):
|
||||
SDLLogger.log("[SDLContext] get arp response: \(arpResponse)")
|
||||
await self.arpServer.handleArpResponse(arpResponse: arpResponse)
|
||||
|
||||
@ -101,10 +101,8 @@ extension SDLTunPacketRouter.RouteDecision {
|
||||
switch self {
|
||||
case .forwardToNextHop(_, _, _, let kind):
|
||||
switch kind {
|
||||
case .sameNetwork, .exitNode:
|
||||
case .sameNetwork, .exitNode, .dnsExitNode:
|
||||
return true
|
||||
case .dnsExitNode:
|
||||
return false
|
||||
}
|
||||
default:
|
||||
return false
|
||||
|
||||
@ -81,6 +81,13 @@ actor IdentityStore {
|
||||
publisher.publish(snapshot)
|
||||
}
|
||||
|
||||
func clear() {
|
||||
self.coolingDown.removeAll()
|
||||
self.versions.removeAll()
|
||||
self.identityMap.removeAll()
|
||||
self.publisher.publish(IdentitySnapshot.empty())
|
||||
}
|
||||
|
||||
private func compileSnapshot() -> IdentitySnapshot {
|
||||
return IdentitySnapshot(identityMap: identityMap)
|
||||
}
|
||||
|
||||
@ -69,8 +69,18 @@ actor PolicyService {
|
||||
}
|
||||
}
|
||||
|
||||
func clear() {
|
||||
func applyPolicyResponse(_ policyResponse: SDLPolicyResponse) async {
|
||||
guard policyResponse.dstIdentityID == self.identityId else {
|
||||
SDLLogger.log("[PolicyService] ignore policy response, dstIdentityID mismatch: \(policyResponse.dstIdentityID), expected: \(self.identityId)", for: .debug)
|
||||
return
|
||||
}
|
||||
|
||||
await self.identifyStore.applyPolicyResponse(policyResponse)
|
||||
}
|
||||
|
||||
func clear() async {
|
||||
self.flowSessionManager.clear()
|
||||
await self.identifyStore.clear()
|
||||
}
|
||||
|
||||
deinit {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user