Code Monkey home page Code Monkey logo

addons's People

Contributors

amark avatar biilmann avatar davidwells avatar dependabot[bot] avatar erezrokah avatar rstavchansky avatar swyxio avatar verythorough avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

addons's Issues

[security] Enforce Branch Protections

This is an issue generated by (for-internal-use-only)github-tools

Description

This repository has exceeded the development grace period, and the repo owner must decide if branch protections should be enforced.
If this repository houses code used in production in any capacity, branch protections must be enforced. Read (for-internal-use-only)here for more details

What do I need to do?

  • You can control whether or not branch protections are enforced by exclusively creating either of the labels:
    'enforce-branch-protections: true' or 'enforce-branch-protections: false'
  • If there is no branch protection control label, this issue will be recreated.
  • Once you have created either label, you can close this issue.
  • If you have issues or questions, please reach out to #internal-security-n-compliance on slack.

Improve the example payload from Netlify for creating a new instance

https://github.com/netlify/addons#payload-from-netlify-1 this example payload from Netlify is the following:

{
  // Unique ID generated by Netlify
  uuid: '2e65dd70-523d-48d8-8826-a93229d7ec01',
  account: '5902622bcf321c7359e97e52',
  config: {
    site_url: 'https://calling-site-from-netlify.netlify.com',
    jwt: {
      secret: 'xyz-netlify-secret'
    },
    // User defined configuration values
    config: {
      name: 'woooooo'
    },
    // Netlify Site id
    site_id: '2e65dd70-523d-48d8-8826-a93229d7ec01',
    // Your service ID slug
    service_id: 'express-example',
    service_instance: {
      config: { name: 'woooooo' }
    },
    // If your add-on needs to trigger site rebuilds we will send a build hook
    incoming_hook_url: 'https://api.netlify.com/build_hooks/123xyz'
  }
}

this is unclear what is actually coming and what is just an example. in fact, by default, we don't pass most of them.

also, it's worth to mention that uuid is actually site_id of the netlify, that'd be a useful information for some providers.

cc/ @rybit

Document `/instances` POST (and other) format

I'm trying to avoid using Express as a dependency.

Is it a urlencoded format? I hope so, because that would be pretty easy to handle.

It'd be really nice if there was mock requests I could test against before deploying, to make sure it is correct.

Docs: Description of auth token sending patterns may be incorrect

Based on some troubleshooting with a partner, @bettse identified a section of the repo README that seems to be incorrect:

Under "Registering your add-on", I believe this is inaccurate:

All requests from Netlify to your add-on’s management API will contain an X-Nf-Sign authorization header. You can verify request are coming from Netlify by verifying the X-Nf-Sign header against your add-on secret.

I think that requests to the add-on's management API have the Authorization header with bearer {service secret}, and that the NON-management API requests (those that we proxy from /.netlify/{service slug}) are the ones with the x-nf-sign header.

While in there, it would be helpful to do a pass to check for broken links (for example, Eric noted the 'Getting started' link under https://github.com/netlify/addons#verification-with-jws).

[Addons] Add 'message' field to addon `create`, `config`, & `delete`

Is your feature request related to a problem? Please describe.

When addons are created, updated, or deleted the user sees a generic message without additional context on what to do next.

Example CLI output with no additional context:

image

VGS needs to tell the user to complete some additional steps to finish setup and would like to log out instructions after creation/updating

A couple of addon providers have requested being able to show a message after netlify addons:create/update/delete

This would be an extra field passed back from their API in the provisioning calls. Example from create

{
  // `id` (required) - A unique ID generated by you, for reference within your own API
  id: uuid(),
+ message: "My custom message for the user to see in the CLI or the UI"
  // `endpoint` (optional) - Proxied endpoint.
  // This will be callable at https://user-netlify-site.com/.netlify/your-addon-namespace
  endpoint: "https://my-endpoint.example.com",
  /* `config` (optional) - This can return back exactly what was received in the POST request, or include additional fields or altered values. This should also be what is returned in response to a GET request to /instances/:id */
  config: {},
  // `env` (optional) - Environment Keys accessible by Netlify user in build context & in functions
  env: {
    'YOUR_SERVICE_API_SECRET': 'value'
  },
  // `snippets` (optional) - JS Snippet content to inject into the calling Netlify site
  snippets: [
    {
      title: 'Snippet From Demo App',
      position: 'head',
      html: `<script>console.log("Hello from ${logValue}")</script>`
    }
  ]
}

Proposed Solution

Add message field to allowed values back from addon endpoints and pass those down to the client (CLI & UI)

Show message here in CLI https://github.com/netlify/cli/blob/master/src/commands/addons/create.js#L65

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.