Code Monkey home page Code Monkey logo

brigade-cloudevents-gateway's People

Contributors

krancour avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

czunker

brigade-cloudevents-gateway's Issues

user-agent is not specified when validating the event source

The user-agent header is not currently set when validating the event source (

headers := make(http.Header)
headers.Set("WebHook-Allowed-Origin", "*")
headers.Set(
"WebHook-Allowed-Rate",
strconv.Itoa(cloudHTTP.DefaultAllowedRate),
)
headers.Set("Allow", http.MethodPost)
). It would be kind to provide some indication of the client when addressing the event source.

docs: recommend Brigade v2.6.0 as the minimum version for use with this gateway

brigadecore/brigade#1961 allows the values of event qualifiers and labels to be longer than before.

This seems fairly critical to the success of this particular gateway because CloudEvent source are likely to be fairly long strings and this information gets poked into a qualifier. (For reference, I've seen sources 160+ characters long coming from Azure Event Grid.)

In light of this, the docs for this gateway should probably recommend v2.6.0+ (unreleased as of this writing) as the minimum Brigade version.

docs need a makeover

This component is getting closer to a GA state and needs the same kind of docs makeover that has been done for a few of the other gateways.

The goal is to shorten the README and give it a clear focus on usage by an end user and move the installation instructions, which are operator-focused, and comparatively uninteresting, to their own page.

proposal: put the entire cloud event in the brigade event's payload

... instead of just what's in the data field.

Example CloudEvent that came from from Azure Container Registry via Azure Event Grid:

{
  "id": "78e0a086-b9c2-49aa-be49-00d0abf2f866",
  "source": "/subscriptions/9491dcfe-4a3c-4806-a1c9-61dde2354d03/resourceGroups/brigade/providers/Microsoft.ContainerRegistry/registries/unstablebrigade",
  "specversion": "1.0",
  "type": "Microsoft.ContainerRegistry.ImagePushed",
  "subject": "brigade2-git-initializer:edge",
  "time": "2022-05-20T19:12:56.7210091Z",
  "data": {
    "id": "78e0a086-b9c2-49aa-be49-00d0abf2f866",
    "timestamp": "2022-05-20T19:12:56.5970848Z",
    "action": "push",
    "location": "eastus",
    "target": {
      "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
      "size": 743,
      "digest": "sha256:1c016eea8d789c445736314480d0f9f46ec2820c5dcb51308b2d226985eef4ce",
      "length": 743,
      "repository": "brigade2-git-initializer",
      "tag": "edge"
    },
    "request": {
      "id": "bf4003e0-030b-4b15-8930-69f7975b8e2b",
      "host": "unstablebrigade.azurecr.io",
      "method": "PUT",
      "useragent": "buildkit/v0.10"
    }
  }
}

I feel like there's a strong possibility that an end user of Brigade would want to access fields that aren't subordinate to data in their scripts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.