Skip to content

Commit

Permalink
remove GitHub integration remains
Browse files Browse the repository at this point in the history
  • Loading branch information
sechmann committed Jun 30, 2023
1 parent 367670a commit 8f76ead
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
6 changes: 0 additions & 6 deletions cmd/hookd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
)

var maskedConfig = []string{
config.GithubClientSecret,
config.DatabaseEncryptionKey,
config.DatabaseUrl,
config.DeploydKeys,
Expand Down Expand Up @@ -72,10 +71,6 @@ func run() error {
log.Info(line)
}

if cfg.Github.Enabled && (cfg.Github.ApplicationID == 0 || cfg.Github.InstallID == 0) {
return fmt.Errorf("--github-install-id and --github-app-id must be specified when --github-enabled=true")
}

provisionKey, err := hex.DecodeString(cfg.ProvisionKey)
if err != nil {
return fmt.Errorf("provisioning pre-shared key must be a hex encoded string")
Expand Down Expand Up @@ -141,7 +136,6 @@ func run() error {
BaseURL: cfg.BaseURL,
DeploymentStore: db,
DispatchServer: dispatchServer,
GithubConfig: cfg.Github,
MetricsPath: cfg.MetricsPath,
ValidatorMiddlewares: validators,
PSKValidator: middleware.PskValidatorMiddleware(cfg.FrontendKeys),
Expand Down
2 changes: 0 additions & 2 deletions pkg/hookd/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
api_v1_dashboard "github.com/nais/deploy/pkg/hookd/api/v1/dashboard"
api_v1_provision "github.com/nais/deploy/pkg/hookd/api/v1/provision"
api_v1_teams "github.com/nais/deploy/pkg/hookd/api/v1/teams"
"github.com/nais/deploy/pkg/hookd/config"
"github.com/nais/deploy/pkg/hookd/database"
"github.com/nais/deploy/pkg/hookd/logproxy"
"github.com/nais/deploy/pkg/hookd/middleware"
Expand All @@ -30,7 +29,6 @@ type Config struct {
BaseURL string
DispatchServer dispatchserver.DispatchServer
DeploymentStore database.DeploymentStore
GithubConfig config.Github
InstallationClient *gh.Client
MetricsPath string
ValidatorMiddlewares chi.Middlewares
Expand Down
23 changes: 0 additions & 23 deletions pkg/hookd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ import (
"github.com/spf13/viper"
)

type Github struct {
Enabled bool `json:"enabled"`
ClientID string `json:"client-id"`
ClientSecret string `json:"client-secret"`
ApplicationID int `json:"app-id"`
InstallID int `json:"install-id"`
KeyFile string `json:"key-file"`
}

type GRPC struct {
Address string `json:"address"`
CliAuthentication bool `json:"cli-authentication"`
Expand All @@ -33,7 +24,6 @@ type Config struct {
DatabaseConnectTimeout time.Duration `json:"database-connect-timeout"`
DeploydKeys []string `json:"deployd-keys"`
FrontendKeys []string `json:"frontend-keys"`
Github Github `json:"github"`
GoogleClientId string `json:"google-client-id"`
GoogleAllowedDomains []string `json:"google-allowed-domains"`
GoogleClusterProjects []string `json:"google-cluster-projects"`
Expand All @@ -55,12 +45,6 @@ const (
DatabaseUrl = "database-url"
DeploydKeys = "deployd-keys"
FrontendKeys = "frontend-keys"
GithubAppId = "github.app-id"
GithubClientId = "github.client-id"
GithubClientSecret = "github.client-secret"
GithubEnabled = "github.enabled"
GithubInstallId = "github.install-id"
GithubKeyFile = "github.key-file"
GoogleClientId = "google-client-id"
GoogleAllowedDomains = "google-allowed-domains"
GoogleClusterProjects = "google-cluster-projects"
Expand Down Expand Up @@ -91,13 +75,6 @@ func Initialize() *Config {
bindNAIS()

// Provide command-line flags
flag.Bool(GithubEnabled, false, "Enable connections to Github.")
flag.Int(GithubAppId, 0, "Github App ID.")
flag.Int(GithubInstallId, 0, "Github App installation ID.")
flag.String(GithubKeyFile, "private-key.pem", "Path to PEM key owned by Github App.")
flag.String(GithubClientId, "", "Client ID of the Github App.")
flag.String(GithubClientSecret, "", "Client secret of the GitHub App.")

flag.String(BaseUrl, "http://localhost:8080", "Base URL where hookd can be reached.")
flag.String(ListenAddress, "127.0.0.1:8080", "IP:PORT")
flag.String(LogFormat, "text", "Log format, either 'json' or 'text'.")
Expand Down

0 comments on commit 8f76ead

Please sign in to comment.