diff --git a/server/config/raw/global_cfg.go b/server/config/raw/global_cfg.go index 90a9476b0..d32db5ea4 100644 --- a/server/config/raw/global_cfg.go +++ b/server/config/raw/global_cfg.go @@ -27,6 +27,25 @@ type GlobalCfg struct { RevisionSetter RevisionSetter `yaml:"revision_setter" json:"revision_setter"` Admin Admin `yaml:"admin" json:"admin"` AdhocMode AdhocMode `yaml:"adhoc_mode" json:"adhoc_mode"` + ExtraGithubRateLimit ExtraGithubRateLimit `yaml:"extra_github_rate_limit" json:"extra_github_rate_limit"` +} + +type ExtraGithubRateLimit struct { + GHSlug string `yaml:"gh_slug" json:"gh_slug"` + GHAppID string `yaml:"gh_app_id" json:"gh_app_id"` + GHAppKey string `yaml:"gh_app_key" json:"gh_app_key"` +} + +func (t ExtraGithubRateLimit) ToValid() valid.ExtraGithubRateLimit { + return valid.ExtraGithubRateLimit{ + GHSlug: t.GHSlug, + GHAppID: t.GHAppID, + GHAppKey: t.GHAppKey, + } +} + +func (t ExtraGithubRateLimit) Validate() error { + return nil } type AdhocMode struct { @@ -215,6 +234,7 @@ func (g GlobalCfg) ToValid(defaultCfg valid.GlobalCfg) valid.GlobalCfg { Admin: g.Admin.ToValid(), RevisionSetter: g.RevisionSetter.ToValid(), AdhocMode: g.AdhocMode.ToValid(), + ExtraGithubRateLimit: g.ExtraGithubRateLimit.ToValid(), } } diff --git a/server/config/valid/global_cfg.go b/server/config/valid/global_cfg.go index 92aab936a..67426b01a 100644 --- a/server/config/valid/global_cfg.go +++ b/server/config/valid/global_cfg.go @@ -65,6 +65,13 @@ type GlobalCfg struct { RevisionSetter RevisionSetter Admin Admin AdhocMode AdhocMode + ExtraGithubRateLimit ExtraGithubRateLimit +} + +type ExtraGithubRateLimit struct { + GHSlug string + GHAppID string + GHAppKey string } type AdhocMode struct {