Documentation
¶
Index ¶
- Constants
- Variables
- func Authenticate(jwtSecret []byte, store *db.Database, next http.Handler) http.Handler
- func Backup(dbInstance *db.Database) http.HandlerFunc
- func CreateDataNetwork(dbInstance *db.Database) http.Handler
- func CreateMyAPIToken(dbInstance *db.Database) http.Handler
- func CreatePolicy(dbInstance *db.Database) http.Handler
- func CreateRoute(dbInstance *db.Database, kernelInt kernel.Kernel) http.Handler
- func CreateSubscriber(dbInstance *db.Database) http.Handler
- func CreateUser(dbInstance *db.Database) http.Handler
- func DeleteDataNetwork(dbInstance *db.Database) http.Handler
- func DeleteMyAPIToken(dbInstance *db.Database) http.Handler
- func DeletePolicy(dbInstance *db.Database) http.Handler
- func DeleteRoute(dbInstance *db.Database, kernelInt kernel.Kernel) http.Handler
- func DeleteSubscriber(dbInstance *db.Database) http.Handler
- func DeleteUser(dbInstance *db.Database) http.Handler
- func GetAuditLogRetentionPolicy(dbInstance *db.Database) http.Handler
- func GetDataNetwork(dbInstance *db.Database) http.Handler
- func GetLoggedInUser(dbInstance *db.Database) http.Handler
- func GetMetrics() http.Handler
- func GetNATInfo(dbInstance *db.Database) http.Handler
- func GetOperator(dbInstance *db.Database) http.Handler
- func GetOperatorID(dbInstance *db.Database) http.Handler
- func GetOperatorSlice(dbInstance *db.Database) http.Handler
- func GetOperatorTracking(dbInstance *db.Database) http.Handler
- func GetPolicy(dbInstance *db.Database) http.Handler
- func GetRadio() http.HandlerFunc
- func GetRadioLogRetentionPolicy(dbInstance *db.Database) http.Handler
- func GetRoute(dbInstance *db.Database) http.Handler
- func GetStatus(dbInstance *db.Database) http.Handler
- func GetSubscriber(dbInstance *db.Database) http.Handler
- func GetSubscriberLogRetentionPolicy(dbInstance *db.Database) http.Handler
- func GetUser(dbInstance *db.Database) http.Handler
- func ListAuditLogs(dbInstance *db.Database) http.Handler
- func ListDataNetworks(dbInstance *db.Database) http.Handler
- func ListMyAPITokens(dbInstance *db.Database) http.Handler
- func ListPolicies(dbInstance *db.Database) http.Handler
- func ListRadioLogs(dbInstance *db.Database) http.Handler
- func ListRadios() http.HandlerFunc
- func ListRoutes(dbInstance *db.Database) http.Handler
- func ListSubscriberLogs(dbInstance *db.Database) http.Handler
- func ListSubscribers(dbInstance *db.Database) http.Handler
- func ListUsers(dbInstance *db.Database) http.Handler
- func Login(dbInstance *db.Database, secureCookie bool) http.Handler
- func Logout(dbInstance *db.Database, secureCookie bool) http.Handler
- func LookupToken(dbInstance *db.Database, jwtSecret []byte) http.Handler
- func NewHandler(dbInstance *db.Database, upf UPFReloader, kernel kernel.Kernel, ...) http.Handler
- func Refresh(dbInstance *db.Database, jwtSecret []byte) http.Handler
- func RequirePermission(permission string, jwtSecret []byte, next http.Handler) http.Handler
- func RequirePermissionOrFirstUser(permission string, database *db.Database, jwtSecret []byte, next http.Handler) http.Handler
- func Restore(dbInstance *db.Database) http.HandlerFunc
- func TracingMiddleware(serviceName string, handler http.Handler) http.Handler
- func UpdateAuditLogRetentionPolicy(dbInstance *db.Database) http.Handler
- func UpdateDataNetwork(dbInstance *db.Database) http.Handler
- func UpdateMyUserPassword(dbInstance *db.Database) http.Handler
- func UpdateNATInfo(dbInstance *db.Database, upf UPFReloader) http.Handler
- func UpdateOperatorCode(dbInstance *db.Database) http.Handler
- func UpdateOperatorHomeNetwork(dbInstance *db.Database) http.Handler
- func UpdateOperatorID(dbInstance *db.Database) http.Handler
- func UpdateOperatorSlice(dbInstance *db.Database) http.Handler
- func UpdateOperatorTracking(dbInstance *db.Database) http.Handler
- func UpdatePolicy(dbInstance *db.Database) http.Handler
- func UpdateRadioLogRetentionPolicy(dbInstance *db.Database) http.Handler
- func UpdateSubscriber(dbInstance *db.Database) http.Handler
- func UpdateSubscriberLogRetentionPolicy(dbInstance *db.Database) http.Handler
- func UpdateUser(dbInstance *db.Database) http.Handler
- func UpdateUserPassword(dbInstance *db.Database) http.Handler
- type APIToken
- type AuditLog
- type CreateAPITokenParams
- type CreateAPITokenResponse
- type CreateDataNetworkParams
- type CreatePolicyParams
- type CreateRouteParams
- type CreateSubscriberParams
- type CreateSuccessResponse
- type CreateUserParams
- type DataNetwork
- type DataNetworkStatus
- type ErrorResponse
- type GetAuditLogsRetentionPolicyResponse
- type GetNATInfoResponse
- type GetOperatorHomeNetworkResponse
- type GetOperatorIDResponse
- type GetOperatorResponse
- type GetOperatorSliceResponse
- type GetOperatorTrackingResponse
- type GetRadioLogsRetentionPolicyResponse
- type GetSubscriberLogsRetentionPolicyResponse
- type ListAPITokensResponse
- type ListAuditLogsResponse
- type ListDataNetworksResponse
- type ListPoliciesResponse
- type ListRadioLogsResponse
- type ListRadiosResponse
- type ListRoutesResponse
- type ListSubscriberLogsResponse
- type ListSubscribersResponse
- type ListUsersResponse
- type LoginParams
- type LookupTokenResponse
- type PlmnID
- type Policy
- type Radio
- type RadioLog
- type RefreshResponse
- type Response
- type RoleID
- type Route
- type Snssai
- type StatusResponse
- type Subscriber
- type SubscriberLog
- type SubscriberSession
- type SubscriberStatus
- type SuccessResponse
- type SupportedTAI
- type Tai
- type UPFReloader
- type UpdateAuditLogsRetentionPolicyParams
- type UpdateMyUserPasswordParams
- type UpdateNATInfoParams
- type UpdateOperatorCodeParams
- type UpdateOperatorHomeNetworkParams
- type UpdateOperatorIDParams
- type UpdateOperatorSliceParams
- type UpdateOperatorTrackingParams
- type UpdateRadioLogsRetentionPolicyParams
- type UpdateSubscriberLogsRetentionPolicyParams
- type UpdateSubscriberParams
- type UpdateUserParams
- type UpdateUserPasswordParams
- type User
Constants ¶
View Source
const ( AccessTokenDuration = 15 * time.Minute // short-lived SessionTokenDuration = 30 * 24 * time.Hour // long-lived SessionTokenCookieName = "session_token" )
View Source
const ( DeleteDataNetworkAction = "delete_data_network" CreateDataNetworkAction = "create_data_network" UpdateDataNetworkAction = "update_data_network" )
View Source
const ( UpdateOperatorSliceAction = "update_operator_slice" UpdateOperatorTrackingAction = "update_operator_tracking" UpdateOperatorIDAction = "update_operator_id" UpdateOperatorCodeAction = "update_operator_code" UpdateOperatorHomeNetworkAction = "update_operator_home_network" )
View Source
const ( CreatePolicyAction = "create_policy" UpdatePolicyAction = "update_policy" DeletePolicyAction = "delete_policy" )
View Source
const ( CreateRouteAction = "create_route" DeleteRouteAction = "delete_route" )
View Source
const ( CreateSubscriberAction = "create_subscriber" UpdateSubscriberAction = "update_subscriber" DeleteSubscriberAction = "delete_subscriber" )
View Source
const ( CreateUserAction = "create_user" UpdateUserAction = "update_user" DeleteUserAction = "delete_user" UpdateUserPasswordAction = "update_user_password" CreateAPITokenAction = "create_api_token" DeleteAPITokenAction = "delete_api_token" )
View Source
const ( MaxNumUsers = 50 MaxNumAPITokens = 12 )
View Source
const ( // User permissions PermListUsers = "user:list" PermCreateUser = "user:create" PermUpdateUser = "user:update" PermUpdateUserPassword = "user:update_password" PermReadUser = "user:read" PermDeleteUser = "user:delete" PermReadMyUser = "user:read_my_user" PermUpdateMyUserPassword = "user:update_my_user_password" // #nosec: G101 PermListMyAPITokens = "user:list_my_api_tokens" // #nosec: G101 PermCreateMyAPIToken = "user:create_my_api_token" PermDeleteMyAPIToken = "user:delete_my_api_token" // Data Network permissions PermListDataNetworks = "data_network:list" PermCreateDataNetwork = "data_network:create" PermUpdateDataNetwork = "data_network:update" PermReadDataNetwork = "data_network:read" PermDeleteDataNetwork = "data_network:delete" // Operator permissions PermReadOperator = "operator:read" PermUpdateOperatorSlice = "operator:update_slice" PermGetOperatorSlice = "operator:get_slice" PermUpdateOperatorTracking = "operator:update_tracking" PermGetOperatorTracking = "operator:get_tracking" PermUpdateOperatorID = "operator:update_id" PermGetOperatorID = "operator:get_id" PermUpdateOperatorCode = "operator:update_code" PermUpdateOperatorHomeNetwork = "operator:update_home_network" // Subscriber permissions PermListSubscribers = "subscriber:list" PermCreateSubscriber = "subscriber:create" PermUpdateSubscriber = "subscriber:update" PermReadSubscriber = "subscriber:read" PermDeleteSubscriber = "subscriber:delete" // Policy permissions PermListPolicies = "policy:list" PermCreatePolicy = "policy:create" PermUpdatePolicy = "policy:update" PermReadPolicy = "policy:read" PermDeletePolicy = "policy:delete" // Route permissions PermListRoutes = "route:list" PermCreateRoute = "route:create" PermReadRoute = "route:read" PermDeleteRoute = "route:delete" // NAT permissions PermGetNATInfo = "nat:get" PermUpdateNATInfo = "nat:update" // Radio permissions PermListRadios = "radio:list" PermReadRadio = "radio:read" // Backup and Restore permissions PermBackup = "backup:create" PermRestore = "backup:restore" // Audit Log permissions PermGetAuditLogRetentionPolicy = "audit_logs:get_retention" PermSetAuditLogRetentionPolicy = "audit_logs:set_retention" PermListAuditLogs = "audit_logs:list" // Subscriber Log permissions PermGetSubscriberLogRetentionPolicy = "subscriber_logs:get_retention" PermSetSubscriberLogRetentionPolicy = "subscriber_logs:set_retention" PermListSubscriberLogs = "subscriber_logs:list" // Radio Log permissions PermGetRadioLogRetentionPolicy = "radio_logs:get_retention" PermSetRadioLogRetentionPolicy = "radio_logs:set_retention" PermListRadioLogs = "radio_logs:list" )
View Source
const AuthenticationAction = "user_authentication"
View Source
const BackupAction = "backup_database"
View Source
const (
LoginAction = "auth_login"
)
View Source
const MaxNumDataNetworks = 12
View Source
const (
MaxNumPolicies = 12
)
View Source
const (
MaxNumRoutes = 12
)
View Source
const (
MaxNumSubscribers = 1000
)
View Source
const (
MaxSupportedTACs = 12
)
View Source
const RestoreAction = "restore_database"
View Source
const (
UpdateAuditLogRetentionPolicyAction = "update_audit_log_retention_policy"
)
View Source
const (
UpdateNATSettingsAction = "update_nat_settings"
)
View Source
const (
UpdateRadioLogRetentionPolicyAction = "update_radio_log_retention_policy"
)
View Source
const (
UpdateSubscriberLogRetentionPolicyAction = "update_subscriber_log_retention_policy"
)
Variables ¶
View Source
var PermissionsByRole = map[RoleID][]string{ RoleAdmin: {"*"}, RoleReadOnly: { PermReadMyUser, PermUpdateMyUserPassword, PermReadOperator, PermGetOperatorSlice, PermGetOperatorTracking, PermListSubscribers, PermReadSubscriber, PermListDataNetworks, PermReadDataNetwork, PermListPolicies, PermReadPolicy, PermListRoutes, PermReadRoute, PermListRadios, PermReadRadio, PermGetNATInfo, }, RoleNetworkManager: { PermReadUser, PermReadMyUser, PermUpdateMyUserPassword, PermReadOperator, PermUpdateOperatorSlice, PermGetOperatorSlice, PermUpdateOperatorTracking, PermGetOperatorTracking, PermListDataNetworks, PermCreateDataNetwork, PermUpdateDataNetwork, PermReadDataNetwork, PermDeleteDataNetwork, PermListSubscribers, PermCreateSubscriber, PermUpdateSubscriber, PermReadSubscriber, PermDeleteSubscriber, PermListPolicies, PermCreatePolicy, PermUpdatePolicy, PermReadPolicy, PermDeletePolicy, PermListRoutes, PermCreateRoute, PermReadRoute, PermDeleteRoute, PermListRadios, PermReadRadio, PermGetNATInfo, PermUpdateNATInfo, PermListSubscriberLogs, PermGetSubscriberLogRetentionPolicy, PermSetSubscriberLogRetentionPolicy, PermListRadioLogs, PermGetRadioLogRetentionPolicy, PermSetRadioLogRetentionPolicy, }, }
Functions ¶
func Authenticate ¶
func CreateDataNetwork ¶ added in v0.1.0
func CreateRoute ¶ added in v0.0.9
func DeleteDataNetwork ¶ added in v0.1.0
func DeleteRoute ¶ added in v0.0.9
func GetAuditLogRetentionPolicy ¶ added in v0.2.0
func GetMetrics ¶
func GetRadio ¶
func GetRadio() http.HandlerFunc
func GetRadioLogRetentionPolicy ¶ added in v0.3.0
func GetSubscriberLogRetentionPolicy ¶ added in v0.3.0
func ListRadios ¶
func ListRadios() http.HandlerFunc
func ListSubscriberLogs ¶ added in v0.3.0
func NewHandler ¶
func RequirePermission ¶ added in v0.0.19
func RequirePermissionOrFirstUser ¶ added in v0.0.19
func TracingMiddleware ¶ added in v0.0.19
TracingMiddleware wraps the handler in OpenTelemetry HTTP middleware
func UpdateAuditLogRetentionPolicy ¶ added in v0.2.0
func UpdateDataNetwork ¶ added in v0.1.0
func UpdateMyUserPassword ¶ added in v0.2.0
func UpdateNATInfo ¶ added in v0.3.0
func UpdateNATInfo(dbInstance *db.Database, upf UPFReloader) http.Handler
func UpdateOperatorID ¶ added in v0.0.12
func UpdateRadioLogRetentionPolicy ¶ added in v0.3.0
func UpdateSubscriberLogRetentionPolicy ¶ added in v0.3.0
Types ¶
type CreateAPITokenParams ¶ added in v0.2.0
type CreateAPITokenResponse ¶ added in v0.2.0
type CreateAPITokenResponse struct {
Token string `json:"token"`
}
type CreateDataNetworkParams ¶ added in v0.1.0
type CreatePolicyParams ¶ added in v0.1.0
type CreatePolicyParams struct { Name string `json:"name"` BitrateUplink string `json:"bitrate_uplink,omitempty"` BitrateDownlink string `json:"bitrate_downlink,omitempty"` Var5qi int32 `json:"var5qi,omitempty"` PriorityLevel int32 `json:"priority_level,omitempty"` DataNetworkName string `json:"data_network_name,omitempty"` }
type CreateRouteParams ¶ added in v0.0.9
type CreateSubscriberParams ¶
type CreateSuccessResponse ¶ added in v0.0.9
type CreateUserParams ¶
type DataNetwork ¶ added in v0.3.0
type DataNetwork struct { Name string `json:"name"` IPPool string `json:"ip_pool"` DNS string `json:"dns,omitempty"` MTU int32 `json:"mtu,omitempty"` Status DataNetworkStatus `json:"status"` }
type DataNetworkStatus ¶ added in v0.2.0
type DataNetworkStatus struct {
Sessions int `json:"sessions"`
}
type ErrorResponse ¶ added in v0.3.0
type ErrorResponse struct {
Error string `json:"error"`
}
type GetAuditLogsRetentionPolicyResponse ¶ added in v0.2.0
type GetAuditLogsRetentionPolicyResponse struct {
Days int `json:"days"`
}
type GetNATInfoResponse ¶ added in v0.3.0
type GetNATInfoResponse struct {
Enabled bool `json:"enabled"`
}
type GetOperatorHomeNetworkResponse ¶
type GetOperatorHomeNetworkResponse struct {
PublicKey string `json:"publicKey,omitempty"`
}
type GetOperatorIDResponse ¶ added in v0.0.12
type GetOperatorResponse ¶
type GetOperatorResponse struct { ID GetOperatorIDResponse `json:"id,omitempty"` Slice GetOperatorSliceResponse `json:"slice,omitempty"` Tracking GetOperatorTrackingResponse `json:"tracking,omitempty"` HomeNetwork GetOperatorHomeNetworkResponse `json:"homeNetwork,omitempty"` }
type GetOperatorTrackingResponse ¶
type GetOperatorTrackingResponse struct {
SupportedTacs []string `json:"supportedTacs,omitempty"`
}
type GetRadioLogsRetentionPolicyResponse ¶ added in v0.3.0
type GetRadioLogsRetentionPolicyResponse struct {
Days int `json:"days"`
}
type GetSubscriberLogsRetentionPolicyResponse ¶ added in v0.3.0
type GetSubscriberLogsRetentionPolicyResponse struct {
Days int `json:"days"`
}
type ListAPITokensResponse ¶ added in v0.3.0
type ListAuditLogsResponse ¶ added in v0.3.0
type ListDataNetworksResponse ¶ added in v0.3.0
type ListDataNetworksResponse struct { Items []DataNetwork `json:"items"` Page int `json:"page"` PerPage int `json:"per_page"` TotalCount int `json:"total_count"` }
type ListPoliciesResponse ¶ added in v0.3.0
type ListRadioLogsResponse ¶ added in v0.3.0
type ListRadiosResponse ¶ added in v0.3.0
type ListRoutesResponse ¶ added in v0.3.0
type ListSubscriberLogsResponse ¶ added in v0.3.0
type ListSubscriberLogsResponse struct { Items []SubscriberLog `json:"items"` Page int `json:"page"` PerPage int `json:"per_page"` TotalCount int `json:"total_count"` }
type ListSubscribersResponse ¶ added in v0.3.0
type ListSubscribersResponse struct { Items []Subscriber `json:"items"` Page int `json:"page"` PerPage int `json:"per_page"` TotalCount int `json:"total_count"` }
type ListUsersResponse ¶ added in v0.3.0
type LoginParams ¶
type LookupTokenResponse ¶
type LookupTokenResponse struct {
Valid bool `json:"valid"`
}
type Policy ¶ added in v0.3.0
type Policy struct { Name string `json:"name"` BitrateUplink string `json:"bitrate_uplink,omitempty"` BitrateDownlink string `json:"bitrate_downlink,omitempty"` Var5qi int32 `json:"var5qi,omitempty"` PriorityLevel int32 `json:"priority_level,omitempty"` DataNetworkName string `json:"data_network_name,omitempty"` }
type Radio ¶ added in v0.3.0
type Radio struct { Name string `json:"name"` ID string `json:"id"` Address string `json:"address"` SupportedTAIs []SupportedTAI `json:"supported_tais"` }
type RefreshResponse ¶ added in v0.3.0
type RefreshResponse struct {
Token string `json:"token"`
}
type StatusResponse ¶
type Subscriber ¶ added in v0.3.0
type SubscriberLog ¶ added in v0.3.0
type SubscriberSession ¶ added in v0.1.0
type SubscriberSession struct {
IPAddress string `json:"ipAddress"`
}
type SubscriberStatus ¶ added in v0.1.0
type SubscriberStatus struct { Registered bool `json:"registered"` Sessions []SubscriberSession `json:"sessions"` }
type SuccessResponse ¶
type SuccessResponse struct {
Message string `json:"message"`
}
type SupportedTAI ¶
type UPFReloader ¶ added in v0.3.0
type UpdateAuditLogsRetentionPolicyParams ¶ added in v0.2.0
type UpdateAuditLogsRetentionPolicyParams struct {
Days int `json:"days"`
}
type UpdateMyUserPasswordParams ¶ added in v0.2.0
type UpdateMyUserPasswordParams struct {
Password string `json:"password"`
}
type UpdateNATInfoParams ¶ added in v0.3.0
type UpdateNATInfoParams struct {
Enabled bool `json:"enabled"`
}
type UpdateOperatorCodeParams ¶
type UpdateOperatorCodeParams struct {
OperatorCode string `json:"operatorCode,omitempty"`
}
type UpdateOperatorHomeNetworkParams ¶
type UpdateOperatorHomeNetworkParams struct {
PrivateKey string `json:"privateKey,omitempty"`
}
type UpdateOperatorIDParams ¶ added in v0.0.12
type UpdateOperatorTrackingParams ¶
type UpdateOperatorTrackingParams struct {
SupportedTacs []string `json:"supportedTacs,omitempty"`
}
type UpdateRadioLogsRetentionPolicyParams ¶ added in v0.3.0
type UpdateRadioLogsRetentionPolicyParams struct {
Days int `json:"days"`
}
type UpdateSubscriberLogsRetentionPolicyParams ¶ added in v0.3.0
type UpdateSubscriberLogsRetentionPolicyParams struct {
Days int `json:"days"`
}
type UpdateSubscriberParams ¶
type UpdateUserParams ¶
Source Files
¶
- api_audit_logs.go
- api_auth.go
- api_backup.go
- api_data_networks.go
- api_metrics.go
- api_nat.go
- api_operator.go
- api_policies.go
- api_radio_logs.go
- api_radios.go
- api_restore.go
- api_routes.go
- api_status.go
- api_subscriber_logs.go
- api_subscribers.go
- api_users.go
- authentication_middleware.go
- authorization_middleware.go
- frontend.go
- helpers.go
- op.go
- response.go
- server.go
- tracing_middleware.go
Click to show internal directories.
Click to hide internal directories.