Skip to content
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

Add function type: cloudevent #1

Closed
6 tasks done
subfuzion opened this issue Nov 22, 2020 · 3 comments · Fixed by #77
Closed
6 tasks done

Add function type: cloudevent #1

subfuzion opened this issue Nov 22, 2020 · 3 comments · Fixed by #77
Assignees

Comments

@subfuzion
Copy link
Member

subfuzion commented Nov 22, 2020

https://github.com/GoogleCloudPlatform/functions-framework#cloudevents-functions-signature-type-cloudevent

  • Structured event type
  • Binary event type
  • Pass conformance tests
  • disallow requests with the wrong shape with the correct 4XX response
  • add unit and integration tests for Cloud Events (at the moment, we're validated only with conformance tests)
  • kill the process it it tries to startup with a mismatched
@subfuzion subfuzion self-assigned this Nov 22, 2020
@grant
Copy link
Contributor

grant commented Dec 7, 2020

Parse these HTTP requests:

Note: These specific request may need adjustments (like adding ce-subject)

POST / HTTP/1.1
Content-Type: application/json; charset=utf-8
Content-Length: 33
ce-specversion: 1.0
ce-type: google.cloud.pubsub.topic.publish
ce-time: 2020-09-05T03:56:24Z
ce-id: 1234-1234-1234
{
 "subscription": "projects/my-project/subscriptions/my-subscription",
 "message": {
   "@type": "type.googleapis.com/google.pubsub.v1.PubsubMessage",
   "attributes": {
     "attr1":"attr1-value"
   },
   "data": "dGVzdCBtZXNzYWdlIDM="
 }
}
POST / HTTP/1.1
Content-Type: application/json; charset=utf-8
{
  specversion: 1.0
  type: google.cloud.pubsub.topic.publish
  time: 2020-09-05T03:56:24Z
  id: 1234-1234-1234
  data: {
    "subscription": "projects/my-project/subscriptions/my-subscription",
    "message": {
      "@type": "type.googleapis.com/google.pubsub.v1.PubsubMessage",
      "attributes": {
        "attr1":"attr1-value"
      },
      "data": "dGVzdCBtZXNzYWdlIDM="
    }
  }
}

@grant
Copy link
Contributor

grant commented Dec 7, 2020

HTTP return value doesn't matter. See FF GitHub repo readme: https://github.com/GoogleCloudPlatform/functions-framework

@grant
Copy link
Contributor

grant commented Dec 7, 2020

Here's example code for how to receive a CloudEvent in the FF:

Do note that the Pub/Sub emulator is not compatible with CloudEvents (and thus the Functions Framework), so don't use it. Use cURL and unit tests to test the functionality.

kevmoo added a commit that referenced this issue Dec 10, 2020
Add conformance tests for http and cloud events

Fixes #1
Fixes #31
kevmoo added a commit that referenced this issue Dec 10, 2020
Add conformance tests for http and cloud events

Fixes #1
Fixes #31
kevmoo added a commit that referenced this issue Dec 10, 2020
Add conformance tests for http and cloud events

Progress towards #1
Fixes #31
kevmoo added a commit that referenced this issue Dec 10, 2020
kevmoo added a commit that referenced this issue Dec 10, 2020
kevmoo added a commit that referenced this issue Dec 10, 2020
kevmoo added a commit that referenced this issue Dec 10, 2020
kevmoo added a commit that referenced this issue Dec 10, 2020
kevmoo added a commit that referenced this issue Dec 10, 2020
kevmoo added a commit that referenced this issue Dec 10, 2020
kevmoo added a commit that referenced this issue Dec 10, 2020
@kevmoo kevmoo self-assigned this Dec 11, 2020
kevmoo added a commit that referenced this issue Dec 11, 2020
Correctly handle, reply to, and log bad requests

Fixes #1
kevmoo added a commit that referenced this issue Dec 11, 2020
Correctly handle, reply to, and log bad requests

Fixes #1
kevmoo added a commit that referenced this issue Dec 11, 2020
Correctly handle, reply to, and log bad requests

Fixes #1
kevmoo added a commit that referenced this issue Dec 11, 2020
Correctly handle, reply to, and log bad requests

Fixes #1
kevmoo added a commit that referenced this issue Dec 11, 2020
Correctly handle, reply to, and log bad requests

Fixes #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants