Skip to content

Instantly share code, notes, and snippets.

View minskmaz's full-sized avatar

minskmaz

  • San Francisco
View GitHub Profile
FROM node:latest
WORKDIR /app
COPY ./index.js ./
COPY ./package*.json ./
RUN npm ci
EXPOSE 8080
CMD ["npm", "start"]
module.exports = function(pwd, extra) {
var forge = require("node-forge");
forge.options.usePureJavaScript = true;
var EC = require('elliptic').ec;
return new Promise((resolve, reject) => {
var ec_p256 = new EC('p256');
if (!pwd)
@Hornswoggles
Hornswoggles / mini.py
Created May 17, 2017 03:15
Mini web service with optional cert and jwt authentication and authorization
"""
This is a webservice that is implemented as a standalone twisted plugin.
All of the classes here could be separated out into distinct files but for
this example I find it easier to read if it's all together.
- Validates client certificate's
- Implements Twisted Cred to Authenticate Requests using JSON Web Tokens
TODO:
Create the Avatar Resource class that will perform authorization against our ACL