Skip to content

Commit

Permalink
add extra rate limit stuff to global cfg (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
smonero authored May 15, 2024
1 parent 3910895 commit 6df4247
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
20 changes: 20 additions & 0 deletions server/config/raw/global_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(),
}
}

Expand Down
7 changes: 7 additions & 0 deletions server/config/valid/global_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6df4247

Please sign in to comment.