Commit Graph

13 Commits

Author SHA1 Message Date
Chris Hill-Scott
415e1a401a Don’t set combined API on Notify python client
Because we’re setting the API key and service ID after calling the
`__init__` method of the client it wasn’t doing the thing where it
splits the combined key into the two individual UUIDs. So we still need
to set them directly, individually on the client.
2017-07-26 12:08:10 +01:00
Chris Hill-Scott
5ddbe80ea9 Fix calls to API client which now takes fewer args
The Notify API client changed in version 4 to take two arguments, not
three (service ID was removed in favour of the combined API key).

This gets a bit gnarly because the API key has to be at least a certain
length so it can be substringed internally.
2017-07-26 11:10:37 +01:00
Martyn Inglis
08dc8fb13d Use the local APIClient rather than the one from the python-api-client
- ensures that all API calls set the request ID when talking to the API.
2016-11-30 17:01:44 +00:00
Chris Hill-Scott
92aacc1a54 Remove extraneous arguments to super
> dont need self.__class__, self in super - that's a python 2.x crutch.
> super() is equivalent
2016-09-12 14:59:53 +01:00
Chris Hill-Scott
5fda35c89d Make it clear that client do not use __init__
The clients never get passed useful values to their `__init__` methods.
Rather the real values are passed through later using the `init_app`
method.

So it should be an error if the client is relying on the values that
get passed to it’s init method. Easiest way to ensure this is by making
the `__init__` method not expect any arguments and passing fake values
to the `Super` call.
2016-09-12 12:18:19 +01:00
Chris Hill-Scott
fa5e5475e9 Update Python client
Just so that nobody else has to do it.

Implements:
- [x] https://github.com/alphagov/notifications-python-client/pull/29

Which is a breaking change requiring the renaming of method arguments.
2016-09-08 15:55:07 +01:00
Chris Hill-Scott
da1fa2e61c Make _attach_current_user a pure function
Mutating dictionaries is gross and doesn’t work as you’d expect. Better
to have the function return a new dictionary instead.

Means we can be explicit that `created_by` is one of the allowed params
when updating a service.
2016-08-11 17:07:55 +01:00
Leo Hemsted
630b5df552 Save api_key.key_type from radio buttons 2016-07-06 15:10:36 +01:00
Leo Hemsted
6ce087a7b5 send key_type = normal when creating api keys 2016-06-27 12:02:16 +01:00
Nicholas Staples
2085792742 Add created_by to all appropriate requests. 2016-04-15 11:08:19 +01:00
Nicholas Staples
48368584d9 notifications-python_client upgraded to 0.2.5 2016-02-11 15:27:08 +00:00
Rebecca Law
90fca93308 Implementation of api key pages.
Revoke page will show the correct key name
Show api keys shows a well formatted expiry date
Fix tests for api key endpoints.
2016-01-21 12:28:05 +00:00
Rebecca Law
41c775cd68 Created api_key_api_client.
Implementation of create, revoke and show api keys for service.
These calls work, however we still need to fix the tests.
2016-01-20 17:32:55 +00:00