mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
The server module named github.com/hanzoai/team/server/v8 — a path that resolves to the retired workspace's repository, not this one — while server/public still published github.com/mattermost/mattermost/server/public. Both are github.com/hanzoteam/server/... now, which is where this code actually lives. That second half is what made the binary unbootable. Upstream's public path stayed claimed by upstream, mattermost-plugin-ai imported it, and the build linked public/model twice; public/plugin's gob.Register then ran twice under one name and panicked at init, before main. Reverting the rename traded the brand for a working binary. Rebranding the plugin alongside it needs no such trade: the agents fork is github.com/hanzoteam/agents/v2 against our public module, so no module named mattermost/mattermost is in the graph at all. Measured: `go list -deps ./cmd/mattermost` names exactly one public/model, and it is ours.
76 lines
2.1 KiB
Go
76 lines
2.1 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package app
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/golang-jwt/jwt/v5"
|
|
|
|
"github.com/hanzoteam/server/server/public/model"
|
|
"github.com/hanzoteam/server/server/public/shared/request"
|
|
)
|
|
|
|
func (ch *Channels) License() *model.License {
|
|
return ch.srv.License()
|
|
}
|
|
|
|
// RequestTrialLicense stays because plugin.API declares it and plugin binaries
|
|
// are compiled against that signature. There is no licensing here to trial.
|
|
func (ch *Channels) RequestTrialLicense(rctx request.CTX, requesterID string, users int, termsAccepted bool, receiveEmailsAccepted bool) *model.AppError {
|
|
return model.NewAppError("RequestTrialLicense", "api.license.request-trial.unsupported", nil, "", http.StatusNotImplemented)
|
|
}
|
|
|
|
// JWTClaims custom JWT claims with the needed information for the
|
|
// renewal process
|
|
type JWTClaims struct {
|
|
LicenseID string `json:"license_id"`
|
|
ActiveUsers int64 `json:"active_users"`
|
|
jwt.RegisteredClaims
|
|
}
|
|
|
|
func (s *Server) License() *model.License {
|
|
return s.platform.License()
|
|
}
|
|
|
|
func (s *Server) LoadLicense() {
|
|
s.platform.LoadLicense()
|
|
}
|
|
|
|
func (s *Server) SaveLicense(licenseBytes []byte) (*model.License, *model.AppError) {
|
|
return s.platform.SaveLicense(licenseBytes)
|
|
}
|
|
|
|
func (s *Server) SetLicense(license *model.License) bool {
|
|
return s.platform.SetLicense(license)
|
|
}
|
|
|
|
func (s *Server) ValidateAndSetLicenseBytes(b []byte) error {
|
|
return s.platform.ValidateAndSetLicenseBytes(b)
|
|
}
|
|
|
|
func (s *Server) SetClientLicense(m map[string]string) {
|
|
s.platform.SetClientLicense(m)
|
|
}
|
|
|
|
func (s *Server) ClientLicense() map[string]string {
|
|
return s.platform.ClientLicense()
|
|
}
|
|
|
|
func (s *Server) RemoveLicense() *model.AppError {
|
|
return s.platform.RemoveLicense()
|
|
}
|
|
|
|
func (s *Server) AddLicenseListener(listener func(oldLicense, newLicense *model.License)) string {
|
|
return s.platform.AddLicenseListener(listener)
|
|
}
|
|
|
|
func (s *Server) RemoveLicenseListener(id string) {
|
|
s.platform.RemoveLicenseListener(id)
|
|
}
|
|
|
|
func (s *Server) GetSanitizedClientLicense() map[string]string {
|
|
return s.platform.GetSanitizedClientLicense()
|
|
}
|