[NET-546] Move ee code to ee package, unify ee status and terminology (#2538)

* Move ee code to ee package and unify ee status to IsPro

* Consolidate naming for paid/professional/enterprise version as "pro". Notes:

- Changes image tags
- Changes build tags
- Changes package names
- Doesn't change links to docs that mention "ee"
- Doesn't change parameters sent to PostHog that mention "ee"

* Revert docker image tag being -pro, back to -ee

* Revert go build tag being pro, back to ee

* Add build tags for some ee content

* [2] Revert go build tag being pro, back to ee

* Fix test workflow

* Add a json tag to be backwards compatible with frontend "IsEE" check

* Add a json tag for the serverconfig struct for IsEE

* Ammend json tag to Is_EE

* fix ee tags

---------

Co-authored-by: Abhishek Kondur <abhi281342@gmail.com>
This commit is contained in:
Gabriel de Souza Seibel
2023-08-31 23:12:05 -03:00
committed by GitHub
parent 31fcc8cd6d
commit 1a1ba1ccf4
50 changed files with 753 additions and 716 deletions

View File

@@ -22,48 +22,15 @@ var (
AllowClientNodeAccess = func(ec *models.ExtClient, clientOrNodeID string) bool {
return true
}
)
// SetClientDefaultACLs - set's a client's default ACLs based on network and nodes in network
func SetClientDefaultACLs(ec *models.ExtClient) error {
if !isEE {
SetClientDefaultACLs = func(ec *models.ExtClient) error {
return nil
}
networkNodes, err := GetNetworkNodes(ec.Network)
if err != nil {
return err
SetClientACLs = func(ec *models.ExtClient, newACLs map[string]struct{}) {
}
network, err := GetNetwork(ec.Network)
if err != nil {
return err
UpdateProNodeACLs = func(node *models.Node) error {
return nil
}
for i := range networkNodes {
currNode := networkNodes[i]
if network.DefaultACL == "no" || currNode.DefaultACL == "no" {
DenyClientNodeAccess(ec, currNode.ID.String())
} else {
AllowClientNodeAccess(ec, currNode.ID.String())
}
}
return nil
}
// SetClientACLs - overwrites an ext client's ACL
func SetClientACLs(ec *models.ExtClient, newACLs map[string]struct{}) {
if ec == nil || newACLs == nil || !isEE {
return
}
ec.DeniedACLs = newACLs
}
// IsClientNodeAllowedByID - checks if a given ext client ID + nodeID are allowed
func IsClientNodeAllowedByID(clientID, networkName, clientOrNodeID string) bool {
client, err := GetExtClient(clientID, networkName)
if err != nil {
return false
}
return IsClientNodeAllowed(&client, clientOrNodeID)
}
)
// SortExtClient - Sorts slice of ExtClients by their ClientID alphabetically with numbers first
func SortExtClient(unsortedExtClient []models.ExtClient) {