Improves the invite mechanism for remote clusters (#31025)

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
Этот коммит содержится в:
Miguel de la Cruz
2025-05-27 13:39:13 +02:00
коммит произвёл GitHub
родитель e51ea025db
Коммит fbf105f6ef
5 изменённых файлов: 36 добавлений и 11 удалений

Просмотреть файл

@@ -363,10 +363,12 @@ type RemoteClusterPing struct {
// RemoteClusterInvite represents an invitation to establish a simple trust with a remote cluster.
type RemoteClusterInvite struct {
RemoteId string `json:"remote_id"`
RemoteTeamId string `json:"remote_team_id"` // Deprecated: this field is no longer used. It's only kept for backwards compatibility.
SiteURL string `json:"site_url"`
Token string `json:"token"`
RemoteId string `json:"remote_id"`
RemoteTeamId string `json:"remote_team_id"` // Deprecated: this field is no longer used. It's only kept for backwards compatibility.
SiteURL string `json:"site_url"`
Token string `json:"token"`
RefreshedToken string `json:"refreshed_token,omitempty"` // New token generated by the remote cluster when accepting an invitation
Version int `json:"version,omitempty"`
}
func (rci *RemoteClusterInvite) IsValid() *AppError {

Просмотреть файл

@@ -160,9 +160,11 @@ func TestRemoteClusterInviteEncryption(t *testing.T) {
func makeInvite(url string) RemoteClusterInvite {
return RemoteClusterInvite{
RemoteId: NewId(),
SiteURL: url,
Token: NewId(),
RemoteId: NewId(),
SiteURL: url,
Token: NewId(),
RefreshedToken: NewId(),
Version: 2,
}
}