From b4df859a2bf154cab056af0d3641cfe7e16ade11 Mon Sep 17 00:00:00 2001 From: Don Sizemore Date: Fri, 19 May 2023 12:54:50 -0400 Subject: [PATCH 1/2] #279 add two initial feature flags, api-session-auth and api-bearer-auth --- tasks/dataverse-optional-settings.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tasks/dataverse-optional-settings.yml b/tasks/dataverse-optional-settings.yml index d78ea914..6e458bb5 100644 --- a/tasks/dataverse-optional-settings.yml +++ b/tasks/dataverse-optional-settings.yml @@ -35,3 +35,14 @@ shell: '{{ payara_dir}}/bin/asadmin create-jvm-options "-Ddataverse.oai.server.maxrecords={{ harvest.oaiserver.maxrecords }}"' when: harvest.oaiserver.maxrecords is defined +- name: set DATAVERSE_FEATURE_API_SESSION_AUTH=1 when told + become: yes + become_user: "{{ dataverse.payara.user }}" + shell: '{{ payara_dir}}/bin/asadmin create-jvm-options "-Ddataverse.feature.api-session-auth=true"' + when: dataverse.api.session_auth == true + +- name: set DATAVERSE_FEATURE_API_BEARER_AUTH=1 when told + become: yes + become_user: "{{ dataverse.payara.user }}" + shell: '{{ payara_dir}}/bin/asadmin create-jvm-options "-Ddataverse.feature.api-bearer-auth=true"' + when: dataverse.api.bearer_auth == true From 274051b7d5d6bc46265943e3c3ff0c219752fde4 Mon Sep 17 00:00:00 2001 From: Don Sizemore Date: Thu, 25 May 2023 12:36:43 -0400 Subject: [PATCH 2/2] #279 add new bearer-auth and session-auth group_vars --- defaults/main.yml | 2 ++ tests/group_vars/jenkins.yml | 2 ++ tests/group_vars/memorytests.yml | 2 ++ tests/group_vars/vagrant.yml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index ff49e0a8..7efb7e3b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -46,9 +46,11 @@ dataverse: allow_signups: true api: allow_lookup: false + bearer_auth: false blocked_endpoints: "admin,builtin-users,test" blocked_policy: "localhost-only" location: "http://localhost:8080/api" + session_auth: false test_suite: false # possible test values from https://github.com/IQSS/dataverse/blob/develop/conf/docker-aio/run-test-suite.sh#L11 # beware DataversesIT and DatasetsIT at minimum must be run for any other tests to succeed. have fun. diff --git a/tests/group_vars/jenkins.yml b/tests/group_vars/jenkins.yml index 4ee8d47c..f85451d5 100644 --- a/tests/group_vars/jenkins.yml +++ b/tests/group_vars/jenkins.yml @@ -37,9 +37,11 @@ dataverse: allow_signups: true api: allow_lookup: false + bearer_auth: true blocked_endpoints: "admin,test" blocked_policy: "localhost-only" location: "http://localhost:8080/api" + session_auth: true test_suite: true # possible test values from https://github.com/IQSS/dataverse/blob/develop/conf/docker-aio/run-test-suite.sh#L11 # beware DataversesIT and DatasetsIT at minimum must be run for any other tests to succeed. have fun. diff --git a/tests/group_vars/memorytests.yml b/tests/group_vars/memorytests.yml index 4a38dd3c..3292b706 100644 --- a/tests/group_vars/memorytests.yml +++ b/tests/group_vars/memorytests.yml @@ -42,9 +42,11 @@ dataverse: allow_signups: true api: allow_lookup: false + bearer_auth: false blocked_endpoints: "admin,test" blocked_policy: "localhost-only" location: "http://localhost:8080/api" + session_auth: false test_suite: false # possible test values from https://github.com/IQSS/dataverse/blob/develop/conf/docker-aio/run-test-suite.sh#L11 # beware DataversesIT and DatasetsIT at minimum must be run for any other tests to succeed. have fun. diff --git a/tests/group_vars/vagrant.yml b/tests/group_vars/vagrant.yml index 15eb67d6..94a47f7b 100644 --- a/tests/group_vars/vagrant.yml +++ b/tests/group_vars/vagrant.yml @@ -42,9 +42,11 @@ dataverse: allow_signups: true api: allow_lookup: false + bearer_auth: true blocked_endpoints: "admin,test" blocked_policy: "localhost-only" location: "http://localhost:8080/api" + session_auth: true test_suite: false # possible test values from https://github.com/IQSS/dataverse/blob/develop/conf/docker-aio/run-test-suite.sh#L11 # beware DataversesIT and DatasetsIT at minimum must be run for any other tests to succeed. have fun.