`__
Non-breaking changes:
- Add Meetup support. (Thanks `Jamie Tanna `__!)
- Blogger, Google:
- The ``state`` query parameter now works!
- Add new ``outer_classes`` kwarg to ``button_html()`` for the outer
````, eg as Bootstrap columns.
- Add new ``image_file`` kwarg to ``StartHandler.button_html()``
.. _section-3:
2.2 - 2019-11-01
~~~~~~~~~~~~~~~~
- Add LinkedIn and Mastodon!
- Add Python 3.7 support, and improve overall Python 3 compatibility.
- Add new ``button_html()`` method to all ``StartHandler`` classes.
Generates the same button HTML and styling as on
`oauth-dropins.appspot.com `__.
- Blogger: rename module from ``blogger_v2`` to ``blogger``. The
``blogger_v2`` module name is still available as an alias,
implemented via symlink, but is now deprecated.
- Dropbox: fix crash with unicode header value.
- Google: fix crash when user object doesn’t have ``name`` field.
- Facebook: `upgrade Graph API version from 2.10 to
4.0. `__
- Update a number of dependencies.
- Switch from Python’s built in ``json`` module to
`ujson `__ (built into App
Engine) to speed up JSON parsing and encoding.
.. _section-4:
2.0 - 2019-02-25
~~~~~~~~~~~~~~~~
- *Breaking change*: switch from `Google+
Sign-In `__ (`which
shuts down in
March `__) to `Google
Sign-In `__. Notably, this
removes the ``googleplus`` module and adds a new ``google_signin``
module, renames the ``GooglePlusAuth`` class to ``GoogleAuth``, and
removes its ``api()`` method. Otherwise, the implementation is mostly
the same.
- webutil.logs: return HTTP 400 if ``start_time`` is before 2008-04-01
(App Engine’s rough launch window).
.. _section-5:
1.14 - 2018-11-12
~~~~~~~~~~~~~~~~~
- Fix dev_appserver in Cloud SDK 219 / ``app-engine-python`` 1.9.76 and
onward.
`Background. `__
- Upgrade ``google-api-python-client`` from 1.6.3 to 1.7.4 to `stop
using the global HTTP Batch
endpoint `__.
- Other minor internal updates.
.. _section-6:
1.13 - 2018-08-08
~~~~~~~~~~~~~~~~~
- IndieAuth: support JSON code verification responses as well as
form-encoded
(`snarfed/bridgy#809 `__).
.. _section-7:
1.12 - 2018-03-24
~~~~~~~~~~~~~~~~~
- More Python 3 updates and bug fixes in webutil.util.
.. _section-8:
1.11 - 2018-03-08
~~~~~~~~~~~~~~~~~
- Add GitHub!
- Facebook:
- Pass ``state`` to the initial OAuth endpoint directly, instead of
encoding it into the redirect URL, so the redirect can `match the
Strict Mode
whitelist `__.
- Add Python 3 support to webutil.util!
- Add humanize dependency for webutil.logs.
.. _section-9:
1.10 - 2017-12-10
~~~~~~~~~~~~~~~~~
Mostly just internal changes to webutil to support granary v1.10.
.. _section-10:
1.9 - 2017-10-24
~~~~~~~~~~~~~~~~
Mostly just internal changes to webutil to support granary v1.9.
- Flickr:
- Handle punctuation in error messages.
.. _section-11:
1.8 - 2017-08-29
~~~~~~~~~~~~~~~~
- Facebook:
- Upgrade Graph API from v2.6 to v2.10.
- Flickr:
- Fix broken ``FlickrAuth.urlopen()`` method.
- Medium:
- Bug fix for Medium OAuth callback error handling.
- IndieAuth:
- Store authorization endpoint in state instead of rediscovering it
from ``me`` parameter, `which is going
away `__.
.. _section-12:
1.7 - 2017-02-27
~~~~~~~~~~~~~~~~
- Updates to bundled webutil library, notably WideUnicode class.
.. _section-13:
1.6 - 2016-11-21
~~~~~~~~~~~~~~~~
- Add auto-generated docs with Sphinx. Published at
`oauth-dropins.readthedocs.io `__.
- Fix Dropbox bug with fetching access token.
.. _section-14:
1.5 - 2016-08-25
~~~~~~~~~~~~~~~~
- Add `Medium `__.
.. _section-15:
1.4 - 2016-06-27
~~~~~~~~~~~~~~~~
- Upgrade Facebook API from v2.2 to v2.6.
.. _section-16:
1.3 - 2016-04-07
~~~~~~~~~~~~~~~~
- Add `IndieAuth `__.
- More consistent logging of HTTP requests.
- Set up Coveralls.
.. _section-17:
1.2 - 2016-01-11
~~~~~~~~~~~~~~~~
- Flickr:
- Add upload method.
- Improve error handling and logging.
- Bug fixes and cleanup for constructing scope strings.
- Add developer setup and troubleshooting docs.
- Set up CircleCI.
.. _section-18:
1.1 - 2015-09-06
~~~~~~~~~~~~~~~~
- Flickr: split out flickr_auth.py file.
- Add a number of utility functions to webutil.
.. _section-19:
1.0 - 2015-06-27
~~~~~~~~~~~~~~~~
- Initial PyPi release.
Development
-----------
First, fork and clone this repo. Then, you’ll need the `Google Cloud
SDK `__ with the
``gcloud-appengine-python`` and ``gcloud-appengine-python-extras``
`components `__.
Once you have them, set up your environment by running these commands in
the repo root directory:
.. code:: shell
gcloud config set project oauth-dropins
git submodule init
git submodule update
python3 -m venv local
source local/bin/activate
pip install -r requirements.txt
Run the demo app locally `in
dev_appserver.py `__
(`so that static files
work `__)
with:
.. code:: shell
dev_appserver.py --log_level debug --enable_host_checking false \
--support_datastore_emulator --datastore_emulator_port=8089 \
--application=oauth-dropins app.yaml
To deploy to production:
``gcloud -q beta app deploy --no-cache oauth-dropins *.yaml``
The docs are built with `Sphinx `__, including
`apidoc `__,
`autodoc `__, and
`napoleon `__.
Configuration is in
`docs/conf.py `__
To build them, first install Sphinx with ``pip install sphinx``. (You
may want to do this outside your virtualenv; if so, you’ll need to
reconfigure it to see system packages with
``python3 -m venv --system-site-packages local``.) Then, run
`docs/build.sh `__.
Release instructions
--------------------
Here’s how to package, test, and ship a new release. (Note that this is
`largely duplicated in granary’s readme
too `__.)
1. Run the unit tests.
``sh source local/bin/activate.csh gcloud beta emulators datastore start --no-store-on-disk --consistency=1.0 --host-port=localhost:8089 < /dev/null >& /dev/null & sleep 2s DATASTORE_EMULATOR_HOST=localhost:8081 DATASTORE_DATASET=oauth-dropins \ python3 -m unittest discover kill %1 deactivate``
2. Bump the version number in ``setup.py`` and ``docs/conf.py``.
``git grep`` the old version number to make sure it only appears in
the changelog. Change the current changelog entry in ``README.md``
for this new version from *unreleased* to the current date.
3. Build the docs. If you added any new modules, add them to the
appropriate file(s) in ``docs/source/``. Then run
``./docs/build.sh``.
4. ``git commit -am 'release vX.Y'``
5. Upload to `test.pypi.org `__ for testing.
``sh python3 setup.py clean build sdist setenv ver X.Y source local/bin/activate.csh twine upload -r pypitest dist/oauth-dropins-$ver.tar.gz``
6. Install from test.pypi.org.
``sh cd /tmp python3 -m venv local source local/bin/activate.csh pip3 install --upgrade pip # mf2py 1.1.2 on test.pypi.org is broken :( pip3 install mf2py pip3 install -i https://test.pypi.org/simple --extra-index-url https://pypi.org/simple oauth-dropins deactivate``
7. Smoke test that the code trivially loads and runs.
``sh source local/bin/activate.csh python3 # run test code below deactivate``
Test code to paste into the interpreter:
``py from oauth_dropins.webutil import util util.__file__ util.UrlCanonicalizer()('http://asdf.com') # should print 'https://asdf.com/' exit()``
8. Tag the release in git. In the tag message editor, delete the
generated comments at bottom, leave the first line blank (to omit
the release “title” in github), put ``### Notable changes`` on the
second line, then copy and paste this version’s changelog contents
below it.
``sh git tag -a v$ver --cleanup=verbatim git push git push --tags``
9. `Click here to draft a new release on
GitHub. `__
Enter ``vX.Y`` in the *Tag version* box. Leave *Release title*
empty. Copy ``### Notable changes`` and the changelog contents into
the description text box.
10. Upload to `pypi.org `__!
``sh twine upload dist/oauth-dropins-$ver.tar.gz``
Related work
------------
- `Python Social
Auth `__
- `Loginpass `__/`Authlib `__