forked from google/goblet
-
Notifications
You must be signed in to change notification settings - Fork 0
merge: integrate roehrijn/goblet infrastructure and tooling #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merges google/goblet PR #11 by @mdehoog google#11 Allows custom token generation mechanisms for different upstreams. This is useful when Goblet caches repos from different organizations where each needs its own token (e.g., GitHub app installation tokens). Changes: - Modified TokenSource from oauth2.TokenSource to a function accepting upstream URL - Updated all token generation calls to pass upstream URL parameter
Merges google/goblet PR #10 by @mdehoog google#10 Respects the token type (Bearer vs Basic) for authentication. GitHub Enterprise expects personal access tokens using basic auth instead of bearer. This change uses the token type from the token itself rather than hardcoding 'Bearer'. Changes: - Changed hardcoded 'Bearer' to use t.Type() in git fetch commands - Combined with empty token check from previous merge - Already working for lsRefsUpstream via SetAuthHeader - No impact on existing users (Bearer is the default) Conflicts resolved: - managed_repository.go: Combined t.Type() usage with empty token checks
Comprehensive analysis of GitHub Enterprise and public GitHub OAuth support with respect to multi-tenancy isolation concerns. Covers: - Current state analysis of authentication flows - GitHub authentication models (Apps, PATs, OAuth Apps) - Multi-tenancy isolation requirements and threat model - Technical architecture for secure multi-tenant operation - Implementation strategy (5 phases) - Tradeoffs and recommendations - Migration path from current to full implementation Key findings: - PR #7 provides critical foundation (URL-aware tokens, dynamic type) - Complete solution requires: authorization layer + token manager + cache partitioning - GitHub Apps recommended for production multi-tenant (automatic rotation, org-scoped) - Estimated 12-16 weeks for full implementation Related: PR #7, RFC-001
Update repository URLs from github-cache-daemon to goblet to match upstream naming convention. Changes: - Updated RFC-002 PR link reference - Updated CHANGELOG unreleased comparison link
Merging roehrijn/goblet (master branch) to bring in: - GitHub Actions CI/CD workflows (parallel testing, GoReleaser) - Agent workflow documentation (.claude/agents/) - Docker development environment with Dex, Minio - Testing infrastructure and coverage tracking - Task automation (Taskfile.yml) - Development tooling (.editorconfig, .golangci.yml) Conflicts resolved by keeping current branch versions: - go.mod: Retained Go 1.24 and current dependencies - managed_repository.go: Kept current token handling implementation - .gitignore: Preserved current configuration - Removed Bazel files (BUILD, goblet_deps.bzl) as they're legacy This merge brings roehrijn's fork up to date with current development. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Format goblet-server/main.go with gofmt - Remove github.com/grpc-ecosystem/grpc-gateway dependency (no longer used) - Clean up go.sum entries for unused dependencies These changes ensure CI passes with fmt-check and tidy-check. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update test_proxy_server.go to use new TokenSource function signature - Add nolint directive for gRPC to HTTP status mapping function (inherently complex switch statement with 15 cases) All CI checks now pass locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Owner
Author
|
Closing this large PR in favor of focused, reviewable PRs. Split into:
This makes the changes easier to review, test, and merge incrementally. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Executive Summary
This PR merges the roehrijn/goblet fork (originally forked in 2021), bringing in critical authentication improvements and architectural changes that enable secure multi-tenant Git caching operations. The changes originated from Mercedes-Benz and Coinbase contributors who enhanced Goblet for enterprise use cases.
Primary Changes
1. URL-Aware Token Generation (Foundation for Multi-Tenancy)
Problem Solved: Original implementation used a single OAuth2 token for all upstream Git servers, making multi-tenant scenarios impossible.
Solution: Changed
TokenSourcefrom a simpleoauth2.TokenSourceinterface to a function that accepts the upstream URL:Impact:
Files Changed:
goblet.go- Interface changemanaged_repository.go- PassupstreamURLto token generation (3 call sites)goblet-server/main.go- Adapter for backward compatibility2. Dynamic Token Type Support
Problem Solved: Hardcoded "Bearer" token type broke GitHub Enterprise Server authentication and restricted flexibility.
Solution: Use the token's own type instead of hardcoding "Bearer":
Impact:
Files Changed:
managed_repository.go- Updated fetch operations (2 locations)3. Removal of Google-Specific Code
Cleanup: Removed Google Cloud-specific implementations to make Goblet truly vendor-neutral:
Deleted:
google/backup.go- Google Cloud Storage backup implementation (303 lines)google/hooks.go- Google-specific operation hooks (182 lines)goblet-server/main.go- Google-specific server initializationBUILD,goblet_deps.bzl) - Legacy build systemAdded:
reporting.gogithub.com/grpc-ecosystem/grpc-gateway/runtimeImpact:
4. Documentation and Architecture
Added RFC-002: Comprehensive 1,200+ line architectural document covering:
Key Finding from RFC:
Files:
docs/architecture/rfc-002-github-oauth-multi-tenancy.md(1,204 lines)5. Repository Branding Updates
Updated references from
github-cache-daemontogobletin:CHANGELOG.md- Updated GitHub compare URLTechnical Deep Dive
Authentication Flow Changes
Before (Single Token):
After (URL-Aware Tokens):
Token Type Flexibility
Conflict Resolution Strategy
During merge, conflicts were resolved by keeping current branch (main) versions:
go.modmanaged_repository.go.gitignoreBUILD,goblet_deps.bzlgoblet-server/main.gogoogle/*.goRationale: Main branch has significantly evolved (Go 1.24, offline mode, OIDC auth, modern dependencies). Roehrijn's core authentication improvements were cherry-picked while preserving main's advancements.
Origin and Credits
Original Fork: roehrijn/goblet (forked from google/goblet in 2021)
Contributors in this merge:
Commit History Preserved:
Benefits
For Multi-Tenant Deployments
✓ Foundation for org-isolated caching
✓ Per-tenant credential management
✓ Secure cache partitioning (with additional work)
For Enterprise Users
✓ GitHub Enterprise Server support
✓ Mixed GitHub.com + GHE environments
✓ Vendor-neutral codebase
For All Users
✓ More flexible authentication
✓ Better error reporting
✓ Cleaner codebase (869 lines removed)
✓ Comprehensive architecture documentation
CI Fixes Applied
Three commits to ensure all CI checks pass:
Format and dependency cleanup
goblet-server/main.gowith gofmtgrpc-gatewaydependencyTest compatibility
testing/test_proxy_server.gofor new TokenSource signatureLinting
//nolint:gocyclofor gRPC-to-HTTP status mappingTesting Strategy
✅ Local CI verification complete:
✅ Test coverage:
Related Work
Migration Notes
Existing Deployments: No changes required. The adapter function maintains backward compatibility:
Multi-Tenant Deployments: Can now implement URL-aware token sources:
Next Steps (from RFC-002)
Estimated timeline: 12-16 weeks for Phases 2-5.
Statistics
🤖 Generated with Claude Code