Skip to content

Commit

Permalink
Merge pull request #33 from buildbarn/mmj/remove-blob-endpoint
Browse files Browse the repository at this point in the history
Remove blob download endpoint
  • Loading branch information
mortenmj authored Oct 15, 2024
2 parents 9969f77 + 42c2063 commit f00ea18
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 334 deletions.
1 change: 0 additions & 1 deletion cmd/bb_portal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ go_library(
"//internal/api",
"//internal/api/grpc/bes",
"//internal/graphql",
"//pkg/cas",
"//pkg/processing",
"//pkg/proto/configuration/bb_portal",
"@com_github_99designs_gqlgen//graphql/handler",
Expand Down
19 changes: 6 additions & 13 deletions cmd/bb_portal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/buildbarn/bb-portal/ent/gen/ent"
"github.com/buildbarn/bb-portal/ent/gen/ent/migrate"
"github.com/buildbarn/bb-portal/internal/api/grpc/bes"
"github.com/buildbarn/bb-portal/pkg/cas"
"github.com/buildbarn/bb-portal/pkg/processing"
"github.com/buildbarn/bb-portal/pkg/proto/configuration/bb_portal"
"github.com/buildbarn/bb-storage/pkg/global"
Expand All @@ -32,13 +31,11 @@ const (
)

var (
configFile = flag.String("config-file", "", "bb_portal config file")
dsDriver = flag.String("datasource-driver", "sqlite3", "Data source driver to use")
dsURL = flag.String("datasource-url", "file:buildportal.db?_journal=WAL&_fk=1", "Data source URL for the DB")
bepFolder = flag.String("bep-folder", "./bep-files/", "Folder to watch for new BEP files")
caFile = flag.String("ca-file", "", "Custom CA certificate file")
credentialsHelperCommand = flag.String("credential_helper", "", "Path to a credential helper. Compatible with Bazel's --credential_helper")
blobArchiveFolder = flag.String("blob-archive-folder", "./blob-archive/",
configFile = flag.String("config-file", "", "bb_portal config file")
dsDriver = flag.String("datasource-driver", "sqlite3", "Data source driver to use")
dsURL = flag.String("datasource-url", "file:buildportal.db?_journal=WAL&_fk=1", "Data source URL for the DB")
bepFolder = flag.String("bep-folder", "./bep-files/", "Folder to watch for new BEP files")
blobArchiveFolder = flag.String("blob-archive-folder", "./blob-archive/",
"Folder where blobs (log outputs, stdout, stderr, undeclared test outputs) referenced from failures are archived")
)

Expand Down Expand Up @@ -83,11 +80,7 @@ func main() {
runWatcher(watcher, dbClient, *bepFolder, blobArchiver)

router := mux.NewRouter()
casManager := cas.NewConnectionManager(cas.ManagerParams{
TLSCACertFile: *caFile,
CredentialsHelperCommand: *credentialsHelperCommand,
})
newPortalService(blobArchiver, casManager, dbClient, router)
newPortalService(blobArchiver, dbClient, router)
bb_http.NewServersFromConfigurationAndServe(
configuration.HttpServers,
bb_http.NewMetricsHandler(router, "PortalUI"),
Expand Down
4 changes: 1 addition & 3 deletions cmd/bb_portal/portal_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ import (
"github.com/buildbarn/bb-portal/ent/gen/ent"
"github.com/buildbarn/bb-portal/internal/api"
"github.com/buildbarn/bb-portal/internal/graphql"
"github.com/buildbarn/bb-portal/pkg/cas"
"github.com/buildbarn/bb-portal/pkg/processing"
"github.com/gorilla/mux"
)

func newPortalService(archiver processing.BlobMultiArchiver, casManager *cas.ConnectionManager, dbClient *ent.Client, router *mux.Router) {
func newPortalService(archiver processing.BlobMultiArchiver, dbClient *ent.Client, router *mux.Router) {
srv := handler.NewDefaultServer(graphql.NewSchema(dbClient))
srv.Use(entgql.Transactioner{TxOpener: dbClient})

router.PathPrefix("/graphql").Handler(srv)
router.Handle("/graphiql", playground.Handler("GraphQL Playground", "/graphql"))
router.Handle("/api/v1/blobs/{blobID}/{name}", api.NewBlobHandler(dbClient, casManager))
router.Handle("/api/v1/bep/upload", api.NewBEPUploadHandler(dbClient, archiver)).Methods("POST")
router.PathPrefix("/").Handler(frontendServer())
}
Expand Down
7 changes: 1 addition & 6 deletions internal/api/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@ load("@rules_go//go:def.bzl", "go_library")

go_library(
name = "api",
srcs = [
"bep_upload.go",
"blob_handler.go",
],
srcs = ["bep_upload.go"],
importpath = "github.com/buildbarn/bb-portal/internal/api",
visibility = ["//:__subpackages__"],
deps = [
"//ent/gen/ent",
"//ent/gen/ent/blob",
"//pkg/cas",
"//pkg/processing",
],
)
123 changes: 0 additions & 123 deletions internal/api/blob_handler.go

This file was deleted.

12 changes: 0 additions & 12 deletions pkg/auth/BUILD.bazel

This file was deleted.

78 changes: 0 additions & 78 deletions pkg/auth/credentials_helper.go

This file was deleted.

13 changes: 0 additions & 13 deletions pkg/cas/BUILD.bazel

This file was deleted.

Loading

0 comments on commit f00ea18

Please sign in to comment.