Per-project admin key auth, drop ProjectID; MIT license; go 1.21

This commit is contained in:
rudder
2026-08-12 17:37:46 +03:00
parent 718eb09a78
commit 58eb477763
5 changed files with 35 additions and 15 deletions
-5
View File
@@ -9,7 +9,6 @@ const DefaultBaseURL = "https://api.rudder.build"
type Config struct {
APIKey string
ProjectID string
BaseURL string
Timeout time.Duration
HTTPClient *http.Client
@@ -27,9 +26,6 @@ func New(config Config) (*Client, error) {
if config.APIKey == "" {
return nil, &APIError{Code: ErrorCodeInvalidOptions, Message: "APIKey is required"}
}
if config.ProjectID == "" {
return nil, &APIError{Code: ErrorCodeInvalidOptions, Message: "ProjectID is required"}
}
if config.BaseURL == "" {
config.BaseURL = DefaultBaseURL
@@ -44,7 +40,6 @@ func New(config Config) (*Client, error) {
transport := &transport{
baseURL: config.BaseURL,
apiKey: config.APIKey,
projectID: config.ProjectID,
httpClient: config.HTTPClient,
}