Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bringing in latest from upstream #30

Merged
merged 21 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1e1b189
Remove py3.7 (#234)
yurushao Jun 9, 2023
6f02f6e
Bump cryptography from 39.0.2 to 41.0.1 (#260)
dependabot[bot] Jun 9, 2023
013c0d1
Bump tox from 3.25.0 to 4.6.0 (#262)
dependabot[bot] Jun 9, 2023
95f5c35
Bump fakeredis from 1.7.5 to 2.14.1 (#263)
dependabot[bot] Jun 9, 2023
147bdf3
Bump flask from 2.1.2 to 2.3.2 (#250)
dependabot[bot] Jun 9, 2023
6fec10e
Bump pytest from 7.1.2 to 7.3.1 (#243)
dependabot[bot] Jun 9, 2023
a34aaf8
Bump redis from 4.5.3 to 4.5.5 (#253)
dependabot[bot] Jun 9, 2023
5725b0d
Bump coverage from 6.4.1 to 7.2.7 (#267)
dependabot[bot] Jun 12, 2023
4c118cf
Bump pytest-cov from 3.0.0 to 4.1.0 (#266)
dependabot[bot] Jun 12, 2023
9d68d6b
Bump actions/checkout from 3 to 4 (#282)
dependabot[bot] Sep 25, 2023
31ae18d
[Snyk] Security upgrade cryptography from 41.0.1 to 41.0.4 (#284)
devinlundberg Sep 25, 2023
f3edccd
Bump tox from 4.6.0 to 4.11.3 (#287)
dependabot[bot] Sep 26, 2023
03bf76f
Bump fakeredis from 2.14.1 to 2.20.0
dependabot[bot] Oct 23, 2023
c4d6074
Merge pull request #292 from pinterest/dependabot/pip/fakeredis-2.20.0
xia0pin9 Oct 23, 2023
1a9824d
Bump redis from 4.5.5 to 5.0.1
dependabot[bot] Oct 23, 2023
6a10fd3
Merge pull request #289 from pinterest/dependabot/pip/redis-5.0.1
xia0pin9 Oct 23, 2023
99028bf
Install deps from requirements.txt (#303)
yurushao Dec 1, 2023
baa921f
Prepare 1.6.1 release (#304)
yurushao Dec 2, 2023
8103cb4
Bump version: 1.6.0 → 1.6.1 (#305)
yurushao Dec 2, 2023
ae27473
Use urllib.parse for quoting/unquoting plus instead of deprecated wer…
vin01 Dec 2, 2023
93fc1d3
Merge branch 'master' of https://github.com/pinterest/snappass into l…
silverl Dec 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .bumpversion.cfg

This file was deleted.

1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
CONTRIBUTING.rst
docker-compose.yml
Dockerfile
requirements.txt
tests.py
tox.ini

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
python-version: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ RUN groupadd -r snappass && \

WORKDIR $APP_DIR

COPY ["setup.py", "MANIFEST.in", "README.rst", "AUTHORS.rst", "$APP_DIR/"]
COPY ["setup.py", "requirements.txt", "MANIFEST.in", "README.rst", "AUTHORS.rst", "$APP_DIR/"]
COPY ["./snappass", "$APP_DIR/snappass"]

RUN python setup.py install && \
chown -R snappass $APP_DIR && \
chgrp -R snappass $APP_DIR
RUN pip install -r requirements.txt

USER snappass

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Requirements
------------

* `Redis`_
* Python 3.7+
* Python 3.8+

.. _Redis: https://redis.io/

Expand Down
6 changes: 4 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
coverage==7.2.7
fakeredis==2.14.1
fakeredis==2.20.0
flake8==6.0.0
freezegun==1.2.1
pytest==7.3.1
pytest-cov==4.1.0
tox==4.6.0
tox==4.11.3
bumpversion==0.6.0
wheel==0.42.0
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cryptography==41.0.1
cryptography==41.0.4
Flask==2.3.2
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.1
redis==4.5.5
redis==5.0.1
Werkzeug==2.3.3
5 changes: 2 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[bumpversion]
current_version = 1.6.0
current_version = 1.6.1
commit = True
tag = True
files = setup.py snappass/__init__.py
files = setup.py

[flake8]
show-source = True
max-line-length = 120

5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='snappass',
version='1.6.0',
version='1.6.1',
description="It's like SnapChat... for Passwords.",
long_description=(open('README.rst').read() + '\n\n' +
open('AUTHORS.rst').read()),
Expand All @@ -18,7 +18,7 @@
],
},
include_package_data=True,
python_requires='>=3.7, <4',
python_requires='>=3.8, <4',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
Expand All @@ -27,7 +27,6 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
Expand Down
10 changes: 5 additions & 5 deletions snappass/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from cryptography.fernet import Fernet
from flask import abort, Flask, render_template, request, jsonify
from redis.exceptions import ConnectionError
from werkzeug.urls import url_quote_plus
from werkzeug.urls import url_unquote_plus
from urllib.parse import quote_plus
from urllib.parse import unquote_plus
from distutils.util import strtobool

NO_SSL = bool(strtobool(os.environ.get('NO_SSL', 'False')))
Expand Down Expand Up @@ -176,7 +176,7 @@ def handle_password():
base_url = request.url_root.replace("http://", "https://")
if URL_PREFIX:
base_url = base_url + URL_PREFIX.strip("/") + "/"
link = base_url + url_quote_plus(token)
link = base_url + quote_plus(token)
if request.accept_mimetypes.accept_json and not request.accept_mimetypes.accept_html:
return jsonify(link=link, ttl=ttl)
else:
Expand All @@ -185,7 +185,7 @@ def handle_password():

@app.route('/<password_key>', methods=['GET'])
def preview_password(password_key):
password_key = url_unquote_plus(password_key)
password_key = unquote_plus(password_key)
if not password_exists(password_key):
return render_template('expired.html'), 404

Expand All @@ -194,7 +194,7 @@ def preview_password(password_key):

@app.route('/<password_key>', methods=['POST'])
def show_password(password_key):
password_key = url_unquote_plus(password_key)
password_key = unquote_plus(password_key)
password = get_password(password_key)
if not password:
return render_template('expired.html'), 404
Expand Down