mirror of
https://github.com/gravitl/netmaker.git
synced 2026-10-12 02:15:06 +00:00
* feat(go): remove enrollment key cache; * feat(go): add internal schema; * feat(go): use the new internal table to fetch serverconf records; * feat(go): move internal key constants to schema/internal.go; * feat(go): add server conf table migration; * feat(go): use the new internal table for generated records; * feat(go): add generated table migration; * feat(go): use the new internal table for serveruuid records; * feat(go): add server uuid table migration; * chore(go): remove empty file; * feat(go): store license validation cached response in the new internal table; * chore(go): move table name constants; * feat(go): use migration job name v1.7.0; * wip(go): add schema definition for enrollment keys; * wip(go): use schema.EnrollmentKey in orchestrator pkg; * wip(go): use schema.EnrollmentKey in host registration and pending host approval; * wip(go): use schema.EnrollmentKey in gateway/node cleanup; * wip(go): use schema.EnrollmentKey in network cleanup; * wip(go): use schema.EnrollmentKey in creating default network enrollment key; * wip(go): use schema.EnrollmentKey in enrollment key logic/controller; * wip(go): add schema migration for enrollment keys; * fix(go): remove ref to non-existent constant; * fix(go): use correct package+type for orchestrator test; * feat(go): add internal table to list models function; * fix(go): use int for enrollment key type; * fix(go): remove tags from networks; * fix(go): ensure same response for get enrollment keys as before; * fix(go): enrollment key migration; * wip(go): remove sqlite, rqlite, postgres and utils from database package; * wip(go): remove unused database pkg method DeleteAllRecords; * wip(go): remove db connection management code and accompanying consts from database/ pkg; * wip(go): add schema definitions for org, tenant and org settings tables; * wip(go): add tenant id to add tables in schema/ pkg; add tenant-level unique constraints for network, user invite and pending users; * wip(go): remove usages of host actions table; * wip(go): create default org and tenant on migration; * wip(go): manage kv tables with gorm; * wip(go): bring network id out of value for acls, dns, extclients, metrics and tags tables; * wip(go): store user settings in user table; * wip(go): add server settings migration logic; * wip(go): replace database/ pkg functions with methods from the schema/ pkg; * wip(go): add schema definitions for tenant settings; replace database/ pkg functions with methods from the schema/ pkg; * wip(go): add index on tenant id; * wip(go): remove tenant id column from user role table; * wip(go): set tenant_id to default tenant's id on all records in all tables on migration; * wip(go): extract out network_id on acls, dns, extclients, metrics and tags tables on migration; * wip(go): add scope pkg with middleware to extract scope from headers or set default scope; * wip(go): scope (most) apis to tenant; * wip(go): remove users and user roles table from set tenant id migration function; * wip(go): handle test case errors; * wip(go): cache default tenant and org ids; * feat(go): add utils to get server settings during migration; * feat(go): check nil before conversion; * feat(go): use correct arg order; * wip(go): pass db context; * wip(go): correct api handler router tag; * wip(go): add schema definitions for org and tenant membership tables; * wip(go): use middleware from middleware/ package; * wip(go): add org role constants; * wip(go): read user tenant role and groups from tenant membership table; * wip(go): add migration logic for memberships; * wip(go): undo inadvertent paste; * wip(go): add migration logic for migrating user's role and groups to tenant membership table and setting org owner; * wip(go): use tenant membership table to set user role and groups; * wip(go): test cases; * feat(go): check for nil; * feat(go): move auth type, password and external idp id to tenant membership table; * wip(go): use middleware from middleware/ package; * wip(go): add schema definitions for org and tenant membership tables; * wip(go): add temp default function to use default tenant scoped contexts everywhere; * wip(go): use scope.Default to set tenant id before db ops; * wip(go): create default org and tenant for tests as well; * wip(go): move Default to logic to remove import cycle; * wip(go): scope auth request to default context; * wip(go): migration fixes; * wip(go): use correct column; migrate membership on user migrate; * fix(go): add smtp tls verify skip setting; * fix(go): add smtp tls verify skip setting; --------- Co-authored-by: Abhishek Kondur <[email protected]>
63 lines
1.6 KiB
Go
63 lines
1.6 KiB
Go
// TODO: Either add a returnNetwork and returnKey, or delete this
|
|
package models
|
|
|
|
import "github.com/gravitl/netmaker/schema"
|
|
|
|
// DNSUpdateAction identifies the action to be performed with the dns update data
|
|
type DNSUpdateAction int
|
|
|
|
const (
|
|
// DNSDeleteByIP delete the dns entry
|
|
DNSDeleteByIP = iota
|
|
// DNSDeleteByName delete the dns entry
|
|
DNSDeleteByName
|
|
// DNSReplaceName replace the dns entry
|
|
DNSReplaceName
|
|
// DNSReplaceIP resplace the dns entry
|
|
DNSReplaceIP
|
|
// DNSInsert insert a new dns entry
|
|
DNSInsert
|
|
)
|
|
|
|
func (action DNSUpdateAction) String() string {
|
|
return [...]string{"DNSDeleteByIP", "DNSDeletByName", "DNSReplaceName", "DNSReplaceIP", "DNSInsert"}[action]
|
|
}
|
|
|
|
// DNSError.Error implementation of error interface
|
|
func (e DNSError) Error() string {
|
|
return "error publishing dns update"
|
|
}
|
|
|
|
// DNSError error struct capable of holding multiple error messages
|
|
type DNSError struct {
|
|
ErrorStrings []string
|
|
}
|
|
|
|
// DNSUpdate data for updating entries in /etc/hosts
|
|
type DNSUpdate struct {
|
|
Action DNSUpdateAction
|
|
Name string
|
|
NewName string
|
|
Address string
|
|
NewAddress string
|
|
}
|
|
|
|
type DNSEntryType = schema.DNSEntryType
|
|
|
|
const (
|
|
DNSEntryType_Node = schema.DNSEntryType_Node
|
|
DNSEntryType_Custom = schema.DNSEntryType_Custom
|
|
)
|
|
|
|
type DNSEntry = schema.DNSEntry
|
|
|
|
type NameserverReq struct {
|
|
Name string `json:"name"`
|
|
Network string `json:"network"`
|
|
Description string ` json:"description"`
|
|
Servers []string `json:"servers"`
|
|
MatchDomain string `json:"match_domain"`
|
|
Tags []string `json:"tags"`
|
|
Status bool `gorm:"status" json:"status"`
|
|
}
|