Skip to content

kits: declare roles/eventarc.publisher so event publishing does not 403 #3125

Description

@cabljac

Every kit that publishes Eventarc events declares roles/eventarc.eventReceiver and roles/run.invoker but not roles/eventarc.publisher:

  • kits/firestore-counter/src/index.ts:40
  • kits/firestore-translate-text/src/index.ts:37
  • kits/firestore-bigquery-export/src/index.ts:63
  • kits/speech-to-text/src/index.ts:38

The extensions never declared a publisher role either; they got publish rights on the channel from the Extensions install flow (the events: block in extension.yaml). Kits have no equivalent, so nothing grants it. #3098 reports every publish returning 403 in a test project with EVENTARC_CHANNEL set.

The consequence is worse than missing telemetry, because each handler awaits the publish inline:

  • firestore-counter src/handlers.ts:65 and firestore-translate-text src/handlers.ts:64 await recordStartEvent as their first action, so with the channel set the function throws before it aggregates or translates anything.
  • firestore-bigquery-export src/handlers.ts:180 does the same before the BigQuery write.
  • speech-to-text awaits recordCompleteEvent at src/handlers.ts:198 after transcription, so the work is done but the invocation fails.

Fix: add "roles/eventarc.publisher" to REQUIRED_ROLES in each of the four kits (one line each, same mechanism as the roles already declared), and re-run the deploy test in #3098 to confirm a subscriber receives the payload. If the intent is for users to grant it themselves, the READMEs need to say so; none do today.

Tracked in #2974.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions