Skip to content

Commit

Permalink
chore: Implement GetLicenseConfigManager
Browse files Browse the repository at this point in the history
  • Loading branch information
rg0now committed Dec 11, 2024
1 parent 78fb48a commit 0e133b6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions stunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/l7mp/stunner/internal/resolver"
"github.com/l7mp/stunner/internal/telemetry"
stnrv1 "github.com/l7mp/stunner/pkg/apis/v1"
licensecfg "github.com/l7mp/stunner/pkg/config/license"
"github.com/l7mp/stunner/pkg/logger"
)

Expand Down Expand Up @@ -148,7 +149,7 @@ func (s *Stunner) Shutdown() {
s.ready = false
}

// GetAdmin returns the admin object underlying STUNner.
// GetAdmin returns the admin object. Panics if no admin object is available.
func (s *Stunner) GetAdmin() *object.Admin {
a, found := s.adminManager.Get(stnrv1.DefaultAdminName)
if !found {
Expand All @@ -157,7 +158,13 @@ func (s *Stunner) GetAdmin() *object.Admin {
return a.(*object.Admin)
}

// GetAuth returns the authenitation object underlying STUNner.
// GetLicenseConfigManager returns the manager handling license status. Panics if no manager is
// available.
func (s *Stunner) GetLicenseConfigManager() licensecfg.ConfigManager {
return s.GetAdmin().LicenseManager
}

// GetAuth returns the authenitation object. Panics if no auth object is available.
func (s *Stunner) GetAuth() *object.Auth {
a, found := s.authManager.Get(stnrv1.DefaultAuthName)
if !found {
Expand Down

0 comments on commit 0e133b6

Please sign in to comment.