forked from CactuseSecurity/firewall-orchestrator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[~] Better AppZone handling CactuseSecurity#2597
- Loading branch information
1 parent
f11646e
commit e5b33d4
Showing
7 changed files
with
134 additions
and
35 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
roles/lib/files/FWO.Api.Client/APIcalls/modelling/addNwAppZone.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
roles/lib/files/FWO.Api.Client/APIcalls/modelling/getAppZonesByAppId.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
query getAppZonesByAppId($appId: Int!) { | ||
modelling_nwgroup (where: { group_type: { _eq: 21 }, app_id: { _eq: $appId} } order_by: { name: asc }){ | ||
id | ||
app_id | ||
name | ||
id_string | ||
is_deleted | ||
nwobjects: nwobject_nwgroups{ | ||
owner_network{ | ||
...appServerDetails | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using FWO.Api.Data; | ||
|
||
namespace FWO.Services | ||
{ | ||
class AppServerComparer : IEqualityComparer<ModellingAppServerWrapper> | ||
{ | ||
public bool Equals(ModellingAppServerWrapper x, ModellingAppServerWrapper y) | ||
{ | ||
if (ReferenceEquals(x, y)) return true; | ||
|
||
if ( x is null || y is null ) | ||
return false; | ||
|
||
return x.Content.Id == y.Content.Id; | ||
} | ||
|
||
public int GetHashCode(ModellingAppServerWrapper appServerWrapper) | ||
{ | ||
if ( appServerWrapper is null ) return 0; | ||
int hashProductName = appServerWrapper.Content == null ? 0 : appServerWrapper.Content.GetHashCode(); | ||
int hashProductCode = appServerWrapper.Content.GetHashCode(); | ||
return hashProductName ^ hashProductCode; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters