diff --git a/.github/workflows/ort.yml b/.github/workflows/ort.yml index f77f70ad..0afceabe 100644 --- a/.github/workflows/ort.yml +++ b/.github/workflows/ort.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2014-2021 Agora Voting SL +# SPDX-FileCopyrightText: 2014-2021 Sequent Tech Inc # # SPDX-License-Identifier: AGPL-3.0-only name: ORT licensing diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index ab5c912c..0148f2a4 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -20,9 +20,9 @@ jobs: postgres: image: postgres:12 env: - POSTGRES_USER: authapi - POSTGRES_PASSWORD: authapi - POSTGRES_DB: authapi + POSTGRES_USER: iam + POSTGRES_PASSWORD: iam + POSTGRES_DB: iam options: >- --health-cmd pg_isready --health-interval 10s @@ -73,11 +73,11 @@ jobs: - name: coverage run: | - cd authapi - python manage.py migrate --settings=authapi.test_settings - python manage.py loaddata --settings=authapi.test_settings initial - python manage.py test --settings=authapi.test_settings --failfast --nocapture - python -m coverage run --source='.' manage.py test --settings=authapi.test_settings + cd iam + python manage.py migrate --settings=iam.test_settings + python manage.py loaddata --settings=iam.test_settings initial + python manage.py test --settings=iam.test_settings --failfast --nocapture + python -m coverage run --source='.' manage.py test --settings=iam.test_settings env: POSTGRES_HOST: postgres POSTGRES_PORT: 5432 diff --git a/.ort-data/curations-dir/bsd_license.yml b/.ort-data/curations-dir/bsd_license.yml index c4736a9c..02c02be6 100644 --- a/.ort-data/curations-dir/bsd_license.yml +++ b/.ort-data/curations-dir/bsd_license.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Agora Voting SL +# SPDX-FileCopyrightText: 2021 Sequent Tech Inc # # SPDX-License-Identifier: AGPL-3.0-only --- diff --git a/.ort-data/curations-dir/distlib.yml b/.ort-data/curations-dir/distlib.yml index 03c3097d..e15c3249 100644 --- a/.ort-data/curations-dir/distlib.yml +++ b/.ort-data/curations-dir/distlib.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Agora Voting SL +# SPDX-FileCopyrightText: 2021 Sequent Tech Inc # # SPDX-License-Identifier: AGPL-3.0-only - id: "PyPI::distlib" diff --git a/.ort-data/curations-dir/drangandroptouch.yml b/.ort-data/curations-dir/drangandroptouch.yml index 6bca3333..94b665be 100644 --- a/.ort-data/curations-dir/drangandroptouch.yml +++ b/.ort-data/curations-dir/drangandroptouch.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Agora Voting SL +# SPDX-FileCopyrightText: 2021 Sequent Tech Inc # # SPDX-License-Identifier: AGPL-3.0-only - id: "dragandroptouch" diff --git a/.ort-data/curations-dir/fractionjs.yml b/.ort-data/curations-dir/fractionjs.yml index fffd6015..25464b70 100644 --- a/.ort-data/curations-dir/fractionjs.yml +++ b/.ort-data/curations-dir/fractionjs.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Agora Voting SL +# SPDX-FileCopyrightText: 2021 Sequent Tech Inc # # SPDX-License-Identifier: AGPL-3.0-only - id: "NPM::fraction.js" diff --git a/.ort-data/curations-dir/java.yml b/.ort-data/curations-dir/java.yml index 62ea35ff..ea1bafa4 100644 --- a/.ort-data/curations-dir/java.yml +++ b/.ort-data/curations-dir/java.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Agora Voting SL +# SPDX-FileCopyrightText: 2021 Sequent Tech Inc # # SPDX-License-Identifier: AGPL-3.0-only - id: "Maven:javax.cache:cache-api" diff --git a/.ort-data/curations-dir/jszip.yml b/.ort-data/curations-dir/jszip.yml index 9796e7af..8045c78f 100644 --- a/.ort-data/curations-dir/jszip.yml +++ b/.ort-data/curations-dir/jszip.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Agora Voting SL +# SPDX-FileCopyrightText: 2021 Sequent Tech Inc # # SPDX-License-Identifier: AGPL-3.0-only - id: "NPM::jszip" diff --git a/.ort-data/curations-dir/psycopg2-binary.yml b/.ort-data/curations-dir/psycopg2-binary.yml index 6e751508..d341a101 100644 --- a/.ort-data/curations-dir/psycopg2-binary.yml +++ b/.ort-data/curations-dir/psycopg2-binary.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Agora Voting SL +# SPDX-FileCopyrightText: 2021 Sequent Tech Inc # # SPDX-License-Identifier: AGPL-3.0-only - id: "PyPI::psycopg2-binary" diff --git a/.ort-data/curations-dir/pycryptodomex.yml b/.ort-data/curations-dir/pycryptodomex.yml index ae3ae622..242fe609 100644 --- a/.ort-data/curations-dir/pycryptodomex.yml +++ b/.ort-data/curations-dir/pycryptodomex.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Agora Voting SL +# SPDX-FileCopyrightText: 2021 Sequent Tech Inc # # SPDX-License-Identifier: AGPL-3.0-only - id: "PyPI::pycryptodomex" diff --git a/.ort-data/curations-dir/reportlab.yml b/.ort-data/curations-dir/reportlab.yml index 92ca8fe6..f0d31f28 100644 --- a/.ort-data/curations-dir/reportlab.yml +++ b/.ort-data/curations-dir/reportlab.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Agora Voting SL +# SPDX-FileCopyrightText: 2021 Sequent Tech Inc # # SPDX-License-Identifier: AGPL-3.0-only - id: "PyPI::reportlab" diff --git a/.ort-data/curations-dir/rng-js.yml b/.ort-data/curations-dir/rng-js.yml index 5edc72ba..c2e37924 100644 --- a/.ort-data/curations-dir/rng-js.yml +++ b/.ort-data/curations-dir/rng-js.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Agora Voting SL +# SPDX-FileCopyrightText: 2021 Sequent Tech Inc # # SPDX-License-Identifier: AGPL-3.0-only - id: "NPM::rng-js" diff --git a/.ort-data/curations-dir/agora-gui-booth.yml b/.ort-data/curations-dir/voting-booth.yml similarity index 50% rename from .ort-data/curations-dir/agora-gui-booth.yml rename to .ort-data/curations-dir/voting-booth.yml index e72958a2..1d2429a7 100644 --- a/.ort-data/curations-dir/agora-gui-booth.yml +++ b/.ort-data/curations-dir/voting-booth.yml @@ -1,10 +1,10 @@ -# SPDX-FileCopyrightText: 2021 Agora Voting SL +# SPDX-FileCopyrightText: 2021 Sequent Tech Inc # # SPDX-License-Identifier: AGPL-3.0-only -- id: "Yarn::agora-gui-booth" +- id: "Yarn::voting-booth" curations: comment: "This package needs to be downloaded from git" vcs: type: "git" - url: "https://github.com/agoravoting/agora-gui-common.git" + url: "https://github.com/sequentech/common-ui.git" revision: "4.0.1" diff --git a/.ort-data/disclosure_document.ftl b/.ort-data/disclosure_document.ftl index fc413aea..79b52c6c 100644 --- a/.ort-data/disclosure_document.ftl +++ b/.ort-data/disclosure_document.ftl @@ -1,7 +1,7 @@ [#-- SPDX-FileCopyrightText: 2020 HERE Europe B.V. SPDX-FileCopyrightText: 2020-2021 Bosch.IO GmbH -SPDX-FileCopyrightText: 2021 Agora Voting SL +SPDX-FileCopyrightText: 2021 Sequent Tech Inc SPDX-License-Identifier: AGPL-3.0-only --] diff --git a/.ort-data/license-classifications.yml b/.ort-data/license-classifications.yml index 54e2c7dc..cb1f9afa 100644 --- a/.ort-data/license-classifications.yml +++ b/.ort-data/license-classifications.yml @@ -1,5 +1,5 @@ --- -# SPDX-FileCopyrightText: 2021 Agora Voting SL +# SPDX-FileCopyrightText: 2021 Sequent Tech Inc # SPDX-FileCopyrightText: 2020-2021 Bosch.IO GmbH # # SPDX-License-Identifier: AGPL-3.0-only diff --git a/.ort-data/rules.kts b/.ort-data/rules.kts index cf8008d9..501d3ecc 100644 --- a/.ort-data/rules.kts +++ b/.ort-data/rules.kts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021 Agora Voting SL + * SPDX-FileCopyrightText: 2021 Sequent Tech Inc * SPDX-FileCopyrightText: 2019 HERE Europe B.V. * * SPDX-License-Identifier: AGPL-3.0-only diff --git a/AUTHORS b/AUTHORS index 977d2437..76555ce7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ Víctor Ramirez de la Corte -Eduardo Robles Elvira +Eduardo Robles Elvira Daniel García Moreno -David Ruescas \ No newline at end of file +David Ruescas \ No newline at end of file diff --git a/Development.md b/Development.md index ef2e118e..288d3261 100644 --- a/Development.md +++ b/Development.md @@ -13,9 +13,9 @@ django views and should provide a login method. Add a new auth method is simple. You only need to add a new python module with a class in it. -The module should be inside the authapi/authmethods/ folder and this module +The module should be inside the iam/authmethods/ folder and this module name should starts with an 'm\_', for example if we want to add a DNIe auth -method we can add the module authapi/authmethods/m\_dnie.py. +method we can add the module iam/authmethods/m\_dnie.py. To register the new method you should call the register\_method function, for example: diff --git a/README.md b/README.md index 9f2650ae..de75944a 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,27 @@ -# authapi [![tests_badge]][tests_link] [![coverage_badge]][coverage_link] +# iam [![tests_badge]][tests_link] [![coverage_badge]][coverage_link] -[tests_badge]: https://github.com/agoravoting/authapi/workflows/Test%20python/badge.svg -[tests_link]: https://github.com/agoravoting/authapi/actions?query=workflow%3A%22Test+python%22 -[coverage_badge]: https://coveralls.io/repos/agoravoting/authapi/badge.svg?branch=master -[coverage_link]: https://coveralls.io/r/agoravoting/authapi?branch=master +[tests_badge]: https://github.com/sequentech/iam/workflows/Test%20python/badge.svg +[tests_link]: https://github.com/sequentech/iam/actions?query=workflow%3A%22Test+python%22 +[coverage_badge]: https://coveralls.io/repos/sequentech/iam/badge.svg?branch=master +[coverage_link]: https://coveralls.io/r/sequentech/iam?branch=master # Introduction -The authapi is an isolated server-side component that provides +The iam is an isolated server-side component that provides authentication and authorization primitives. It's is completely decoupled -from agora-core, and it's ignorant of concepts like "election", "vote" or -"agora", even though its primarily developed with Agora voting use-case in +from sequent-core, and it's ignorant of concepts like "election", "vote" or +"sequent", even though its primarily developed with Agora voting use-case in mind. It can be used for other services, completely unrelated to elections. An Authentication Event (or auth-event) is an important concept in the -authapi. Let's explain it with an example: imagine you're creating a single +iam. Let's explain it with an example: imagine you're creating a single election, where you have a given census of electors, and you authenticate the electors sending a SMS code to their mobile phones. In that case, the election -will have an associated event auth in an authapi, configured with a +will have an associated event auth in an iam, configured with a census, configured to use the "SMS-code" authentication method, and the SMS provider credentials details needed to be able to send emails. -Another important entity in authapi is an "User". Each auth-user can be uniquely +Another important entity in iam is an "User". Each auth-user can be uniquely referenced by the user-id. The users have some authorization to act over some objects using ACLs. @@ -41,7 +41,7 @@ kind of object. 1. Download from the git repository if you haven't got a copy ``` - $ git clone https://github.com/agoravoting/authapi && cd authapi + $ git clone https://github.com/sequentech/iam && cd iam ``` 2. Install package and its dependencies @@ -54,9 +54,9 @@ kind of object. 3. Create postgres database: ``` $ sudo su postgres - $ createuser -P authapi - $ psql -tAc "ALTER USER authapi PASSWORD '';" -U postgres - $ createdb -O authapi authapi + $ createuser -P iam + $ psql -tAc "ALTER USER iam PASSWORD '';" -U postgres + $ createdb -O iam iam ``` 4. Create scheme and load initial data. This command create username admin with @@ -86,19 +86,19 @@ Optional. Added some plugin: # Run unit tests -You can run unit tests by having a local `authapi` postgresql database, managed by the user -`authapi` with password `authapi` and then executing the `runtests.sh` script: +You can run unit tests by having a local `iam` postgresql database, managed by the user +`iam` with password `iam` and then executing the `runtests.sh` script: $ sudo su postgres - $ psql -tAc "CREATE USER authapi WITH PASSWORD 'authapi';" -U postgres - $ psql -tAc "ALTER USER authapi CREATEDB;" -U postgres - - $ psql -tAc "CREATE DATABASE authapi OWNER authapi;" -U postgres + $ psql -tAc "CREATE USER iam WITH PASSWORD 'iam';" -U postgres + $ psql -tAc "ALTER USER iam CREATEDB;" -U postgres + - $ psql -tAc "CREATE DATABASE iam OWNER iam;" -U postgres $ exit - (authapi-env) ~/authapi $ ./runtests.sh + (iam-env) ~/iam $ ./runtests.sh # Tecnical details -Technically, authapi should: +Technically, iam should: * allow migrations * implement unit-tests for the API calls @@ -123,8 +123,8 @@ Basic Database tables: * object_id: string (255) object related to which the user is granted permission to id (default=0) mean permission in all id -The authapi is extensible using modules. The mudile can extend authapi in -different entry points defined in authapi, providing: +The iam is extensible using modules. The mudile can extend iam in +different entry points defined in iam, providing: * new authentication methods * new pipeline @@ -378,7 +378,7 @@ Request: { "dni": "11111111H", - "mail": "test@agoravoting.com", + "mail": "test@sequentech.io", "tlf": "+34666666666", "code": "deadbeef" } @@ -403,25 +403,25 @@ Description: Get ids auth-event of request user # Utils Commands -* Look at agora-admin.py script in [agora-tools](https://github.com/agoravoting/agora-tools/) +* Look at sequent-admin.py script in [misc-tools](https://github.com/sequentech/misc-tools/) # License -Copyright (C) 2015 Agora Voting SL and/or its subsidiary(-ies). -Contact: legal@agoravoting.com +Copyright (C) 2015 Sequent Tech Inc and/or its subsidiary(-ies). +Contact: legal@sequentech.io -This file is part of the authapi module of the Agora Voting project. +This file is part of the iam module of the Sequent Tech project. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Commercial License Usage -Licensees holding valid commercial Agora Voting project licenses may use this +Licensees holding valid commercial Sequent Tech project licenses may use this file in accordance with the commercial license agreement provided with the Software or, alternatively, in accordance with the terms contained in -a written agreement between you and Agora Voting SL. For licensing terms and -conditions and further information contact us at legal@agoravoting.com . +a written agreement between you and Sequent Tech Inc. For licensing terms and +conditions and further information contact us at legal@sequentech.io . GNU Affero General Public License Usage Alternatively, this file may be used under the terms of the GNU Affero General diff --git a/authapi/api/__init__.py b/iam/api/__init__.py similarity index 100% rename from authapi/api/__init__.py rename to iam/api/__init__.py diff --git a/authapi/api/admin.py b/iam/api/admin.py similarity index 91% rename from authapi/api/admin.py rename to iam/api/admin.py index 55182f1f..4dde2908 100644 --- a/authapi/api/admin.py +++ b/iam/api/admin.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django import forms from django.contrib import admin diff --git a/authapi/api/decorators.py b/iam/api/decorators.py similarity index 88% rename from authapi/api/decorators.py rename to iam/api/decorators.py index d67572ff..db53b16b 100644 --- a/authapi/api/decorators.py +++ b/iam/api/decorators.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.contrib.auth.models import User from django.http import HttpResponseForbidden diff --git a/authapi/api/fixtures/initial.json b/iam/api/fixtures/initial.json similarity index 98% rename from authapi/api/fixtures/initial.json rename to iam/api/fixtures/initial.json index fc65324d..db400cc3 100644 --- a/authapi/api/fixtures/initial.json +++ b/iam/api/fixtures/initial.json @@ -6,7 +6,7 @@ "username": "admin", "is_staff": true, "is_superuser": true, - "email": "admin@agoravoting.com", + "email": "admin@sequentech.io", "is_active": true, "last_login": "2015-02-16T17:41:28+00:00" }, diff --git a/authapi/api/fixtures/saas.json b/iam/api/fixtures/saas.json similarity index 96% rename from authapi/api/fixtures/saas.json rename to iam/api/fixtures/saas.json index 9b651c0c..46a156ef 100644 --- a/authapi/api/fixtures/saas.json +++ b/iam/api/fixtures/saas.json @@ -30,7 +30,7 @@ "required_on_authentication":false }, { - "name":"Acepto las condiciones de servicio", + "name":"Acepto las condiciones de servicio", "type":"bool", "required":true, "required_on_authentication":false diff --git a/authapi/api/management/__init__.py b/iam/api/management/__init__.py similarity index 100% rename from authapi/api/management/__init__.py rename to iam/api/management/__init__.py diff --git a/authapi/api/management/commands/bulk_delete_voters.py b/iam/api/management/commands/bulk_delete_voters.py similarity index 90% rename from authapi/api/management/commands/bulk_delete_voters.py rename to iam/api/management/commands/bulk_delete_voters.py index 2cc382af..067f8a9e 100644 --- a/authapi/api/management/commands/bulk_delete_voters.py +++ b/iam/api/management/commands/bulk_delete_voters.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2021 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2021 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.core.management.base import BaseCommand, CommandError from django.db import connection @@ -20,7 +20,7 @@ class Command(BaseCommand): ''' - Delete all the voters (manually cascading on related tables) in authapi + Delete all the voters (manually cascading on related tables) in iam for a specific election (event-id) ''' # NOTES: diff --git a/authapi/api/management/commands/bulk_insert_voters.py b/iam/api/management/commands/bulk_insert_voters.py similarity index 97% rename from authapi/api/management/commands/bulk_insert_voters.py rename to iam/api/management/commands/bulk_insert_voters.py index a90a24e9..2b60857f 100644 --- a/authapi/api/management/commands/bulk_insert_voters.py +++ b/iam/api/management/commands/bulk_insert_voters.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2021 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2021 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.core.management.base import BaseCommand from django.db import connection diff --git a/authapi/api/management/commands/send_report.py b/iam/api/management/commands/send_report.py similarity index 97% rename from authapi/api/management/commands/send_report.py rename to iam/api/management/commands/send_report.py index 302b37e8..fac522d7 100644 --- a/authapi/api/management/commands/send_report.py +++ b/iam/api/management/commands/send_report.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . # Install rst2pdf for python3 support with: # pip install git+https://github.com/rst2pdf/rst2pdf.git --ignore-requires-python diff --git a/authapi/api/management/commands/upsert_users.py b/iam/api/management/commands/upsert_users.py similarity index 93% rename from authapi/api/management/commands/upsert_users.py rename to iam/api/management/commands/upsert_users.py index 4a04f5f3..f57b0465 100644 --- a/authapi/api/management/commands/upsert_users.py +++ b/iam/api/management/commands/upsert_users.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2016 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2016 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User diff --git a/authapi/api/migrations/0001_initial.py b/iam/api/migrations/0001_initial.py similarity index 100% rename from authapi/api/migrations/0001_initial.py rename to iam/api/migrations/0001_initial.py diff --git a/authapi/api/migrations/0002_auto_20141128_0827.py b/iam/api/migrations/0002_auto_20141128_0827.py similarity index 100% rename from authapi/api/migrations/0002_auto_20141128_0827.py rename to iam/api/migrations/0002_auto_20141128_0827.py diff --git a/authapi/api/migrations/0003_auto_20141128_0831.py b/iam/api/migrations/0003_auto_20141128_0831.py similarity index 100% rename from authapi/api/migrations/0003_auto_20141128_0831.py rename to iam/api/migrations/0003_auto_20141128_0831.py diff --git a/authapi/api/migrations/0004_auto_20141128_0914.py b/iam/api/migrations/0004_auto_20141128_0914.py similarity index 100% rename from authapi/api/migrations/0004_auto_20141128_0914.py rename to iam/api/migrations/0004_auto_20141128_0914.py diff --git a/authapi/api/migrations/0005_auto_20141208_1114.py b/iam/api/migrations/0005_auto_20141208_1114.py similarity index 100% rename from authapi/api/migrations/0005_auto_20141208_1114.py rename to iam/api/migrations/0005_auto_20141208_1114.py diff --git a/authapi/api/migrations/0006_auto_20141221_1132.py b/iam/api/migrations/0006_auto_20141221_1132.py similarity index 100% rename from authapi/api/migrations/0006_auto_20141221_1132.py rename to iam/api/migrations/0006_auto_20141221_1132.py diff --git a/authapi/api/migrations/0007_auto_20141222_1224.py b/iam/api/migrations/0007_auto_20141222_1224.py similarity index 100% rename from authapi/api/migrations/0007_auto_20141222_1224.py rename to iam/api/migrations/0007_auto_20141222_1224.py diff --git a/authapi/api/migrations/0008_pack.py b/iam/api/migrations/0008_pack.py similarity index 100% rename from authapi/api/migrations/0008_pack.py rename to iam/api/migrations/0008_pack.py diff --git a/authapi/api/migrations/0009_auto_20150114_2141.py b/iam/api/migrations/0009_auto_20150114_2141.py similarity index 100% rename from authapi/api/migrations/0009_auto_20150114_2141.py rename to iam/api/migrations/0009_auto_20150114_2141.py diff --git a/authapi/api/migrations/0010_authevent_census.py b/iam/api/migrations/0010_authevent_census.py similarity index 100% rename from authapi/api/migrations/0010_authevent_census.py rename to iam/api/migrations/0010_authevent_census.py diff --git a/authapi/api/migrations/0011_authevent_status.py b/iam/api/migrations/0011_authevent_status.py similarity index 100% rename from authapi/api/migrations/0011_authevent_status.py rename to iam/api/migrations/0011_authevent_status.py diff --git a/authapi/api/migrations/0012_auto_20150122_1853.py b/iam/api/migrations/0012_auto_20150122_1853.py similarity index 100% rename from authapi/api/migrations/0012_auto_20150122_1853.py rename to iam/api/migrations/0012_auto_20150122_1853.py diff --git a/authapi/api/migrations/0013_auto_20150122_2252.py b/iam/api/migrations/0013_auto_20150122_2252.py similarity index 100% rename from authapi/api/migrations/0013_auto_20150122_2252.py rename to iam/api/migrations/0013_auto_20150122_2252.py diff --git a/authapi/api/migrations/0014_auto_20150124_0901.py b/iam/api/migrations/0014_auto_20150124_0901.py similarity index 100% rename from authapi/api/migrations/0014_auto_20150124_0901.py rename to iam/api/migrations/0014_auto_20150124_0901.py diff --git a/authapi/api/migrations/0015_auto_20150124_0936.py b/iam/api/migrations/0015_auto_20150124_0936.py similarity index 100% rename from authapi/api/migrations/0015_auto_20150124_0936.py rename to iam/api/migrations/0015_auto_20150124_0936.py diff --git a/authapi/api/migrations/0016_userdata_tlf.py b/iam/api/migrations/0016_userdata_tlf.py similarity index 100% rename from authapi/api/migrations/0016_userdata_tlf.py rename to iam/api/migrations/0016_userdata_tlf.py diff --git a/authapi/api/migrations/0017_auto_20150204_1206.py b/iam/api/migrations/0017_auto_20150204_1206.py similarity index 100% rename from authapi/api/migrations/0017_auto_20150204_1206.py rename to iam/api/migrations/0017_auto_20150204_1206.py diff --git a/authapi/api/migrations/0018_auto_20150208_1536.py b/iam/api/migrations/0018_auto_20150208_1536.py similarity index 100% rename from authapi/api/migrations/0018_auto_20150208_1536.py rename to iam/api/migrations/0018_auto_20150208_1536.py diff --git a/authapi/api/migrations/0019_auto_20150210_1821.py b/iam/api/migrations/0019_auto_20150210_1821.py similarity index 100% rename from authapi/api/migrations/0019_auto_20150210_1821.py rename to iam/api/migrations/0019_auto_20150210_1821.py diff --git a/authapi/api/migrations/0020_auto_20150219_1022.py b/iam/api/migrations/0020_auto_20150219_1022.py similarity index 100% rename from authapi/api/migrations/0020_auto_20150219_1022.py rename to iam/api/migrations/0020_auto_20150219_1022.py diff --git a/authapi/api/migrations/0021_acl_created.py b/iam/api/migrations/0021_acl_created.py similarity index 100% rename from authapi/api/migrations/0021_acl_created.py rename to iam/api/migrations/0021_acl_created.py diff --git a/authapi/api/migrations/0022_authevent_created.py b/iam/api/migrations/0022_authevent_created.py similarity index 100% rename from authapi/api/migrations/0022_authevent_created.py rename to iam/api/migrations/0022_authevent_created.py diff --git a/authapi/api/migrations/0023_authevent_registration_authentication_action.py b/iam/api/migrations/0023_authevent_registration_authentication_action.py similarity index 100% rename from authapi/api/migrations/0023_authevent_registration_authentication_action.py rename to iam/api/migrations/0023_authevent_registration_authentication_action.py diff --git a/authapi/api/migrations/0024_auto_20151125_0916.py b/iam/api/migrations/0024_auto_20151125_0916.py similarity index 100% rename from authapi/api/migrations/0024_auto_20151125_0916.py rename to iam/api/migrations/0024_auto_20151125_0916.py diff --git a/authapi/api/migrations/0025_add_userdata_indexes.py b/iam/api/migrations/0025_add_userdata_indexes.py similarity index 79% rename from authapi/api/migrations/0025_add_userdata_indexes.py rename to iam/api/migrations/0025_add_userdata_indexes.py index 8a85e2b3..b33cbe7d 100644 --- a/authapi/api/migrations/0025_add_userdata_indexes.py +++ b/iam/api/migrations/0025_add_userdata_indexes.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from __future__ import unicode_literals diff --git a/authapi/api/migrations/0026_use_core_jsonfield.py b/iam/api/migrations/0026_use_core_jsonfield.py similarity index 74% rename from authapi/api/migrations/0026_use_core_jsonfield.py rename to iam/api/migrations/0026_use_core_jsonfield.py index 82921974..93bf9674 100644 --- a/authapi/api/migrations/0026_use_core_jsonfield.py +++ b/iam/api/migrations/0026_use_core_jsonfield.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from __future__ import unicode_literals diff --git a/authapi/api/migrations/0027_successful_login.py b/iam/api/migrations/0027_successful_login.py similarity index 84% rename from authapi/api/migrations/0027_successful_login.py rename to iam/api/migrations/0027_successful_login.py index 3ab4f4f4..159b53a9 100644 --- a/authapi/api/migrations/0027_successful_login.py +++ b/iam/api/migrations/0027_successful_login.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from __future__ import unicode_literals diff --git a/authapi/api/migrations/0028_admin_fields.py b/iam/api/migrations/0028_admin_fields.py similarity index 75% rename from authapi/api/migrations/0028_admin_fields.py rename to iam/api/migrations/0028_admin_fields.py index 6ae2e942..12e5cd0f 100644 --- a/authapi/api/migrations/0028_admin_fields.py +++ b/iam/api/migrations/0028_admin_fields.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2017 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2017 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from __future__ import unicode_literals diff --git a/authapi/api/migrations/0029_auto_20171104_1356.py b/iam/api/migrations/0029_auto_20171104_1356.py similarity index 100% rename from authapi/api/migrations/0029_auto_20171104_1356.py rename to iam/api/migrations/0029_auto_20171104_1356.py diff --git a/authapi/api/migrations/0030_userdata_draft_election.py b/iam/api/migrations/0030_userdata_draft_election.py similarity index 100% rename from authapi/api/migrations/0030_userdata_draft_election.py rename to iam/api/migrations/0030_userdata_draft_election.py diff --git a/authapi/api/migrations/0031_remove_authevent_real.py b/iam/api/migrations/0031_remove_authevent_real.py similarity index 100% rename from authapi/api/migrations/0031_remove_authevent_real.py rename to iam/api/migrations/0031_remove_authevent_real.py diff --git a/authapi/api/migrations/0032_action.py b/iam/api/migrations/0032_action.py similarity index 100% rename from authapi/api/migrations/0032_action.py rename to iam/api/migrations/0032_action.py diff --git a/authapi/api/migrations/0033_auto_20180214_0910.py b/iam/api/migrations/0033_auto_20180214_0910.py similarity index 100% rename from authapi/api/migrations/0033_auto_20180214_0910.py rename to iam/api/migrations/0033_auto_20180214_0910.py diff --git a/authapi/api/migrations/0034_auto_20180311_1322.py b/iam/api/migrations/0034_auto_20180311_1322.py similarity index 100% rename from authapi/api/migrations/0034_auto_20180311_1322.py rename to iam/api/migrations/0034_auto_20180311_1322.py diff --git a/authapi/api/migrations/0035_auto_20180314_0705.py b/iam/api/migrations/0035_auto_20180314_0705.py similarity index 100% rename from authapi/api/migrations/0035_auto_20180314_0705.py rename to iam/api/migrations/0035_auto_20180314_0705.py diff --git a/authapi/api/migrations/0036_auto_20180314_1220.py b/iam/api/migrations/0036_auto_20180314_1220.py similarity index 100% rename from authapi/api/migrations/0036_auto_20180314_1220.py rename to iam/api/migrations/0036_auto_20180314_1220.py diff --git a/authapi/api/migrations/0037_tallysheet_creator.py b/iam/api/migrations/0037_tallysheet_creator.py similarity index 100% rename from authapi/api/migrations/0037_tallysheet_creator.py rename to iam/api/migrations/0037_tallysheet_creator.py diff --git a/authapi/api/migrations/0038_auto_20180318_1624.py b/iam/api/migrations/0038_auto_20180318_1624.py similarity index 100% rename from authapi/api/migrations/0038_auto_20180318_1624.py rename to iam/api/migrations/0038_auto_20180318_1624.py diff --git a/authapi/api/migrations/0039_auto_20180329_1046.py b/iam/api/migrations/0039_auto_20180329_1046.py similarity index 100% rename from authapi/api/migrations/0039_auto_20180329_1046.py rename to iam/api/migrations/0039_auto_20180329_1046.py diff --git a/authapi/api/migrations/0040_auto_20190129_0957.py b/iam/api/migrations/0040_auto_20190129_0957.py similarity index 100% rename from authapi/api/migrations/0040_auto_20190129_0957.py rename to iam/api/migrations/0040_auto_20190129_0957.py diff --git a/authapi/api/migrations/0041_auto_20200125_1041.py b/iam/api/migrations/0041_auto_20200125_1041.py similarity index 100% rename from authapi/api/migrations/0041_auto_20200125_1041.py rename to iam/api/migrations/0041_auto_20200125_1041.py diff --git a/authapi/api/migrations/0042_hide_default_login_lookup_field.py b/iam/api/migrations/0042_hide_default_login_lookup_field.py similarity index 100% rename from authapi/api/migrations/0042_hide_default_login_lookup_field.py rename to iam/api/migrations/0042_hide_default_login_lookup_field.py diff --git a/authapi/api/migrations/0043_auto_20200303_2253.py b/iam/api/migrations/0043_auto_20200303_2253.py similarity index 100% rename from authapi/api/migrations/0043_auto_20200303_2253.py rename to iam/api/migrations/0043_auto_20200303_2253.py diff --git a/authapi/api/migrations/0044_auto_20200304_1513.py b/iam/api/migrations/0044_auto_20200304_1513.py similarity index 100% rename from authapi/api/migrations/0044_auto_20200304_1513.py rename to iam/api/migrations/0044_auto_20200304_1513.py diff --git a/authapi/api/migrations/0045_successfullogin_auth_event.py b/iam/api/migrations/0045_successfullogin_auth_event.py similarity index 100% rename from authapi/api/migrations/0045_successfullogin_auth_event.py rename to iam/api/migrations/0045_successfullogin_auth_event.py diff --git a/authapi/api/migrations/0046_authevent_tally_status.py b/iam/api/migrations/0046_authevent_tally_status.py similarity index 100% rename from authapi/api/migrations/0046_authevent_tally_status.py rename to iam/api/migrations/0046_authevent_tally_status.py diff --git a/authapi/api/migrations/0047_userdata_use_generated_auth_code.py b/iam/api/migrations/0047_userdata_use_generated_auth_code.py similarity index 100% rename from authapi/api/migrations/0047_userdata_use_generated_auth_code.py rename to iam/api/migrations/0047_userdata_use_generated_auth_code.py diff --git a/authapi/api/migrations/0048_authevent_allowed_statuses.py b/iam/api/migrations/0048_authevent_allowed_statuses.py similarity index 100% rename from authapi/api/migrations/0048_authevent_allowed_statuses.py rename to iam/api/migrations/0048_authevent_allowed_statuses.py diff --git a/authapi/api/migrations/__init__.py b/iam/api/migrations/__init__.py similarity index 100% rename from authapi/api/migrations/__init__.py rename to iam/api/migrations/__init__.py diff --git a/authapi/api/models.py b/iam/api/models.py similarity index 98% rename from authapi/api/models.py rename to iam/api/models.py index d3f2baeb..ea082348 100644 --- a/authapi/api/models.py +++ b/iam/api/models.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import json import itertools @@ -282,7 +282,7 @@ class AuthEvent(models.Model): default=NOT_STARTED ) - # used by authapi_celery to know what tallies to launch, and to serialize + # used by iam_celery to know what tallies to launch, and to serialize # those launches one by one. set/get with (s|g)et_tally_status api calls tally_status = models.CharField( max_length=15, @@ -537,7 +537,7 @@ class UserData(models.Model): like telephone number (in case authentication works via telephone), and metadat, in this model. - In authapi each user is created in relation with a specific authevent. + In iam each user is created in relation with a specific authevent. ''' user = models.OneToOneField(User, models.CASCADE, related_name="userdata") event = models.ForeignKey(AuthEvent, models.CASCADE, related_name="userdata", null=True) @@ -726,7 +726,7 @@ class ACL(models.Model): "user has permission over object_id <1> of object_type ". This allows for a very flexible permission system. The idea is that these - permissions can be used outside authapi through HMAC tokens that contain + permissions can be used outside iam through HMAC tokens that contain authenticated permission information. ''' user = models.ForeignKey(UserData, models.CASCADE, related_name="acls") diff --git a/authapi/api/tasks.py b/iam/api/tasks.py similarity index 81% rename from authapi/api/tasks.py rename to iam/api/tasks.py index a0c79b35..5d83496d 100644 --- a/authapi/api/tasks.py +++ b/iam/api/tasks.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import requests import json @@ -95,11 +95,11 @@ def launch_tally(auth_event): Called by process_tallies() celery task. ''' logger.info('launch_tally(auth_event.id = %d)' % auth_event.id) - if len(settings.AGORA_ELECTIONS_BASE) == 0: - logger.info('launch_tally(auth_event.id = %d): no AGORA_ELECTIONS_BASE, exiting' % auth_event.id) + if len(settings.SEQUENT_ELECTIONS_BASE) == 0: + logger.info('launch_tally(auth_event.id = %d): no SEQUENT_ELECTIONS_BASE, exiting' % auth_event.id) return - callback_base = settings.AGORA_ELECTIONS_BASE[0] + callback_base = settings.SEQUENT_ELECTIONS_BASE[0] callback_url = "%s/api/election/%s/tally-voter-ids" % ( callback_base, auth_event.id @@ -110,7 +110,7 @@ def launch_tally(auth_event): else: parent_auth_event = auth_event.parent - agora_elections_request = requests.post( + ballot_box_request = requests.post( callback_url, json=[], headers={ @@ -121,22 +121,22 @@ def launch_tally(auth_event): 'Content-type': 'application/json' } ) - if agora_elections_request.status_code != 200: + if ballot_box_request.status_code != 200: logger.error( "launch_tally(auth_event.id = %d): post\n" + - "agora_elections.callback_url '%r'\n" + - "agora_elections.status_code '%r'\n" + - "agora_elections.text '%r'\n", + "ballot_box.callback_url '%r'\n" + + "ballot_box.status_code '%r'\n" + + "ballot_box.text '%r'\n", auth_event.id, callback_url, - agora_elections_request.status_code, - agora_elections_request.text + ballot_box_request.status_code, + ballot_box_request.text ) auth_event.tally_status = AuthEvent.STARTED auth_event.save() # log the action - if 'no votes in this election' in agora_elections_request.text: + if 'no votes in this election' in ballot_box_request.text: action_name = 'authevent:tally:error-no-votes' else: action_name = 'authevent:tally:error' @@ -148,8 +148,8 @@ def launch_tally(auth_event): event=parent_auth_event, metadata=dict( auth_event=auth_event.pk, - request_status_code=agora_elections_request.status_code, - request_text=agora_elections_request.text + request_status_code=ballot_box_request.status_code, + request_text=ballot_box_request.text ) ) action.save() @@ -157,13 +157,13 @@ def launch_tally(auth_event): logger.info( "launch_tally(auth_event.id = %d): post\n" + - "agora_elections.callback_url '%r'\n" + - "agora_elections.status_code '%r'\n" + - "agora_elections.text '%r'\n", + "ballot_box.callback_url '%r'\n" + + "ballot_box.status_code '%r'\n" + + "ballot_box.text '%r'\n", auth_event.id, callback_url, - agora_elections_request.status_code, - agora_elections_request.text + ballot_box_request.status_code, + ballot_box_request.text ) auth_event.tally_status = AuthEvent.STARTED auth_event.save() @@ -186,17 +186,17 @@ def launch_virtual_tally(auth_event): Called by process_tallies() celery task. ''' logger.info('launch_virtual_tally(auth_event.id = %d)' % auth_event.id) - if len(settings.AGORA_ELECTIONS_BASE) == 0: - logger.info('launch_virtual_tally(auth_event.id = %d): no AGORA_ELECTIONS_BASE, exiting' % auth_event.id) + if len(settings.SEQUENT_ELECTIONS_BASE) == 0: + logger.info('launch_virtual_tally(auth_event.id = %d): no SEQUENT_ELECTIONS_BASE, exiting' % auth_event.id) return - callback_base = settings.AGORA_ELECTIONS_BASE[0] + callback_base = settings.SEQUENT_ELECTIONS_BASE[0] callback_url = "%s/api/election/%s/virtual-tally" % ( callback_base, auth_event.id ) - agora_elections_request = requests.post( + ballot_box_request = requests.post( callback_url, json=reproducible_json_dumps({}), headers={ @@ -207,16 +207,16 @@ def launch_virtual_tally(auth_event): 'Content-type': 'application/json' } ) - if agora_elections_request.status_code != 200: + if ballot_box_request.status_code != 200: logger.error( "launch_virtual_tally(auth_event.id = %d): post\n" + - "agora_elections.callback_url '%r'\n" + - "agora_elections.status_code '%r'\n" + - "agora_elections.text '%r'\n", + "ballot_box.callback_url '%r'\n" + + "ballot_box.status_code '%r'\n" + + "ballot_box.text '%r'\n", auth_event.id, callback_url, - agora_elections_request.status_code, - agora_elections_request.text + ballot_box_request.status_code, + ballot_box_request.text ) auth_event.tally_status = AuthEvent.NOT_STARTED auth_event.save() @@ -229,8 +229,8 @@ def launch_virtual_tally(auth_event): action_name=action_name, event=auth_event, metadata=dict( - request_status_code=agora_elections_request.status_code, - request_text=agora_elections_request.text + request_status_code=ballot_box_request.status_code, + request_text=ballot_box_request.text ) ) action.save() @@ -238,13 +238,13 @@ def launch_virtual_tally(auth_event): logger.info( "launch_virtual_tally(auth_event.id = %d): post\n" + - "agora_elections.callback_url '%r'\n" + - "agora_elections.status_code '%r'\n" + - "agora_elections.text '%r'\n", + "ballot_box.callback_url '%r'\n" + + "ballot_box.status_code '%r'\n" + + "ballot_box.text '%r'\n", auth_event.id, callback_url, - agora_elections_request.status_code, - agora_elections_request.text + ballot_box_request.status_code, + ballot_box_request.text ) auth_event.tally_status = AuthEvent.SUCCESS auth_event.save() @@ -267,7 +267,7 @@ def launch_virtual_tally(auth_event): def update_tally_status(auth_event): ''' - Receives the status from agora-elections and updates the AuthEvent. + Receives the status from ballot-box and updates the AuthEvent. Called by process_tallies() celery task. ''' logger.info("update_tally_status(auth_event_id=%d)" % auth_event.id) @@ -277,45 +277,45 @@ def update_tally_status(auth_event): else: parent_auth_event = auth_event.parent - if len(settings.AGORA_ELECTIONS_BASE) == 0: - logger.info("update_tally_status(auth_event_id=%d): no AGORA_ELECTIONS_BASE, exiting" % auth_event.id) + if len(settings.SEQUENT_ELECTIONS_BASE) == 0: + logger.info("update_tally_status(auth_event_id=%d): no SEQUENT_ELECTIONS_BASE, exiting" % auth_event.id) return - callback_base = settings.AGORA_ELECTIONS_BASE[0] + callback_base = settings.SEQUENT_ELECTIONS_BASE[0] callback_url = "%s/api/election/%s" % ( callback_base, auth_event.id ) - agora_elections_request = requests.get( + ballot_box_request = requests.get( callback_url, headers={ 'Content-type': 'application/json' } ) - if agora_elections_request.status_code != 200: + if ballot_box_request.status_code != 200: logger.error( "update_tally_status(auth_event_id=%d): post\n" + - "agora_elections.callback_url '%r'\n" + - "agora_elections.status_code '%r'\n" + - "agora_elections.text '%r'\n", + "ballot_box.callback_url '%r'\n" + + "ballot_box.status_code '%r'\n" + + "ballot_box.text '%r'\n", auth_event.id, callback_url, - agora_elections_request.status_code, - agora_elections_request.text + ballot_box_request.status_code, + ballot_box_request.text ) logger.info( "update_tally_status(auth_event_id=%d): post\n" + - "agora_elections.callback_url '%r'\n" + - "agora_elections.status_code '%r'\n" + - "agora_elections.text '%r'\n", + "ballot_box.callback_url '%r'\n" + + "ballot_box.status_code '%r'\n" + + "ballot_box.text '%r'\n", auth_event.id, callback_url, - agora_elections_request.status_code, - agora_elections_request.text + ballot_box_request.status_code, + ballot_box_request.text ) - updated_election = parse_json_request(agora_elections_request) + updated_election = parse_json_request(ballot_box_request) election_state = updated_election['payload']['state'] if election_state in ['tally_error', 'stopped', 'started']: @@ -437,7 +437,7 @@ def update_ballot_boxes_config(auth_event_id): args=[auth_event.parent.parent_id] ) - # A. try to do a call to agora_elections to update the election results + # A. try to do a call to ballot_box to update the election results # A.1 get all the tally sheets for this election, last per ballot box, # including ballot boxes from children auth events subq = TallySheet.objects\ @@ -473,8 +473,8 @@ def update_ballot_boxes_config(auth_event_id): for tally_sheet in tally_sheets ]) - # A.2 call to agora-elections - for callback_base in settings.AGORA_ELECTIONS_BASE: + # A.2 call to ballot-box + for callback_base in settings.SEQUENT_ELECTIONS_BASE: callback_url = "%s/api/election/%s/update-ballot-boxes-config" % ( callback_base, auth_event_id @@ -494,10 +494,10 @@ def update_ballot_boxes_config(auth_event_id): if r.status_code != 200: logger.error( "update_ballot_boxes_config(auth_event_id=%r): post\n"\ - "agora_elections.callback_url '%r'\n"\ - "agora_elections.data '%r'\n"\ - "agora_elections.status_code '%r'\n"\ - "agora_elections.text '%r'\n",\ + "ballot_box.callback_url '%r'\n"\ + "ballot_box.data '%r'\n"\ + "ballot_box.status_code '%r'\n"\ + "ballot_box.text '%r'\n",\ auth_event_id, callback_url, ballot_boxes_config, @@ -508,10 +508,10 @@ def update_ballot_boxes_config(auth_event_id): logger.info( "update_ballot_boxes_config(auth_event_id=%r): post\n"\ - "agora_elections.callback_url '%r'\n"\ - "agora_elections.data '%r'\n"\ - "agora_elections.status_code '%r'\n"\ - "agora_elections.text '%r'\n",\ + "ballot_box.callback_url '%r'\n"\ + "ballot_box.data '%r'\n"\ + "ballot_box.status_code '%r'\n"\ + "ballot_box.text '%r'\n",\ auth_event_id, callback_url, ballot_boxes_config, @@ -546,8 +546,8 @@ def calculate_results_task(user_id, event_id_list): else: parent_auth_event = auth_event.parent - # A.2 call to agora-elections - for callback_base in settings.AGORA_ELECTIONS_BASE: + # A.2 call to ballot-box + for callback_base in settings.SEQUENT_ELECTIONS_BASE: callback_url = "%s/api/election/%s/calculate-results" % ( callback_base, auth_event_id @@ -567,10 +567,10 @@ def calculate_results_task(user_id, event_id_list): if req.status_code != 200: logger.error( "calculate_results_task(user_id=%r, auth_event_id=%r): post\n"\ - "agora_elections.callback_url '%r'\n"\ - "agora_elections.data '%r'\n"\ - "agora_elections.status_code '%r'\n"\ - "agora_elections.text '%r'\n",\ + "ballot_box.callback_url '%r'\n"\ + "ballot_box.data '%r'\n"\ + "ballot_box.status_code '%r'\n"\ + "ballot_box.text '%r'\n",\ user_id, auth_event_id, callback_url, @@ -596,10 +596,10 @@ def calculate_results_task(user_id, event_id_list): logger.info( "calculate_results_task(user_id=%r, auth_event_id=%r): post\n"\ - "agora_elections.callback_url '%r'\n"\ - "agora_elections.data '%r'\n"\ - "agora_elections.status_code '%r'\n"\ - "agora_elections.text '%r'\n",\ + "ballot_box.callback_url '%r'\n"\ + "ballot_box.data '%r'\n"\ + "ballot_box.status_code '%r'\n"\ + "ballot_box.text '%r'\n",\ user_id, auth_event_id, callback_url, @@ -633,7 +633,7 @@ def calculate_results_task(user_id, event_id_list): @shared_task(name='api.tasks.publish_results') def publish_results_task(user_id, auth_event_id, visit_children, parent_auth_event_id=None): ''' - Launches the publish results agora-elections call in a task. + Launches the publish results ballot-box call in a task. If the election has children, also launches the call for those. ''' @@ -659,8 +659,8 @@ def publish_results_task(user_id, auth_event_id, visit_children, parent_auth_eve args=[user_id, child_id, True, parent_auth_event_id] ) - # A.2 call to agora-elections - for callback_base in settings.AGORA_ELECTIONS_BASE: + # A.2 call to ballot-box + for callback_base in settings.SEQUENT_ELECTIONS_BASE: callback_url = "%s/api/election/%s/publish-results" % ( callback_base, auth_event_id @@ -681,10 +681,10 @@ def publish_results_task(user_id, auth_event_id, visit_children, parent_auth_eve if req.status_code != 200: logger.error( "publish_results_task(user_id=%r, auth_event_id=%r, visit_children=%r,parent_auth_event_id=%r): post\n"\ - "agora_elections.callback_url '%r'\n"\ - "agora_elections.data '%r'\n"\ - "agora_elections.status_code '%r'\n"\ - "agora_elections.text '%r'\n",\ + "ballot_box.callback_url '%r'\n"\ + "ballot_box.data '%r'\n"\ + "ballot_box.status_code '%r'\n"\ + "ballot_box.text '%r'\n",\ user_id, auth_event_id, visit_children, @@ -712,10 +712,10 @@ def publish_results_task(user_id, auth_event_id, visit_children, parent_auth_eve logger.info( "publish_results_task(user_id=%r, auth_event_id=%r, visit_children=%r,parent_auth_event_id=%r): post\n"\ - "agora_elections.callback_url '%r'\n"\ - "agora_elections.data '%r'\n"\ - "agora_elections.status_code '%r'\n"\ - "agora_elections.text '%r'\n",\ + "ballot_box.callback_url '%r'\n"\ + "ballot_box.data '%r'\n"\ + "ballot_box.status_code '%r'\n"\ + "ballot_box.text '%r'\n",\ user_id, auth_event_id, visit_children, @@ -741,7 +741,7 @@ def publish_results_task(user_id, auth_event_id, visit_children, parent_auth_eve @shared_task(name='api.tasks.unpublish_results') def unpublish_results_task(user_id, auth_event_id, parent_auth_event_id=None): ''' - Launches the unpublish results agora-elections call in a task. + Launches the unpublish results ballot-box call in a task. If the election has children, also launches the call for those. ''' @@ -767,8 +767,8 @@ def unpublish_results_task(user_id, auth_event_id, parent_auth_event_id=None): args=[user_id, child_id, parent_auth_event] ) - # A.2 call to agora-elections - for callback_base in settings.AGORA_ELECTIONS_BASE: + # A.2 call to ballot-box + for callback_base in settings.SEQUENT_ELECTIONS_BASE: callback_url = "%s/api/election/%s/unpublish-results" % ( callback_base, auth_event_id @@ -789,10 +789,10 @@ def unpublish_results_task(user_id, auth_event_id, parent_auth_event_id=None): if req.status_code != 200: logger.error( "unpublish_results_task(user_id=%r, auth_event_id=%r,parent_auth_event_id=%r): post\n"\ - "agora_elections.callback_url '%r'\n"\ - "agora_elections.data '%r'\n"\ - "agora_elections.status_code '%r'\n"\ - "agora_elections.text '%r'\n",\ + "ballot_box.callback_url '%r'\n"\ + "ballot_box.data '%r'\n"\ + "ballot_box.status_code '%r'\n"\ + "ballot_box.text '%r'\n",\ user_id, auth_event_id, parent_auth_event_id, @@ -819,10 +819,10 @@ def unpublish_results_task(user_id, auth_event_id, parent_auth_event_id=None): logger.info( "publish_results_task(user_id=%r, auth_event_id=%r,parent_auth_event_id=%r): post\n"\ - "agora_elections.callback_url '%r'\n"\ - "agora_elections.data '%r'\n"\ - "agora_elections.status_code '%r'\n"\ - "agora_elections.text '%r'\n",\ + "ballot_box.callback_url '%r'\n"\ + "ballot_box.data '%r'\n"\ + "ballot_box.status_code '%r'\n"\ + "ballot_box.text '%r'\n",\ user_id, auth_event_id, parent_auth_event_id, @@ -847,7 +847,7 @@ def unpublish_results_task(user_id, auth_event_id, parent_auth_event_id=None): @shared_task(name='api.tasks.allow_tally') def allow_tally_task(user_id, auth_event_id, parent_auth_event_id=None): ''' - Launches the allow tally agora-elections call in a task. + Launches the allow tally ballot-box call in a task. If the election has children, also launches the call for those. ''' @@ -876,8 +876,8 @@ def allow_tally_task(user_id, auth_event_id, parent_auth_event_id=None): args=[user_id, child_id, parent_auth_event_id] ) - # A.2 call to agora-elections - for callback_base in settings.AGORA_ELECTIONS_BASE: + # A.2 call to ballot-box + for callback_base in settings.SEQUENT_ELECTIONS_BASE: callback_url = "%s/api/election/%s/allow-tally" % ( callback_base, auth_event_id @@ -898,10 +898,10 @@ def allow_tally_task(user_id, auth_event_id, parent_auth_event_id=None): if req.status_code != 200: logger.error( "allow_tally_task(user_id=%r, auth_event_id=%r): post\n"\ - "agora_elections.callback_url '%r'\n"\ - "agora_elections.data '%r'\n"\ - "agora_elections.status_code '%r'\n"\ - "agora_elections.text '%r'\n",\ + "ballot_box.callback_url '%r'\n"\ + "ballot_box.data '%r'\n"\ + "ballot_box.status_code '%r'\n"\ + "ballot_box.text '%r'\n",\ user_id, auth_event_id, callback_url, @@ -927,10 +927,10 @@ def allow_tally_task(user_id, auth_event_id, parent_auth_event_id=None): logger.info( "allow_tally_task(user_id=%r, auth_event_id=%r): post\n"\ - "agora_elections.callback_url '%r'\n"\ - "agora_elections.data '%r'\n"\ - "agora_elections.status_code '%r'\n"\ - "agora_elections.text '%r'\n",\ + "ballot_box.callback_url '%r'\n"\ + "ballot_box.data '%r'\n"\ + "ballot_box.status_code '%r'\n"\ + "ballot_box.text '%r'\n",\ user_id, auth_event_id, callback_url, diff --git a/authapi/api/test_data.py b/iam/api/test_data.py similarity index 98% rename from authapi/api/test_data.py rename to iam/api/test_data.py index b6e51af7..e5acdc3b 100644 --- a/authapi/api/test_data.py +++ b/iam/api/test_data.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import copy from django.conf import settings @@ -19,7 +19,7 @@ pwd_auth = {'username': 'john', 'password': 'smith'} -pwd_auth_email = {'email': 'john2@agoravoting.com', 'password': 'smith'} +pwd_auth_email = {'email': 'john2@sequentech.io', 'password': 'smith'} auth_event1 = { "auth_method": "sms", @@ -560,7 +560,7 @@ userdata_metadata16 = { "dni": "1234567L", - "company name": "Agora Voting S.L" + "company name": "Sequent Tech S.L" } extra_fields16 = [ @@ -639,7 +639,7 @@ } # Users -admin = {'username': 'john', 'email': 'john@agoravoting.com', 'password': 'smith'} +admin = {'username': 'john', 'email': 'john@sequentech.io', 'password': 'smith'} # Census census_email_default = { diff --git a/authapi/api/tests.py b/iam/api/tests.py similarity index 99% rename from authapi/api/tests.py rename to iam/api/tests.py index 8ac89d16..6af6189d 100644 --- a/authapi/api/tests.py +++ b/iam/api/tests.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import re import time @@ -139,12 +139,12 @@ class TestHmacToken(TestCase): def test_verify_simple_token(self): cases = [ dict( - token="khmac:///sha-256;48a51120ffd034872c4f1fcd3e61f23bade1181309a66c79bcb33e7838423540/example@nvotes.com:AuthEvent:150017:vote:1620927640", + token="khmac:///sha-256;48a51120ffd034872c4f1fcd3e61f23bade1181309a66c79bcb33e7838423540/example@sequentech.io:AuthEvent:150017:vote:1620927640", digest='sha-256', hash='48a51120ffd034872c4f1fcd3e61f23bade1181309a66c79bcb33e7838423540', - msg='example@nvotes.com:AuthEvent:150017:vote:1620927640', + msg='example@sequentech.io:AuthEvent:150017:vote:1620927640', timestamp='1620927640', - userid='example@nvotes.com', + userid='example@sequentech.io', other_values=['AuthEvent', '150017', 'vote'] ) ] @@ -201,7 +201,7 @@ def setUp(self): auth_event_id=self.aeid_special) c.save() - u2 = User(username='noperm', email="noperm@agoravoting.com") + u2 = User(username='noperm', email="noperm@sequentech.io") u2.set_password("qwerty") u2.save() u2.userdata.save() @@ -445,7 +445,7 @@ def test_authenticate(self): self.assertEqual(verifyhmac(settings.SHARED_SECRET, r['auth-token'], seconds=3), False) - data = {'email': 'john@agoravoting.com', 'password': 'fake'} + data = {'email': 'john@sequentech.io', 'password': 'fake'} response = c.authenticate(self.aeid, data) self.assertEqual(response.status_code, 400) @@ -782,7 +782,7 @@ def setUp(self): ) c.save() - u2 = User(username='noperm', email="noperm@agoravoting.com") + u2 = User(username='noperm', email="noperm@sequentech.io") u2.set_password("qwerty") u2.save() u2.userdata.save() @@ -820,7 +820,7 @@ def test_register_authevent_special(self): def test_create_auth_event_without_perm(self): data = test_data.ae_email_default - user = {'email': 'noperm@agoravoting.com', 'password': 'qwerty'} + user = {'email': 'noperm@sequentech.io', 'password': 'qwerty'} c = JClient() response = c.post('/api/auth-event/', data) @@ -1470,14 +1470,14 @@ def test_send_auth_email(self): self.assertEqual(response.status_code, 200) self.assertEqual(MsgLog.objects.count(), 4) msg_log = MsgLog.objects.all().last().msg - self.assertEqual(msg_log.get('subject'), 'Confirm your email - nVotes') - self.assertTrue(msg_log.get('msg').count(' -- nVotes https://nvotes.com')) + self.assertEqual(msg_log.get('subject'), 'Confirm your email - Sequent') + self.assertTrue(msg_log.get('msg').count(' -- Sequent https://sequentech.io')) response = c.post('/api/auth-event/%d/census/send_auth/' % self.aeid, correct_tpl) self.assertEqual(response.status_code, 200) self.assertEqual(MsgLog.objects.count(), 4*2) msg_log = MsgLog.objects.all().last().msg - self.assertEqual(msg_log.get('subject'), correct_tpl.get('subject') + ' - nVotes') + self.assertEqual(msg_log.get('subject'), correct_tpl.get('subject') + ' - Sequent') self.assertTrue(msg_log.get('msg').count('this is an example')) response = c.post('/api/auth-event/%d/census/send_auth/' % self.aeid, incorrect_tpl) @@ -1499,7 +1499,7 @@ def test_send_auth_email_url2_home_url(self): correct_tpl = { "msg" : "Vote in __URL2__ with home page __HOME_URL__", - "subject" : "Vote now with nVotes", + "subject" : "Vote now with Sequent", "user-ids" : None, "auth-method" : "email" } @@ -1510,8 +1510,8 @@ def test_send_auth_email_url2_home_url(self): self.assertEqual(response.status_code, 200) self.assertEqual(MsgLog.objects.count(), 1) msg_log = MsgLog.objects.all().last().msg - self.assertEqual(msg_log.get('subject'), correct_tpl.get('subject') + ' - nVotes') - self.assertEqual(1, msg_log.get('msg').count(' -- nVotes https://nvotes.com')) + self.assertEqual(msg_log.get('subject'), correct_tpl.get('subject') + ' - Sequent') + self.assertEqual(1, msg_log.get('msg').count(' -- Sequent https://sequentech.io')) home_url = settings.HOME_URL.replace("__EVENT_ID__", str(self.aeid)) self.assertEqual(1, msg_log.get('msg').count(home_url)) @@ -1891,7 +1891,7 @@ def test_send_auth_sms(self): self.assertEqual(response.status_code, 200) self.assertEqual(MsgLog.objects.count(), 4) msg_log = MsgLog.objects.all().last().msg - self.assertTrue(msg_log.get('msg').count('-- nVotes')) + self.assertTrue(msg_log.get('msg').count('-- Sequent')) response = c.post('/api/auth-event/%d/census/send_auth/' % self.aeid, correct_tpl) self.assertEqual(response.status_code, 200) @@ -2971,7 +2971,7 @@ def setUp(self): auth_event_id=self.aeid_special) c.save() - u2 = User(username='noperm', email="noperm@agoravoting.com") + u2 = User(username='noperm', email="noperm@sequentech.io") u2.set_password("qwerty") u2.save() u2.userdata.save() @@ -3440,7 +3440,7 @@ def test_census_delete_ok(self): self.assertEqual(r['activity'][0]['executer_username'], 'john') self.assertEqual( r['activity'][0]['executer_email'], - 'john@agoravoting.com' + 'john@sequentech.io' ) self.assertEqual( r['activity'][0]['action_name'], @@ -3536,7 +3536,7 @@ def test_census_delete_voted_ok(self): self.assertEqual(r['activity'][0]['executer_username'], 'john') self.assertEqual( r['activity'][0]['executer_email'], - 'john@agoravoting.com' + 'john@sequentech.io' ) self.assertEqual( r['activity'][0]['action_name'], @@ -3653,7 +3653,7 @@ def test_activation(self): self.assertEqual(len(r['activity']), 3) self.assertEqual(r['activity'][0]['executer_id'], self.uid_admin) self.assertEqual(r['activity'][0]['executer_username'], 'john') - self.assertEqual(r['activity'][0]['executer_email'], 'john@agoravoting.com') + self.assertEqual(r['activity'][0]['executer_email'], 'john@sequentech.io') self.assertEqual(r['activity'][0]['receiver_id'], self.uid) self.assertEqual(r['activity'][0]['receiver_username'], 'test') self.assertEqual(r['activity'][0]['receiver_email'], 'aaaa@aaa.com') @@ -4781,7 +4781,7 @@ def setUp(self): ) self.ae2.save() - u2 = User(username='test1', email="noperm@agoravoting.com") + u2 = User(username='test1', email="noperm@sequentech.io") u2.set_password("qwerty") u2.save() u2.userdata.event = self.ae1 diff --git a/authapi/api/tests_saas_fixture.py b/iam/api/tests_saas_fixture.py similarity index 81% rename from authapi/api/tests_saas_fixture.py rename to iam/api/tests_saas_fixture.py index 05040d59..639872de 100644 --- a/authapi/api/tests_saas_fixture.py +++ b/iam/api/tests_saas_fixture.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import json from django.test import TestCase @@ -37,11 +37,11 @@ def test_register_user(self): captcha = newcaptcha() user = { - 'Email': 'test@agoravoting.com', + 'Email': 'test@sequentech.io', 'tlf': '+34666666667', 'captcha_code': captcha.code, 'Captcha': captcha.challenge, - 'Acepto las condiciones de servicio': True, + 'Acepto las condiciones de servicio': True, } c = JClient() init_users = UserData.objects.count() @@ -57,7 +57,7 @@ def test_register_user(self): def _test_authenticate_user(self): - u = User.objects.create_user('test', 'test@agoravoting.com', 'test') + u = User.objects.create_user('test', 'test@sequentech.io', 'test') u.userdata.event = self.ae u.userdata.tlf = '+34666666667' u.userdata.save() @@ -71,7 +71,7 @@ def _test_authenticate_user(self): code.save() auth = { - 'Email': 'test@agoravoting.com', + 'Email': 'test@sequentech.io', 'tlf': '+34666666667', 'code': code.code, } diff --git a/authapi/api/urls.py b/iam/api/urls.py similarity index 94% rename from authapi/api/urls.py rename to iam/api/urls.py index c4f6e7f9..1bf4d1ee 100644 --- a/authapi/api/urls.py +++ b/iam/api/urls.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.urls import re_path as url, include, path from django.conf import settings diff --git a/authapi/api/views.py b/iam/api/views.py similarity index 98% rename from authapi/api/views.py rename to iam/api/views.py index 6ec7f0a2..f7a08e88 100644 --- a/authapi/api/views.py +++ b/iam/api/views.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . # This file contains all the API views import os @@ -94,7 +94,7 @@ from contracts import CheckException import logging -LOGGER = logging.getLogger('authapi') +LOGGER = logging.getLogger('iam') CONTRACTS = dict( list_of_ints=[ @@ -595,7 +595,7 @@ def serializer(acl): class Authenticate(View): - ''' Authenticate into the authapi ''' + ''' Authenticate into the iam ''' def post(self, request, pk): try: @@ -934,7 +934,7 @@ def get(self, request, pk): class Register(View): - ''' Register into the authapi ''' + ''' Register into the iam ''' def post(self, request, pk): e = get_object_or_404(AuthEvent, pk=pk) @@ -997,7 +997,7 @@ def post(self, request, pk): class ResendAuthCode(View): - ''' Register into the authapi ''' + ''' Register into the iam ''' def post(self, request, pk): auth_event = get_object_or_404(AuthEvent, pk=pk) @@ -1044,7 +1044,7 @@ def post(self, request, pk): class AuthEventStatus(View): ''' - Change the status of auth-event, its children and also calls to agora-elections + Change the status of auth-event, its children and also calls to ballot-box to reflect it. ''' @@ -1124,9 +1124,9 @@ def post(self, request, pk, status): ) action.save() - # update in agora-elections + # update in ballot-box if alt in ['start', 'stop', 'suspend', 'resume']: - for callback_base in settings.AGORA_ELECTIONS_BASE: + for callback_base in settings.SEQUENT_ELECTIONS_BASE: callback_url = "%s/api/election/%s/%s" % ( callback_base, auth_event.id, @@ -1134,7 +1134,7 @@ def post(self, request, pk, status): ) data = "[]" - agora_elections_request = requests.post( + ballot_box_request = requests.post( callback_url, json=data, headers={ @@ -1145,17 +1145,17 @@ def post(self, request, pk, status): 'Content-type': 'application/json' } ) - if agora_elections_request.status_code != 200: + if ballot_box_request.status_code != 200: LOGGER.error(\ "AuthEventStatus.post\n"\ - "agora_elections.callback_url '%r'\n"\ - "agora_elections.data '%r'\n"\ - "agora_elections.status_code '%r'\n"\ - "agora_elections.text '%r'\n",\ + "ballot_box.callback_url '%r'\n"\ + "ballot_box.data '%r'\n"\ + "ballot_box.status_code '%r'\n"\ + "ballot_box.text '%r'\n",\ callback_url, data, - agora_elections_request.status_code, - agora_elections_request.text + ballot_box_request.status_code, + ballot_box_request.text ) return json_response( @@ -1174,14 +1174,14 @@ def post(self, request, pk, status): LOGGER.info(\ "AuthEventStatus.post\n"\ - "agora_elections.callback_url '%r'\n"\ - "agora_elections.data '%r'\n"\ - "agora_elections.status_code '%r'\n"\ - "agora_elections.text '%r'\n",\ + "ballot_box.callback_url '%r'\n"\ + "ballot_box.data '%r'\n"\ + "ballot_box.status_code '%r'\n"\ + "ballot_box.text '%r'\n",\ callback_url, data, - agora_elections_request.status_code, - agora_elections_request.text + ballot_box_request.status_code, + ballot_box_request.text ) return json_response( @@ -2646,7 +2646,7 @@ def post(self, request, pk, ballot_box_pk): error_codename=ErrorCodes.BAD_REQUEST ) - # send update to agora-elections asynchronously + # send update to ballot-box asynchronously update_ballot_boxes_config.apply_async(args=[pk]) # success! @@ -2721,7 +2721,7 @@ def delete(self, request, pk, ballot_box_pk, tally_sheet_pk): action.save() tally_sheet_obj.delete() - # send update to agora-elections asynchronously + # send update to ballot-box asynchronously update_ballot_boxes_config.apply_async(args=[pk]) data = {'status': 'ok'} diff --git a/authapi/auth_settings.py b/iam/auth_settings.py similarity index 61% rename from authapi/auth_settings.py rename to iam/auth_settings.py index da214314..8e47ed72 100644 --- a/authapi/auth_settings.py +++ b/iam/auth_settings.py @@ -1,16 +1,16 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . SHARED_SECRET = b"" TIMEOUT = 3600 # one hour diff --git a/authapi/authmethods/__init__.py b/iam/authmethods/__init__.py similarity index 100% rename from authapi/authmethods/__init__.py rename to iam/authmethods/__init__.py diff --git a/authapi/authmethods/admin.py b/iam/authmethods/admin.py similarity index 61% rename from authapi/authmethods/admin.py rename to iam/authmethods/admin.py index 300ea27f..58637094 100644 --- a/authapi/authmethods/admin.py +++ b/iam/authmethods/admin.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.contrib import admin diff --git a/authapi/authmethods/apps.py b/iam/authmethods/apps.py similarity index 71% rename from authapi/authmethods/apps.py rename to iam/authmethods/apps.py index 9231f0f3..10b2c365 100644 --- a/authapi/authmethods/apps.py +++ b/iam/authmethods/apps.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import os from importlib import import_module diff --git a/authapi/authmethods/m_dnie.py b/iam/authmethods/m_dnie.py similarity index 94% rename from authapi/authmethods/m_dnie.py rename to iam/authmethods/m_dnie.py index 0cc93ea7..bfc11b56 100644 --- a/authapi/authmethods/m_dnie.py +++ b/iam/authmethods/m_dnie.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import json from . import register_method @@ -91,7 +91,7 @@ def dnie_auth(request, authid): #head, path = khmac.split(";")[1] #array = path.split("/") #hash, msg = array[0], array[1] - #baseurl = "https://agora.dev/#" + #baseurl = "https://sequent.dev/#" #url = baseurl + "/%d/vote/%s/%s" % (ae.id, hash, msg) #return redirect(url) diff --git a/authapi/authmethods/m_email.py b/iam/authmethods/m_email.py similarity index 98% rename from authapi/authmethods/m_email.py rename to iam/authmethods/m_email.py index 18518c70..0905fa52 100644 --- a/authapi/authmethods/m_email.py +++ b/iam/authmethods/m_email.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import json import logging @@ -36,7 +36,7 @@ from authmethods.models import Code from utils import stack_trace_str -LOGGER = logging.getLogger('authapi') +LOGGER = logging.getLogger('iam') class Email: DESCRIPTION = 'Register by email. You need to confirm your email.' diff --git a/authapi/authmethods/m_email_otp.py b/iam/authmethods/m_email_otp.py similarity index 98% rename from authapi/authmethods/m_email_otp.py rename to iam/authmethods/m_email_otp.py index 68cdcf53..5377d62e 100644 --- a/authapi/authmethods/m_email_otp.py +++ b/iam/authmethods/m_email_otp.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import json import logging @@ -38,7 +38,7 @@ from utils import stack_trace_str from django.contrib.auth.signals import user_logged_in -LOGGER = logging.getLogger('authapi') +LOGGER = logging.getLogger('iam') class Email: DESCRIPTION = 'Register by email. You need to confirm your email.' diff --git a/authapi/authmethods/m_emailpwd.py b/iam/authmethods/m_emailpwd.py similarity index 95% rename from authapi/authmethods/m_emailpwd.py rename to iam/authmethods/m_emailpwd.py index 0a3ecd9c..bd35b657 100644 --- a/authapi/authmethods/m_emailpwd.py +++ b/iam/authmethods/m_emailpwd.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import json import logging @@ -28,7 +28,7 @@ from django.contrib.auth.signals import user_logged_in -LOGGER = logging.getLogger('authapi') +LOGGER = logging.getLogger('iam') def testview(request, param): diff --git a/authapi/authmethods/m_openidconnect.py b/iam/authmethods/m_openidconnect.py similarity index 95% rename from authapi/authmethods/m_openidconnect.py rename to iam/authmethods/m_openidconnect.py index 4957f55a..00eafe88 100644 --- a/authapi/authmethods/m_openidconnect.py +++ b/iam/authmethods/m_openidconnect.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2018 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2018 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from . import register_method from utils import genhmac, constant_time_compare, json_response, stack_trace_str @@ -37,7 +37,7 @@ from oic.utils.authn.client import CLIENT_AUTHN_METHOD from oic.utils.time_util import utc_time_sans_frac -LOGGER = logging.getLogger('authapi') +LOGGER = logging.getLogger('iam') def testview(request, param): diff --git a/authapi/authmethods/m_pwd.py b/iam/authmethods/m_pwd.py similarity index 96% rename from authapi/authmethods/m_pwd.py rename to iam/authmethods/m_pwd.py index bc4598c2..69607167 100644 --- a/authapi/authmethods/m_pwd.py +++ b/iam/authmethods/m_pwd.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import json import logging @@ -28,7 +28,7 @@ from authmethods.utils import * -LOGGER = logging.getLogger('authapi') +LOGGER = logging.getLogger('iam') def testview(request, param): diff --git a/authapi/authmethods/m_smart_link.py b/iam/authmethods/m_smart_link.py similarity index 97% rename from authapi/authmethods/m_smart_link.py rename to iam/authmethods/m_smart_link.py index abcdc1bb..9d49a2bb 100644 --- a/authapi/authmethods/m_smart_link.py +++ b/iam/authmethods/m_smart_link.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2021 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2021 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import json import logging @@ -32,7 +32,7 @@ -LOGGER = logging.getLogger('authapi') +LOGGER = logging.getLogger('iam') class SmartLink: DESCRIPTION = 'Authenticate using a SmartLink.' diff --git a/authapi/authmethods/m_sms.py b/iam/authmethods/m_sms.py similarity index 98% rename from authapi/authmethods/m_sms.py rename to iam/authmethods/m_sms.py index 4600593f..39d68f25 100644 --- a/authapi/authmethods/m_sms.py +++ b/iam/authmethods/m_sms.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import json import logging @@ -38,7 +38,7 @@ from utils import stack_trace_str from django.contrib.auth.signals import user_logged_in -LOGGER = logging.getLogger('authapi') +LOGGER = logging.getLogger('iam') class Sms: DESCRIPTION = 'Provides authentication using an SMS code.' diff --git a/authapi/authmethods/m_sms_otp.py b/iam/authmethods/m_sms_otp.py similarity index 98% rename from authapi/authmethods/m_sms_otp.py rename to iam/authmethods/m_sms_otp.py index 40d916a9..2490c692 100644 --- a/authapi/authmethods/m_sms_otp.py +++ b/iam/authmethods/m_sms_otp.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import json import logging @@ -35,7 +35,7 @@ from authmethods.utils import * from django.contrib.auth.signals import user_logged_in -LOGGER = logging.getLogger('authapi') +LOGGER = logging.getLogger('iam') class SmsOtp: DESCRIPTION = 'Provides authentication using an SMS code.' diff --git a/authapi/authmethods/migrations/0001_initial.py b/iam/authmethods/migrations/0001_initial.py similarity index 100% rename from authapi/authmethods/migrations/0001_initial.py rename to iam/authmethods/migrations/0001_initial.py diff --git a/authapi/authmethods/migrations/0002_code_connection.py b/iam/authmethods/migrations/0002_code_connection.py similarity index 100% rename from authapi/authmethods/migrations/0002_code_connection.py rename to iam/authmethods/migrations/0002_code_connection.py diff --git a/authapi/authmethods/migrations/0003_auto_20150123_0059.py b/iam/authmethods/migrations/0003_auto_20150123_0059.py similarity index 100% rename from authapi/authmethods/migrations/0003_auto_20150123_0059.py rename to iam/authmethods/migrations/0003_auto_20150123_0059.py diff --git a/authapi/authmethods/migrations/0004_remove_connection_dni.py b/iam/authmethods/migrations/0004_remove_connection_dni.py similarity index 100% rename from authapi/authmethods/migrations/0004_remove_connection_dni.py rename to iam/authmethods/migrations/0004_remove_connection_dni.py diff --git a/authapi/authmethods/migrations/0005_auto_20150124_1907.py b/iam/authmethods/migrations/0005_auto_20150124_1907.py similarity index 100% rename from authapi/authmethods/migrations/0005_auto_20150124_1907.py rename to iam/authmethods/migrations/0005_auto_20150124_1907.py diff --git a/authapi/authmethods/migrations/0006_auto_20150215_2313.py b/iam/authmethods/migrations/0006_auto_20150215_2313.py similarity index 100% rename from authapi/authmethods/migrations/0006_auto_20150215_2313.py rename to iam/authmethods/migrations/0006_auto_20150215_2313.py diff --git a/authapi/authmethods/migrations/0007_msg.py b/iam/authmethods/migrations/0007_msg.py similarity index 100% rename from authapi/authmethods/migrations/0007_msg.py rename to iam/authmethods/migrations/0007_msg.py diff --git a/authapi/authmethods/migrations/0008_auto_20150417_1136.py b/iam/authmethods/migrations/0008_auto_20150417_1136.py similarity index 100% rename from authapi/authmethods/migrations/0008_auto_20150417_1136.py rename to iam/authmethods/migrations/0008_auto_20150417_1136.py diff --git a/authapi/authmethods/migrations/0009_code_is_enabled.py b/iam/authmethods/migrations/0009_code_is_enabled.py similarity index 100% rename from authapi/authmethods/migrations/0009_code_is_enabled.py rename to iam/authmethods/migrations/0009_code_is_enabled.py diff --git a/authapi/authmethods/migrations/__init__.py b/iam/authmethods/migrations/__init__.py similarity index 100% rename from authapi/authmethods/migrations/__init__.py rename to iam/authmethods/migrations/__init__.py diff --git a/authapi/authmethods/models.py b/iam/authmethods/models.py similarity index 86% rename from authapi/authmethods/models.py rename to iam/authmethods/models.py index ab9e273c..14b1d4ed 100644 --- a/authapi/authmethods/models.py +++ b/iam/authmethods/models.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.db import models from jsonfield import JSONField diff --git a/authapi/authmethods/sms_provider.py b/iam/authmethods/sms_provider.py similarity index 97% rename from authapi/authmethods/sms_provider.py rename to iam/authmethods/sms_provider.py index f2767488..787cc954 100644 --- a/authapi/authmethods/sms_provider.py +++ b/iam/authmethods/sms_provider.py @@ -1,19 +1,19 @@ # -*- coding: utf-8 -*- # -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import re import sys @@ -24,7 +24,7 @@ from utils import stack_trace_str from twilio.rest import Client -LOGGER = logging.getLogger('authapi') +LOGGER = logging.getLogger('iam') class SMSProvider(object): ''' diff --git a/authapi/authmethods/tests.py b/iam/authmethods/tests.py similarity index 96% rename from authapi/authmethods/tests.py rename to iam/authmethods/tests.py index 5a23fe1f..95a53e4e 100644 --- a/authapi/authmethods/tests.py +++ b/iam/authmethods/tests.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.conf import settings from django.contrib.auth.models import User @@ -63,7 +63,7 @@ def test_method_custom_view(self): r = json.loads(response.content.decode('utf-8')) self.assertEqual(r['status'], 'ok') - data = { 'email': 'test@agoravoting.com', 'password': 'cxzvcx' } + data = { 'email': 'test@sequentech.io', 'password': 'cxzvcx' } response = c.authenticate(self.aeid, data) self.assertEqual(response.status_code, 400) @@ -93,7 +93,7 @@ def setUp(self): ae.save() self.aeid = ae.pk - u = User(username='test1', email='test1@agoravoting.com') + u = User(username='test1', email='test1@sequentech.io') u.save() u.userdata.event = ae u.userdata.metadata = { @@ -112,7 +112,7 @@ def setUp(self): ) acl.save() - u2 = User(email='test2@agoravoting.com') + u2 = User(email='test2@sequentech.io') u2.is_active = False u2.save() u2.userdata.event = ae @@ -159,7 +159,7 @@ def test_method_email_invalid_code(self): def test_method_email_authenticate_valid_code(self): c = JClient() data = { - 'email': 'test1@agoravoting.com', + 'email': 'test1@sequentech.io', 'code': 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' } response = c.authenticate(self.aeid, data) @@ -172,7 +172,7 @@ def test_method_email_authenticate_valid_code(self): def test_method_email_authenticate_invalid_code(self): c = JClient() data = { - 'email': 'test2@agoravoting.com', + 'email': 'test2@sequentech.io', 'code': 'AAAAAA' } response = c.authenticate(self.aeid, data) @@ -323,7 +323,7 @@ def setUp(self): object_id=ae.pk) acl.save() - u2 = User(email='test2@agoravoting.com') + u2 = User(email='test2@sequentech.io') u2.is_active = False u2.save() u2.userdata.tlf = '+34766666666' @@ -443,7 +443,7 @@ def test_method_sms_authenticate_valid_code(self): def test_method_sms_authenticate_invalid_code(self): data = { - 'email': 'test2@agoravoting.com', + 'email': 'test2@sequentech.io', 'code': 'AAAAAA' } response = self.c.authenticate(self.aeid, data) @@ -492,7 +492,7 @@ def setUp(self): self.aeid = ae.pk # Create admin user for authevent6 - u = User(email='admin6@agoravoting.com') + u = User(email='admin6@sequentech.io') u.save() u.userdata.event = ae u.userdata.save() @@ -540,11 +540,11 @@ def setUp(self): self.aeid = ae.pk # Create user for authevent8 - u = User(username='test1', email='test@agoravoting.com', is_active=True) + u = User(username='test1', email='test@sequentech.io', is_active=True) u.save() u.userdata.event = ae u.userdata.metadata = { - 'email': 'test@agoravoting.com', + 'email': 'test@sequentech.io', 'email_verified': True, 'match_field': 'match_code_555', 'fill_field': '' @@ -571,7 +571,7 @@ def setUp(self): def test_ok_match(self): c = JClient() data = { - 'email': 'test@agoravoting.com', + 'email': 'test@sequentech.io', 'user': 'test1', 'code': 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', 'match_field': 'wrong-code', @@ -581,7 +581,7 @@ def test_ok_match(self): # no pre-registered user matches to the 'match_field' field self.assertEqual(response.status_code, 400) data = { - 'email': 'test@agoravoting.com', + 'email': 'test@sequentech.io', 'user': 'test1', 'code': 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', 'match_field': 'match_code_555', @@ -591,7 +591,7 @@ def test_ok_match(self): response = c.register(self.aeid, data) self.assertEqual(response.status_code, 400) data = { - 'email': 'test@agoravotin.com', + 'email': 'test@sequentvotin.com', 'user': 'test1', 'code': 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', 'match_field': 'match_code_555', @@ -601,7 +601,7 @@ def test_ok_match(self): # the email field doesn't match with any of the pre-registered users self.assertEqual(response.status_code, 400) data = { - 'email': 'test@agoravoting.com', + 'email': 'test@sequentech.io', 'user': 'test1', 'code': 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', 'match_field': 'match_code_555', @@ -648,7 +648,7 @@ def setUp(self): def test_ok_match(self): c = JClient() data = { - 'email': 'test@agoravoting.com', + 'email': 'test@sequentech.io', 'user': 'test1', 'code': 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', 'match_field': 'wrong-code' @@ -666,7 +666,7 @@ def test_ok_match(self): response = c.register(self.aeid, data) self.assertEqual(response.status_code, 400) data = { - 'email': 'test@agoravoting.com', + 'email': 'test@sequentech.io', 'user': 'test1', 'code': 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', 'match_field': 'match_code_555' @@ -688,7 +688,7 @@ def setUp(self): self.aeid = ae.pk # Create user for authevent10 - u = User(username='test1', email='test@agoravoting.com', is_active=True) + u = User(username='test1', email='test@sequentech.io', is_active=True) u.save() u.userdata.event = ae u.userdata.tlf = '+34666666666' @@ -763,7 +763,7 @@ def setUp(self): self.aeid = ae.pk # Create user for authevent11 - u = User(username='test1', email='test@agoravoting.com', is_active=True) + u = User(username='test1', email='test@sequentech.io', is_active=True) u.save() u.userdata.event = ae u.userdata.tlf = None @@ -883,7 +883,7 @@ def setUp(self): # Create user for authevent11 normal_user = User( username='test1', - email='test@agoravoting.com', + email='test@sequentech.io', is_active=True ) normal_user.save() diff --git a/authapi/authmethods/utils.py b/iam/authmethods/utils.py similarity index 99% rename from authapi/authmethods/utils.py rename to iam/authmethods/utils.py index 0f82de65..ff194398 100644 --- a/authapi/authmethods/utils.py +++ b/iam/authmethods/utils.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import hashlib import json @@ -45,7 +45,7 @@ ) from pipelines.base import execute_pipeline, PipeReturnvalue -LOGGER = logging.getLogger('authapi') +LOGGER = logging.getLogger('iam') EMAIL_RX = re.compile( r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*" # dot-atom diff --git a/authapi/authmethods/views.py b/iam/authmethods/views.py similarity index 79% rename from authapi/authmethods/views.py rename to iam/authmethods/views.py index 0c30aa93..91264ed8 100644 --- a/authapi/authmethods/views.py +++ b/iam/authmethods/views.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from . import METHODS from django.http import HttpResponseNotFound diff --git a/authapi/captcha/__init__.py b/iam/captcha/__init__.py similarity index 100% rename from authapi/captcha/__init__.py rename to iam/captcha/__init__.py diff --git a/authapi/captcha/admin.py b/iam/captcha/admin.py similarity index 65% rename from authapi/captcha/admin.py rename to iam/captcha/admin.py index 8a38d124..7f7b98c7 100644 --- a/authapi/captcha/admin.py +++ b/iam/captcha/admin.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.contrib import admin from .models import Captcha diff --git a/authapi/captcha/decorators.py b/iam/captcha/decorators.py similarity index 84% rename from authapi/captcha/decorators.py rename to iam/captcha/decorators.py index 2420290b..fe0cabdb 100644 --- a/authapi/captcha/decorators.py +++ b/iam/captcha/decorators.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.http import HttpResponseForbidden from django.core.exceptions import ObjectDoesNotExist diff --git a/authapi/captcha/fonts/LICENSE b/iam/captcha/fonts/LICENSE similarity index 100% rename from authapi/captcha/fonts/LICENSE rename to iam/captcha/fonts/LICENSE diff --git a/authapi/captcha/fonts/README b/iam/captcha/fonts/README similarity index 100% rename from authapi/captcha/fonts/README rename to iam/captcha/fonts/README diff --git a/authapi/captcha/fonts/Vera.ttf b/iam/captcha/fonts/Vera.ttf similarity index 100% rename from authapi/captcha/fonts/Vera.ttf rename to iam/captcha/fonts/Vera.ttf diff --git a/authapi/captcha/migrations/0001_initial.py b/iam/captcha/migrations/0001_initial.py similarity index 100% rename from authapi/captcha/migrations/0001_initial.py rename to iam/captcha/migrations/0001_initial.py diff --git a/authapi/captcha/migrations/0002_captcha_challenge.py b/iam/captcha/migrations/0002_captcha_challenge.py similarity index 100% rename from authapi/captcha/migrations/0002_captcha_challenge.py rename to iam/captcha/migrations/0002_captcha_challenge.py diff --git a/authapi/captcha/migrations/0003_captcha_created.py b/iam/captcha/migrations/0003_captcha_created.py similarity index 100% rename from authapi/captcha/migrations/0003_captcha_created.py rename to iam/captcha/migrations/0003_captcha_created.py diff --git a/authapi/captcha/migrations/0004_captcha_used.py b/iam/captcha/migrations/0004_captcha_used.py similarity index 100% rename from authapi/captcha/migrations/0004_captcha_used.py rename to iam/captcha/migrations/0004_captcha_used.py diff --git a/authapi/captcha/migrations/__init__.py b/iam/captcha/migrations/__init__.py similarity index 100% rename from authapi/captcha/migrations/__init__.py rename to iam/captcha/migrations/__init__.py diff --git a/authapi/captcha/models.py b/iam/captcha/models.py similarity index 77% rename from authapi/captcha/models.py rename to iam/captcha/models.py index 1f896fc8..2d12f093 100644 --- a/authapi/captcha/models.py +++ b/iam/captcha/models.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import os from django.db import models diff --git a/authapi/captcha/tests.py b/iam/captcha/tests.py similarity index 96% rename from authapi/captcha/tests.py rename to iam/captcha/tests.py index 79832ea2..ed40a18c 100644 --- a/authapi/captcha/tests.py +++ b/iam/captcha/tests.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import json import os diff --git a/authapi/captcha/urls.py b/iam/captcha/urls.py similarity index 66% rename from authapi/captcha/urls.py rename to iam/captcha/urls.py index 86322c6c..b00e2c22 100644 --- a/authapi/captcha/urls.py +++ b/iam/captcha/urls.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.conf.urls import url from .decorators import captcha_required diff --git a/authapi/captcha/views.py b/iam/captcha/views.py similarity index 94% rename from authapi/captcha/views.py rename to iam/captcha/views.py index 01315d1a..ab27a238 100644 --- a/authapi/captcha/views.py +++ b/iam/captcha/views.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import os import json diff --git a/authapi/contracts/__init__.py b/iam/contracts/__init__.py similarity index 100% rename from authapi/contracts/__init__.py rename to iam/contracts/__init__.py diff --git a/authapi/contracts/base.py b/iam/contracts/base.py similarity index 96% rename from authapi/contracts/base.py rename to iam/contracts/base.py index d75ae051..7640e88d 100644 --- a/authapi/contracts/base.py +++ b/iam/contracts/base.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from collections import defaultdict from contracts import CheckException diff --git a/authapi/authapi/__init__.py b/iam/iam/__init__.py similarity index 100% rename from authapi/authapi/__init__.py rename to iam/iam/__init__.py diff --git a/authapi/authapi/celery.py b/iam/iam/celery.py similarity index 91% rename from authapi/authapi/celery.py rename to iam/iam/celery.py index ae02b8f1..d1ae84b1 100644 --- a/authapi/authapi/celery.py +++ b/iam/iam/celery.py @@ -27,9 +27,9 @@ def reset_tallies_task(sender=None, conf=None, **kwargs): .update(tally_status=AuthEvent.NOT_STARTED) # set the default Django settings module for the 'celery' program. -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'authapi.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'iam.settings') -app = Celery('authapi') +app = Celery('iam') app.config_from_object(settings.CELERY_CONFIG) diff --git a/authapi/authapi/settings.py b/iam/iam/settings.py similarity index 83% rename from authapi/authapi/settings.py rename to iam/iam/settings.py index 513a7918..9c3adc59 100644 --- a/authapi/authapi/settings.py +++ b/iam/iam/settings.py @@ -1,20 +1,20 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . """ -Django settings for authapi project. +Django settings for iam project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ @@ -75,8 +75,8 @@ class CeleryConfig: ALLOW_DEREGISTER = True # If this option is true, when an user tries to register and the user is -# already registered, authapi will return an error with the 'user_exists' -# codename. Otherwise, on error, authapi will always return the same generic +# already registered, iam will return an error with the 'user_exists' +# codename. Otherwise, on error, iam will always return the same generic # error with 'invalid_credentials' codename. SHOW_ALREADY_REGISTERED = False @@ -122,7 +122,7 @@ class CeleryConfig: # make use of celery work when ./manage.py test is executed TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' -ROOT_URLCONF = 'authapi.urls' +ROOT_URLCONF = 'iam.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', @@ -139,7 +139,7 @@ class CeleryConfig: }, ] -WSGI_APPLICATION = 'authapi.wsgi.application' +WSGI_APPLICATION = 'iam.wsgi.application' # Database @@ -196,19 +196,19 @@ class CeleryConfig: "email-otp": 10000 } -SMS_BASE_TEMPLATE = "__MESSAGE__ -- nVotes" +SMS_BASE_TEMPLATE = "__MESSAGE__ -- Sequent" -EMAIL_BASE_TEMPLATE = "__MESSAGE__\n\n -- nVotes https://nvotes.com" +EMAIL_BASE_TEMPLATE = "__MESSAGE__\n\n -- Sequent https://sequentech.io" -EMAIL_BASE_TITLE_TEMPLATE = "__TITLE__ - nVotes" +EMAIL_BASE_TITLE_TEMPLATE = "__TITLE__ - Sequent" -HOME_URL = "https://agoravoting.example.com/#/election¡/__EVENT_ID__/public/home" -SMS_AUTH_CODE_URL = "https://agoravoting.example.com/#/election/__EVENT_ID__/public/login/__RECEIVER__" -EMAIL_AUTH_CODE_URL = "https://agoravoting.example.com/#/election/__EVENT_ID__/public/login/__RECEIVER__" +HOME_URL = "https://sequent.example.com/#/election¡/__EVENT_ID__/public/home" +SMS_AUTH_CODE_URL = "https://sequent.example.com/#/election/__EVENT_ID__/public/login/__RECEIVER__" +EMAIL_AUTH_CODE_URL = "https://sequent.example.com/#/election/__EVENT_ID__/public/login/__RECEIVER__" -AGORA_ELECTIONS_BASE = ["http://127.0.0.1:14443"] +SEQUENT_ELECTIONS_BASE = ["http://127.0.0.1:14443"] -SIMULATE_AGORA_ELECTIONS_CALLBACKS = False +SIMULATE_SEQUENT_ELECTIONS_CALLBACKS = False SIZE_CODE = 8 MAX_GLOBAL_STR = 512 @@ -246,10 +246,10 @@ class CeleryConfig: TASK_PROCESS_UPDATE_DEBOUNCE_SECS = 2.0 # This is the command to be executed to launch a self-test -TASK_SELF_TEST_COMMAND = ["/home/agoragui/launch_selftest.sh"] +TASK_SELF_TEST_COMMAND = ["/home/ui_user/launch_selftest.sh"] # This is the command to be executed to kill a self-test -TASK_SELF_TEST_KILL_COMMAND = ["sudo", "/home/agoragui/kill_selftest.sh"] +TASK_SELF_TEST_KILL_COMMAND = ["sudo", "/home/ui_user/kill_selftest.sh"] # Default maximum amount of time in seconds that a task should last. After this, # amount of time, the task is killed diff --git a/authapi/authapi/test_settings.py b/iam/iam/test_settings.py similarity index 82% rename from authapi/authapi/test_settings.py rename to iam/iam/test_settings.py index e21865d9..dacbc52c 100644 --- a/authapi/authapi/test_settings.py +++ b/iam/iam/test_settings.py @@ -1,20 +1,20 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . """ -Django settings for authapi project. +Django settings for iam project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see @@ -89,8 +89,8 @@ class CeleryConfig: ALLOW_ADMIN_AUTH_REGISTRATION = False # If this option is true, when an user tries to register and the user is -# already registered, authapi will return an error with the 'user_exists' -# codename. Otherwise, on error, authapi will always return the same generic +# already registered, iam will return an error with the 'user_exists' +# codename. Otherwise, on error, iam will always return the same generic # error with 'invalid_credentials' codename. SHOW_ALREADY_REGISTERED = False @@ -136,7 +136,7 @@ class CeleryConfig: # make use of celery work when ./manage.py test is executed TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' -ROOT_URLCONF = 'authapi.urls' +ROOT_URLCONF = 'iam.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', @@ -153,7 +153,7 @@ class CeleryConfig: }, ] -WSGI_APPLICATION = 'authapi.wsgi.application' +WSGI_APPLICATION = 'iam.wsgi.application' # Database @@ -162,9 +162,9 @@ class CeleryConfig: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', - 'NAME': os.environ.get('POSTGRES_NAME', 'authapi'), - 'USER': os.environ.get('POSTGRES_USER', 'authapi'), - 'PASSWORD': os.environ.get('POSTGRES_PASSWORD', 'authapi'), + 'NAME': os.environ.get('POSTGRES_NAME', 'iam'), + 'USER': os.environ.get('POSTGRES_USER', 'iam'), + 'PASSWORD': os.environ.get('POSTGRES_PASSWORD', 'iam'), 'HOST': os.environ.get('POSTGRES_HOST', 'localhost'), 'PORT': os.environ.get('POSTGRES_PORT', '5432'), } @@ -205,10 +205,10 @@ class CeleryConfig: TASK_PROCESS_UPDATE_DEBOUNCE_SECS = 2.0 # This is the command to be executed to launch a self-test -TASK_SELF_TEST_COMMAND = ["/home/authapi/launch_selftest.sh"] +TASK_SELF_TEST_COMMAND = ["/home/iam/launch_selftest.sh"] # This is the command to be executed to kill a self-test -TASK_SELF_TEST_KILL_COMMAND = ["sudo", "/home/agoragui/kill_selftest.sh"] +TASK_SELF_TEST_KILL_COMMAND = ["sudo", "/home/ui_user/kill_selftest.sh"] # Default maximum amount of time in seconds that a task should last. After this, # amount of time, the task is killed @@ -235,17 +235,17 @@ class CeleryConfig: EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' -SMS_BASE_TEMPLATE = "__MESSAGE__ -- nVotes" +SMS_BASE_TEMPLATE = "__MESSAGE__ -- Sequent" -EMAIL_BASE_TEMPLATE = "__MESSAGE__\n\n -- nVotes https://nvotes.com" +EMAIL_BASE_TEMPLATE = "__MESSAGE__\n\n -- Sequent https://sequentech.io" -EMAIL_BASE_TITLE_TEMPLATE = "__TITLE__ - nVotes" +EMAIL_BASE_TITLE_TEMPLATE = "__TITLE__ - Sequent" -HOME_URL = "https://agoravoting.example.com/#/election/__EVENT_ID__/public/home" -SMS_AUTH_CODE_URL = "https://agoravoting.example.com/#/election/__EVENT_ID__/public/login/__RECEIVER__" -EMAIL_AUTH_CODE_URL = "https://agoravoting.example.com/#/election/__EVENT_ID__/public/login/__RECEIVER__" +HOME_URL = "https://sequent.example.com/#/election/__EVENT_ID__/public/home" +SMS_AUTH_CODE_URL = "https://sequent.example.com/#/election/__EVENT_ID__/public/login/__RECEIVER__" +EMAIL_AUTH_CODE_URL = "https://sequent.example.com/#/election/__EVENT_ID__/public/login/__RECEIVER__" -AGORA_ELECTIONS_BASE = [] +SEQUENT_ELECTIONS_BASE = [] SIZE_CODE = 8 MAX_GLOBAL_STR = 512 diff --git a/authapi/authapi/urls.py b/iam/iam/urls.py similarity index 69% rename from authapi/authapi/urls.py rename to iam/iam/urls.py index 759b273f..8be3938f 100644 --- a/authapi/authapi/urls.py +++ b/iam/iam/urls.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.urls import path, include from django.contrib import admin diff --git a/authapi/authapi/wsgi.py b/iam/iam/wsgi.py similarity index 63% rename from authapi/authapi/wsgi.py rename to iam/iam/wsgi.py index 610c4a78..0be05730 100644 --- a/authapi/authapi/wsgi.py +++ b/iam/iam/wsgi.py @@ -1,20 +1,20 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . """ -WSGI config for authapi project. +WSGI config for iam project. It exposes the WSGI callable as a module-level variable named ``application``. @@ -23,7 +23,7 @@ """ import os -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "authapi.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "iam.settings") from django.core.wsgi import get_wsgi_application application = get_wsgi_application() diff --git a/authapi/manage.py b/iam/manage.py similarity index 61% rename from authapi/manage.py rename to iam/manage.py index 64f63668..eb28970c 100755 --- a/authapi/manage.py +++ b/iam/manage.py @@ -1,25 +1,25 @@ #!/usr/bin/env python -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import os import sys if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "authapi.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "iam.settings") from django.core.management import execute_from_command_line diff --git a/authapi/pipelines/__init__.py b/iam/pipelines/__init__.py similarity index 100% rename from authapi/pipelines/__init__.py rename to iam/pipelines/__init__.py diff --git a/authapi/pipelines/argfuncs.py b/iam/pipelines/argfuncs.py similarity index 74% rename from authapi/pipelines/argfuncs.py rename to iam/pipelines/argfuncs.py index 46c82f5f..440bb62a 100644 --- a/authapi/pipelines/argfuncs.py +++ b/iam/pipelines/argfuncs.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import string from authmethods.utils import dni_constraint diff --git a/authapi/pipelines/base.py b/iam/pipelines/base.py similarity index 93% rename from authapi/pipelines/base.py rename to iam/pipelines/base.py index cfecb640..8aa117a9 100644 --- a/authapi/pipelines/base.py +++ b/iam/pipelines/base.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import functools from collections import defaultdict diff --git a/authapi/pipelines/external_soap.py b/iam/pipelines/external_soap.py similarity index 81% rename from authapi/pipelines/external_soap.py rename to iam/pipelines/external_soap.py index 5815b80b..2c958f24 100644 --- a/authapi/pipelines/external_soap.py +++ b/iam/pipelines/external_soap.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from suds.client import Client from xml.dom.minidom import parseString diff --git a/authapi/pipelines/field_authenticate.py b/iam/pipelines/field_authenticate.py similarity index 65% rename from authapi/pipelines/field_authenticate.py rename to iam/pipelines/field_authenticate.py index d042e5a1..5eb2fb34 100644 --- a/authapi/pipelines/field_authenticate.py +++ b/iam/pipelines/field_authenticate.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from pipelines.base import Pipe from pipelines.field_register import CanonizeDni diff --git a/authapi/pipelines/field_register.py b/iam/pipelines/field_register.py similarity index 94% rename from authapi/pipelines/field_register.py rename to iam/pipelines/field_register.py index f73f9363..7a520c39 100644 --- a/authapi/pipelines/field_register.py +++ b/iam/pipelines/field_register.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from contracts import CheckException from pipelines import PipeReturnvalue diff --git a/authapi/plugins.py b/iam/plugins.py similarity index 74% rename from authapi/plugins.py rename to iam/plugins.py index 1bd2f169..c1995fbf 100644 --- a/authapi/plugins.py +++ b/iam/plugins.py @@ -1,24 +1,24 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.conf import settings def call(func, *args): ''' - Method to implement extension points in the code of authapi. It will + Method to implement extension points in the code of iam. It will call the corresponding function by name (func) with the given args in each plugin. diff --git a/authapi/static/captcha/file b/iam/static/captcha/file similarity index 100% rename from authapi/static/captcha/file rename to iam/static/captcha/file diff --git a/authapi/tasks/migrations/__init__.py b/iam/tasks/__init__.py similarity index 67% rename from authapi/tasks/migrations/__init__.py rename to iam/tasks/__init__.py index d0a2c8fb..3de52995 100644 --- a/authapi/tasks/migrations/__init__.py +++ b/iam/tasks/__init__.py @@ -1,14 +1,14 @@ -# This file is part of authapi. +# This file is part of iam. # Copyright (C) 2022 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . diff --git a/authapi/tasks/migrations/0001_initial.py b/iam/tasks/migrations/0001_initial.py similarity index 92% rename from authapi/tasks/migrations/0001_initial.py rename to iam/tasks/migrations/0001_initial.py index 24a10bf3..e0e7e1ac 100644 --- a/authapi/tasks/migrations/0001_initial.py +++ b/iam/tasks/migrations/0001_initial.py @@ -1,17 +1,17 @@ -# This file is part of authapi. +# This file is part of iam. # Copyright (C) 2022 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . # Generated by Django 2.2.25 on 2022-01-16 11:17 diff --git a/authapi/tasks/__init__.py b/iam/tasks/migrations/__init__.py similarity index 67% rename from authapi/tasks/__init__.py rename to iam/tasks/migrations/__init__.py index d0a2c8fb..3de52995 100644 --- a/authapi/tasks/__init__.py +++ b/iam/tasks/migrations/__init__.py @@ -1,14 +1,14 @@ -# This file is part of authapi. +# This file is part of iam. # Copyright (C) 2022 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . diff --git a/authapi/tasks/models.py b/iam/tasks/models.py similarity index 97% rename from authapi/tasks/models.py rename to iam/tasks/models.py index c284d9eb..2a2a2912 100644 --- a/authapi/tasks/models.py +++ b/iam/tasks/models.py @@ -1,17 +1,17 @@ -# This file is part of authapi. +# This file is part of iam. # Copyright (C) 2022 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from select import select import sys diff --git a/authapi/tasks/tasks.py b/iam/tasks/tasks.py similarity index 87% rename from authapi/tasks/tasks.py rename to iam/tasks/tasks.py index f96b4580..03145894 100644 --- a/authapi/tasks/tasks.py +++ b/iam/tasks/tasks.py @@ -1,17 +1,17 @@ -# This file is part of authapi. +# This file is part of iam. # Copyright (C) 2022 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.conf import settings from celery import shared_task diff --git a/authapi/tasks/tests.py b/iam/tasks/tests.py similarity index 98% rename from authapi/tasks/tests.py rename to iam/tasks/tests.py index c18dd895..dbce8b6c 100644 --- a/authapi/tasks/tests.py +++ b/iam/tasks/tests.py @@ -1,17 +1,17 @@ -# This file is part of authapi. +# This file is part of iam. # Copyright (C) 2022 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import os import tempfile diff --git a/authapi/tasks/urls.py b/iam/tasks/urls.py similarity index 78% rename from authapi/tasks/urls.py rename to iam/tasks/urls.py index 43da4e4c..0d8f31df 100644 --- a/authapi/tasks/urls.py +++ b/iam/tasks/urls.py @@ -1,17 +1,17 @@ -# This file is part of authapi. +# This file is part of iam. # Copyright (C) 2022 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.conf.urls import url from tasks import views diff --git a/authapi/tasks/views.py b/iam/tasks/views.py similarity index 93% rename from authapi/tasks/views.py rename to iam/tasks/views.py index 3e182720..b275c739 100644 --- a/authapi/tasks/views.py +++ b/iam/tasks/views.py @@ -1,17 +1,17 @@ -# This file is part of authapi. +# This file is part of iam. # Copyright (C) 2022 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from django.conf import settings from django.db.models import Q @@ -24,7 +24,7 @@ from utils import paginate, json_response from tasks.tasks import self_test_task -LOGGER = logging.getLogger('authapi') +LOGGER = logging.getLogger('iam') class TaskView(View): diff --git a/authapi/utils.py b/iam/utils.py similarity index 98% rename from authapi/utils.py rename to iam/utils.py index f62da0a8..8cca7c01 100644 --- a/authapi/utils.py +++ b/iam/utils.py @@ -1,19 +1,19 @@ #!/usr/bin/env python3 -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . import hmac import datetime @@ -51,7 +51,7 @@ RE_SPLIT_SORT = re.compile('__sort') RE_INT = re.compile('^\d+$') RE_BOOL = re.compile('^(true|false)$') -LOGGER = getLogger('authapi.notify') +LOGGER = getLogger('iam.notify') def stack_trace_str(): @@ -479,7 +479,7 @@ def send_code(user, ip, config=None, auth_method_override=None, code=None, save_ if receiver is None: return "Receiver is none" - # base_msg is the base template, allows the authapi superadmin to configure + # base_msg is the base template, allows the iam superadmin to configure # a prefix or suffix to all messages if auth_method in ["sms", "sms-otp"]: base_msg = settings.SMS_BASE_TEMPLATE diff --git a/authapi/wrap.py b/iam/wrap.py similarity index 78% rename from authapi/wrap.py rename to iam/wrap.py index f083e4df..d392b3d3 100644 --- a/authapi/wrap.py +++ b/iam/wrap.py @@ -1,17 +1,17 @@ -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . from time import time from logging import getLogger @@ -19,7 +19,7 @@ class LoggingMiddleware(object): def __init__(self, get_response): - self.logger = getLogger('authapi.request') + self.logger = getLogger('iam.request') self.get_response = get_response def __call__(self, request): diff --git a/runtests.sh b/runtests.sh index 08df649a..b09fb830 100755 --- a/runtests.sh +++ b/runtests.sh @@ -1,25 +1,25 @@ #!/bin/bash -# This file is part of authapi. -# Copyright (C) 2014-2020 Agora Voting SL +# This file is part of iam. +# Copyright (C) 2014-2020 Sequent Tech Inc -# authapi is free software: you can redistribute it and/or modify +# iam is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License. -# authapi is distributed in the hope that it will be useful, +# iam is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License -# along with authapi. If not, see . +# along with iam. If not, see . -cd authapi -python manage.py migrate --settings=authapi.test_settings &&\ -python manage.py loaddata --settings=authapi.test_settings initial &&\ +cd iam +python manage.py migrate --settings=iam.test_settings &&\ +python manage.py loaddata --settings=iam.test_settings initial &&\ python manage.py test \ - --settings=authapi.test_settings \ + --settings=iam.test_settings \ $1 \ --failfast \ --nocapture \