feat(bugseti): add hub coordination config fields and accessors
Add HubURL, HubToken, ClientID, and ClientName fields to Config struct for agentic portal integration. Include getter/setter methods following the existing pattern (SetForgeURL, SetForgeToken also added). Co-Authored-By: Virgil <virgil@lethean.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cb017b014f
commit
3029ac6711
1 changed files with 82 additions and 0 deletions
|
|
@ -23,6 +23,12 @@ type Config struct {
|
||||||
ForgeURL string `json:"forgeUrl,omitempty"`
|
ForgeURL string `json:"forgeUrl,omitempty"`
|
||||||
ForgeToken string `json:"forgeToken,omitempty"`
|
ForgeToken string `json:"forgeToken,omitempty"`
|
||||||
|
|
||||||
|
// Hub coordination (agentic portal)
|
||||||
|
HubURL string `json:"hubUrl,omitempty"`
|
||||||
|
HubToken string `json:"hubToken,omitempty"`
|
||||||
|
ClientID string `json:"clientId,omitempty"`
|
||||||
|
ClientName string `json:"clientName,omitempty"`
|
||||||
|
|
||||||
// Deprecated: use ForgeToken. Kept for migration.
|
// Deprecated: use ForgeToken. Kept for migration.
|
||||||
GitHubToken string `json:"githubToken,omitempty"`
|
GitHubToken string `json:"githubToken,omitempty"`
|
||||||
|
|
||||||
|
|
@ -546,6 +552,82 @@ func (c *ConfigService) GetForgeToken() string {
|
||||||
return c.config.ForgeToken
|
return c.config.ForgeToken
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetForgeURL sets the Forge URL.
|
||||||
|
func (c *ConfigService) SetForgeURL(url string) error {
|
||||||
|
c.mu.Lock()
|
||||||
|
defer c.mu.Unlock()
|
||||||
|
c.config.ForgeURL = url
|
||||||
|
return c.saveUnsafe()
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetForgeToken sets the Forge token.
|
||||||
|
func (c *ConfigService) SetForgeToken(token string) error {
|
||||||
|
c.mu.Lock()
|
||||||
|
defer c.mu.Unlock()
|
||||||
|
c.config.ForgeToken = token
|
||||||
|
return c.saveUnsafe()
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetHubURL returns the configured Hub URL.
|
||||||
|
func (c *ConfigService) GetHubURL() string {
|
||||||
|
c.mu.RLock()
|
||||||
|
defer c.mu.RUnlock()
|
||||||
|
return c.config.HubURL
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHubURL sets the Hub URL.
|
||||||
|
func (c *ConfigService) SetHubURL(url string) error {
|
||||||
|
c.mu.Lock()
|
||||||
|
defer c.mu.Unlock()
|
||||||
|
c.config.HubURL = url
|
||||||
|
return c.saveUnsafe()
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetHubToken returns the configured Hub token.
|
||||||
|
func (c *ConfigService) GetHubToken() string {
|
||||||
|
c.mu.RLock()
|
||||||
|
defer c.mu.RUnlock()
|
||||||
|
return c.config.HubToken
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHubToken sets the Hub token.
|
||||||
|
func (c *ConfigService) SetHubToken(token string) error {
|
||||||
|
c.mu.Lock()
|
||||||
|
defer c.mu.Unlock()
|
||||||
|
c.config.HubToken = token
|
||||||
|
return c.saveUnsafe()
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetClientID returns the configured client ID.
|
||||||
|
func (c *ConfigService) GetClientID() string {
|
||||||
|
c.mu.RLock()
|
||||||
|
defer c.mu.RUnlock()
|
||||||
|
return c.config.ClientID
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetClientID sets the client ID.
|
||||||
|
func (c *ConfigService) SetClientID(id string) error {
|
||||||
|
c.mu.Lock()
|
||||||
|
defer c.mu.Unlock()
|
||||||
|
c.config.ClientID = id
|
||||||
|
return c.saveUnsafe()
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetClientName returns the configured client name.
|
||||||
|
func (c *ConfigService) GetClientName() string {
|
||||||
|
c.mu.RLock()
|
||||||
|
defer c.mu.RUnlock()
|
||||||
|
return c.config.ClientName
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetClientName sets the client name.
|
||||||
|
func (c *ConfigService) SetClientName(name string) error {
|
||||||
|
c.mu.Lock()
|
||||||
|
defer c.mu.Unlock()
|
||||||
|
c.config.ClientName = name
|
||||||
|
return c.saveUnsafe()
|
||||||
|
}
|
||||||
|
|
||||||
// ShouldCheckForUpdates returns true if it's time to check for updates.
|
// ShouldCheckForUpdates returns true if it's time to check for updates.
|
||||||
func (c *ConfigService) ShouldCheckForUpdates() bool {
|
func (c *ConfigService) ShouldCheckForUpdates() bool {
|
||||||
c.mu.RLock()
|
c.mu.RLock()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue