diff options
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/v6/model/oauth.go')
-rw-r--r-- | vendor/github.com/mattermost/mattermost-server/v6/model/oauth.go | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/vendor/github.com/mattermost/mattermost-server/v6/model/oauth.go b/vendor/github.com/mattermost/mattermost-server/v6/model/oauth.go index a3d7f95f..82dd8fb2 100644 --- a/vendor/github.com/mattermost/mattermost-server/v6/model/oauth.go +++ b/vendor/github.com/mattermost/mattermost-server/v6/model/oauth.go @@ -18,17 +18,18 @@ const ( ) type OAuthApp struct { - Id string `json:"id"` - CreatorId string `json:"creator_id"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - ClientSecret string `json:"client_secret"` - Name string `json:"name"` - Description string `json:"description"` - IconURL string `json:"icon_url"` - CallbackUrls StringArray `json:"callback_urls"` - Homepage string `json:"homepage"` - IsTrusted bool `json:"is_trusted"` + Id string `json:"id"` + CreatorId string `json:"creator_id"` + CreateAt int64 `json:"create_at"` + UpdateAt int64 `json:"update_at"` + ClientSecret string `json:"client_secret"` + Name string `json:"name"` + Description string `json:"description"` + IconURL string `json:"icon_url"` + CallbackUrls StringArray `json:"callback_urls"` + Homepage string `json:"homepage"` + IsTrusted bool `json:"is_trusted"` + MattermostAppID string `json:"mattermost_app_id"` } // IsValid validates the app and returns an error if it isn't configured @@ -83,6 +84,10 @@ func (a *OAuthApp) IsValid() *AppError { } } + if len(a.MattermostAppID) > 32 { + return NewAppError("OAuthApp.IsValid", "model.oauth.is_valid.mattermost_app_id.app_error", nil, "app_id="+a.Id, http.StatusBadRequest) + } + return nil } |