Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,15 @@ services:
list_labels:
method: GET
path: /gmail/v1/users/me/labels

calendly:
base_url: https://api.calendly.com
auth:
type: bearer
actions:
list_scheduled_events:
method: GET
path: /scheduled_events
params:
user: string
count: "int?"
11 changes: 11 additions & 0 deletions configs/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,14 @@ services:
list_labels:
method: GET
path: /gmail/v1/users/me/labels
calendly:
base_url: https://api.calendly.com
auth:
type: bearer
actions:
list_scheduled_events:
method: GET
path: /scheduled_events
params:
user: string
count: "int?"
12 changes: 12 additions & 0 deletions configs/services/calendly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
calendly:
base_url: https://api.calendly.com
auth:
type: bearer
actions:
list_scheduled_events:
method: GET
path: /scheduled_events
params:
user: string
count: "int?"
33 changes: 32 additions & 1 deletion internal/registry/production_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,37 @@ func TestProductionConfig_GoogleWorkspaceRequestsNarrowScope(t *testing.T) {
}
}

func TestProductionConfig_CalendlyListsScheduledEvents(t *testing.T) {
t.Parallel()
for _, configPath := range []string{
"../../configs/services.yaml",
"../../config/services.yaml",
"../../configs/services/calendly.yaml",
} {
r := New()
if err := r.LoadFile(configPath); err != nil {
t.Fatalf("load %s: %v", configPath, err)
}
svc, err := r.Get("calendly")
if err != nil {
t.Fatalf("get calendly from %s: %v", configPath, err)
}
if svc.BaseURL != "https://api.calendly.com" || svc.Auth.Type != "bearer" {
t.Fatalf("calendly service from %s = %+v, want Calendly bearer API", configPath, svc)
}
_, action, err := r.GetAction("calendly", "list_scheduled_events")
if err != nil {
t.Fatalf("get list_scheduled_events action from %s: %v", configPath, err)
}
if action.Method != "GET" || action.Path != "/scheduled_events" {
t.Fatalf("action from %s = %+v, want GET /scheduled_events", configPath, action)
}
if action.Params["user"] != "string" || action.Params["count"] != "int?" {
t.Fatalf("params from %s = %+v, want required user and optional count", configPath, action.Params)
}
}
}

// TestProductionConfig_LocalDevDefaultMatches guards against config/
// services.yaml (the local, non-Docker dev default) silently drifting
// out of sync with configs/services.yaml (the file Docker and the
Expand All @@ -73,7 +104,7 @@ func TestProductionConfig_LocalDevDefaultMatches(t *testing.T) {
if err := r.LoadFile("../../config/services.yaml"); err != nil {
t.Fatalf("load ../../config/services.yaml: %v", err)
}
for _, name := range []string{"github", "slack", "google_workspace", "stripe"} {
for _, name := range []string{"github", "slack", "google_workspace", "stripe", "calendly"} {
if _, err := r.Get(name); err != nil {
t.Errorf("config/services.yaml missing %q: %v", name, err)
}
Expand Down
Loading