mattermost-community-enterp.../public/model/switch_request.go
Claude ec1f89217a Merge: Complete Mattermost Server with Community Enterprise
Full Mattermost server source with integrated Community Enterprise features.
Includes vendor directory for offline/air-gapped builds.

Structure:
- enterprise-impl/: Enterprise feature implementations
- enterprise-community/: Init files that register implementations
- enterprise/: Bridge imports (community_imports.go)
- vendor/: All dependencies for offline builds

Build (online):
  go build ./cmd/mattermost

Build (offline/air-gapped):
  go build -mod=vendor ./cmd/mattermost

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:59:07 +09:00

49 lines
1.5 KiB
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package model
type SwitchRequest struct {
CurrentService string `json:"current_service"`
NewService string `json:"new_service"`
Email string `json:"email"`
Password string `json:"password"`
NewPassword string `json:"new_password"`
MfaCode string `json:"mfa_code"`
LdapLoginId string `json:"ldap_id"`
}
func (o *SwitchRequest) Auditable() map[string]any {
return map[string]any{
"current_service": o.CurrentService,
"new_service": o.NewService,
"email": o.Email,
"ldap_login_id": o.LdapLoginId,
}
}
func (o *SwitchRequest) EmailToOAuth() bool {
return o.CurrentService == UserAuthServiceEmail &&
(o.NewService == UserAuthServiceSaml ||
o.NewService == UserAuthServiceGitlab ||
o.NewService == ServiceGoogle ||
o.NewService == ServiceOffice365 ||
o.NewService == ServiceOpenid)
}
func (o *SwitchRequest) OAuthToEmail() bool {
return (o.CurrentService == UserAuthServiceSaml ||
o.CurrentService == UserAuthServiceGitlab ||
o.CurrentService == ServiceGoogle ||
o.CurrentService == ServiceOffice365 ||
o.CurrentService == ServiceOpenid) && o.NewService == UserAuthServiceEmail
}
func (o *SwitchRequest) EmailToLdap() bool {
return o.CurrentService == UserAuthServiceEmail && o.NewService == UserAuthServiceLdap
}
func (o *SwitchRequest) LdapToEmail() bool {
return o.CurrentService == UserAuthServiceLdap && o.NewService == UserAuthServiceEmail
}