You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2022/01/31 00:34:49 UTC

[incubator-ponymail-foal] branch master updated (52608d1 -> bd65ad8)

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git.


    from 52608d1   source property 'permalinks' is never used
     new 96e4eaa   source property 'permalinks' is never used
     new bd65ad8  Simplify login testing

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 server/testendpoints/testauth.py |  25 ++++++++++++++++++++-----
 tools/migrate.py                 |   1 -
 webui/images/oauth_admin.png     | Bin 0 -> 3689 bytes
 webui/images/oauth_user.png      | Bin 0 -> 3630 bytes
 4 files changed, 20 insertions(+), 6 deletions(-)
 create mode 100644 webui/images/oauth_admin.png
 create mode 100644 webui/images/oauth_user.png

[incubator-ponymail-foal] 02/02: Simplify login testing

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit bd65ad8d98e39358562e5094801e5bbaa7317380
Author: Sebb <se...@apache.org>
AuthorDate: Mon Jan 31 00:34:36 2022 +0000

    Simplify login testing
---
 server/testendpoints/testauth.py |  25 ++++++++++++++++++++-----
 webui/images/oauth_admin.png     | Bin 0 -> 3689 bytes
 webui/images/oauth_user.png      | Bin 0 -> 3630 bytes
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/server/testendpoints/testauth.py b/server/testendpoints/testauth.py
index 86ff13b..20ad6b9 100644
--- a/server/testendpoints/testauth.py
+++ b/server/testendpoints/testauth.py
@@ -19,21 +19,35 @@
     Simple endpoint that does a local login
 
 To enable:
+- ensure server/ponymail.yaml contains the following in the oauth section:
+
+oauth:
+  ...
+  authoritative_domains:
+    - localhost
+  admins:
+    - admin@apache.org
+
 - Add the --testendpoints qualifier to the server startup command
   Alternatively copy the files server/test/testauth.[py|.yaml] to the server/endpoints directory
   They can be renamed if necessary, so long as they have the same basename;
   adjust the URLs below to reflect the new name
 
 - then add the following to config.js under pm_config.oauth:
-        test: {
-            name: "Test Auth",
+        user: {
+            name: "Test Auth User",
+            oauth_portal: "http://localhost/api/testauth",
+            oauth_url: "http://localhost/api/testauth"
+        },
+        admin: {
+            name: "Test Auth Admin",
             oauth_portal: "http://localhost/api/testauth",
             oauth_url: "http://localhost/api/testauth"
         },
 (This assumes that the test installation is at http://localhost/. Adjust as necessary.)
 
-This will add an extra option to the login screen.
-Clicking on the "Logon with Test Auth" link will automatically login (without prompting)
+This will add two extra options to the login screen.
+Clicking on either "Test sign in as ..." link will automatically login (without prompting)
 
 The data returned by the login can be changed without restarting: just edit the testauth.yaml file.
 """
@@ -63,7 +77,8 @@ async def process(server: plugins.server.BaseServer, session: dict, indata: dict
         try:
             data =  yaml.safe_load(open(datafile))['oauth_data']
             debug(server, f'using data from {datafile}')
-            user = indata.get('user', 'user')
+            # if the user is not provided, use the key
+            user = indata.get('user', indata.get('key', 'user'))
             if user in data:
                 data = data[user]
                 data['state'] = indata.get('state')
diff --git a/webui/images/oauth_admin.png b/webui/images/oauth_admin.png
new file mode 100644
index 0000000..0d8371d
Binary files /dev/null and b/webui/images/oauth_admin.png differ
diff --git a/webui/images/oauth_user.png b/webui/images/oauth_user.png
new file mode 100644
index 0000000..a0d98cb
Binary files /dev/null and b/webui/images/oauth_user.png differ

[incubator-ponymail-foal] 01/02: source property 'permalinks' is never used

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit 96e4eaabba0c72fe0823182bc252c661e74c0ea0
Author: Sebb <se...@apache.org>
AuthorDate: Sun Jan 30 13:18:39 2022 +0000

     source property 'permalinks' is never used
    
     This fixes #225
---
 tools/migrate.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/migrate.py b/tools/migrate.py
index fb62f6b..1530169 100644
--- a/tools/migrate.py
+++ b/tools/migrate.py
@@ -194,7 +194,6 @@ def process_document(old_es, doc, old_dbname, dbname_source, dbname_mbox, do_dki
     else:
         doc["_source"]["permalinks"] = [doc["_id"]]
 
-    source["_source"]["permalinks"] = doc["_source"]["permalinks"]
     doc["_source"]["dbid"] = hashlib.sha3_256(source_text).hexdigest()
 
     # Add in shortened body for search aggs