This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:latest | |
WORKDIR /app | |
COPY ./index.js ./ | |
COPY ./package*.json ./ | |
RUN npm ci | |
EXPOSE 8080 | |
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |