mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-02 09:54:26 +08:00
* add superadmin role, apis to create superadmin user * apis to attach and remove user from remote access gateways * add api to list user's remote client has gateway clients * remove code related user groups * remove networks and groups from user model * refactor user CRUD operations * fix network permission test * add superadmin to authorize func * remove user network and groups from cli * api to transfer superadmin role * add api to list users on a ingress gw * restrict user access to resources on server * deny request from remote access client if extclient is already created * fix user tests * fix static checks * fix static checks * add limits to extclient create handler * set username to superadmin on if masterkey is used * allow creation of extclients using masterkey * add migration func to assign superadmin role for existing admin user * check for superadmin on migration if users are present * allowe masterkey to extcleint apis * check ownerid * format error, on jwt token verification failure return unauthorized rather than forbidden * user update fix * move user remote functionality to ee * fix update user api * security patch * initalise ee user handlers * allow user to use master key to update any user * use slog * fix auth user test * table headers * remove user role, it's covered in middleware * setuser defaults fix
31 lines
1.9 KiB
Go
31 lines
1.9 KiB
Go
package models
|
|
|
|
// ExtClient - struct for external clients
|
|
type ExtClient struct {
|
|
ClientID string `json:"clientid" bson:"clientid"`
|
|
PrivateKey string `json:"privatekey" bson:"privatekey"`
|
|
PublicKey string `json:"publickey" bson:"publickey"`
|
|
Network string `json:"network" bson:"network"`
|
|
DNS string `json:"dns" bson:"dns"`
|
|
Address string `json:"address" bson:"address"`
|
|
Address6 string `json:"address6" bson:"address6"`
|
|
ExtraAllowedIPs []string `json:"extraallowedips" bson:"extraallowedips"`
|
|
IngressGatewayID string `json:"ingressgatewayid" bson:"ingressgatewayid"`
|
|
IngressGatewayEndpoint string `json:"ingressgatewayendpoint" bson:"ingressgatewayendpoint"`
|
|
LastModified int64 `json:"lastmodified" bson:"lastmodified"`
|
|
Enabled bool `json:"enabled" bson:"enabled"`
|
|
OwnerID string `json:"ownerid" bson:"ownerid"`
|
|
DeniedACLs map[string]struct{} `json:"deniednodeacls" bson:"acls,omitempty"`
|
|
RemoteAccessClientID string `json:"remote_access_client_id"`
|
|
}
|
|
|
|
// CustomExtClient - struct for CustomExtClient params
|
|
type CustomExtClient struct {
|
|
ClientID string `json:"clientid,omitempty"`
|
|
PublicKey string `json:"publickey,omitempty"`
|
|
DNS string `json:"dns,omitempty"`
|
|
ExtraAllowedIPs []string `json:"extraallowedips,omitempty"`
|
|
Enabled bool `json:"enabled,omitempty"`
|
|
DeniedACLs map[string]struct{} `json:"deniednodeacls" bson:"acls,omitempty"`
|
|
RemoteAccessClientID string `json:"remote_access_client_id"`
|
|
}
|