Git Product home page Git Product logo

discourse-apim's Introduction

discourse-apim

RCPCH API access management within Discourse

Setup

  • Ensure Docker is installed and running
  • Check out the main Discourse GitHub repo (https://github.com/discourse/discourse)
  • Check out this repository
  • Create a symlink between the main Discourse repo and this repo
    • In the Discourse repo run ln -s [location of this repo] plugins/discourse-apim
  • Follow the Discourse Docker development instructions
    • d/boot_dev --init
    • Run the Rails backend in one terminal: d/rails s
    • Run the Ember frontend in another: d/ember-cli

Scope

  • Request new API credentials for our free to access APIs
  • See existing API credentials (where security allows)
  • Regenerate new API credentials

Not in scope

  • Viewing API keys for paid tiers of access

Data Model

We create an Azure APIM subscription (ie API key) per endpoint. We deliberately do not use the ability to subscribe to an Azure APIM product as having a single API key that can access multiple endpoints is confusing.

We will create an Azure API product defining free tier access for each API. This is to enforce hard limits where appropriate.

We will not create products for paid access. In that case we manually create an Azure APIM subscription and assign it to the API directly. We then share the credentials directly with the paying customer as appropriate.

We will talk to the API management API directly:

To generate the list of APIs we will combine:

The latter contains a scope field against each subscription which we can use to display to the user what APIs they have already requested credentials for.

To display API keys we can use:

To request a new API key is two API calls:

  • User - Create Or Update
    • It's fine to call that on every request as if the user already exists it won't fail
    • The resource name is very picky but I think we can replace any non [A-Z,a-z] character from their email with -. That way we don't need to use the Discourse user ID in Azure APIM.
  • Subscription - Create Or Update

discourse-apim's People

Contributors

mbarton avatar

Watchers

Simon Chapman avatar  avatar

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.