Merge pull request #454 from alphagov/simplify-jwt

Simplify JWT
This commit is contained in:
Rebecca Law
2016-04-15 12:08:41 +01:00
9 changed files with 7 additions and 43 deletions

View File

@@ -2,7 +2,6 @@ import os
import re
import dateutil
import datetime
import urllib
from flask import (
Flask,
@@ -16,10 +15,10 @@ from flask import (
from flask._compat import string_types
from flask_login import LoginManager
from flask_wtf import CsrfProtect
from notifications_python_client import HTTPError
from notifications_python_client.errors import HTTPError
from pygments import highlight
from pygments.lexers import JavascriptLexer
from pygments.formatters import HtmlFormatter
from pygments.formatters.html import HtmlFormatter
from pygments.lexers.javascript import JavascriptLexer
from werkzeug.exceptions import abort
from app.notify_client.api_client import ServiceAPIClient

View File

@@ -7,9 +7,6 @@ from flask import (
abort
)
from notifications_python_client.errors import HTTPError
from app.main import main
from app import (

View File

@@ -14,7 +14,7 @@ from flask_login import (
current_user
)
from notifications_python_client import HTTPError
from notifications_python_client.errors import HTTPError
from app.main import main
from app.main.forms import (
InviteUserForm,

View File

@@ -11,7 +11,7 @@ from flask_login import (
login_required,
current_user
)
from notifications_python_client import HTTPError
from notifications_python_client.errors import HTTPError
from app import service_api_client
from app.main import main

View File

@@ -14,7 +14,6 @@ from itsdangerous import SignatureExpired
from flask_login import login_user
from notifications_python_client.errors import HTTPError
from notifications_utils.url_safe_token import check_token
from app.main import main

View File

@@ -1,7 +1,7 @@
from flask import jsonify, request
from app import (version, status_api_client)
from app.status import status
from notifications_python_client import HTTPError
from notifications_python_client.errors import HTTPError
@status.route('/_status', methods=['GET'])

View File

@@ -48,26 +48,10 @@
{
iss: 'string', // service id
iat: 0, // creation time in epoch seconds (UTC)
req: 'string', // signed request
pay: 'string', // signed payload (POST requests only)
}
"""|syntax_highlight_json}}
<div class="grid-row">
<div class="column-three-quarters">
<p>Notify API tokens sign both the request being made, and for POST requests, the payload.</p>
<p>
The signing algorithm is HMAC signature, using provided key SHA256 hashing algorithm.
</p>
<p>Request signing is of the form HTTP METHOD PATH.</p>
{{ "GET /notification/1234"|syntax_highlight_json }}
<p></p>
<p>Payload signing requires the actual payload to be signed, NOT the JSON object. Serialize the object first
then sign the serialized object.</p>
<h3 class="heading-medium">
API endpoints