Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions custom-recipes/sharepoint-online-append-list/recipe.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
{
"value": "app-username-password",
"label": "User name / password"
},
{
"value": "app-basic",
"label": "Individual User name / password"
}
]
},
Expand Down Expand Up @@ -90,6 +94,13 @@
"parameterSetId": "app-username-password",
"visibilityCondition": "model.auth_type == 'app-username-password'"
},
{
"name": "app_basic",
"label": "App basic",
"type": "PRESET",
"parameterSetId": "app-basic",
"visibilityCondition": "model.auth_type == 'app-basic'"
},
{
"name": "sharepoint_list_title",
"label": "List title",
Expand Down
55 changes: 55 additions & 0 deletions parameter-sets/app-basic/parameter-set.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"meta": {
"label": "App username password (user)",
"description": "",
"icon": "icon-cloud"
},
"defaultDefinableInline": false,
"defaultDefinableAtProjectLevel": false,
"pluginParams": [],
"params": [
{
"name": "sharepoint_tenant",
"label": "Tenant",
"type": "STRING",
"description": "As in <tenant>.sharepoint.com. Please refer to plugin doc.",
"mandatory": true
},
{
"name": "sharepoint_site",
"label": "Site path",
"type": "STRING",
"description": "sites/site_name/subsite...",
"mandatory": true
},
{
"name": "sharepoint_root",
"label": "Root directory",
"type": "STRING",
"description": "",
"defaultValue": "Shared Documents"
},
{
"name": "tenant_id",
"label": "Tenant ID",
"type": "STRING",
"description": "",
"mandatory": true
},
{
"name": "client_id",
"label": "Client ID",
"type": "STRING",
"description": "",
"mandatory": true
},
{
"name": "secure_token",
"type": "CREDENTIAL_REQUEST",
"label": "Azure Single Sign On",
"credentialRequestSettings": {
"type": "BASIC"
}
}
]
}
11 changes: 11 additions & 0 deletions python-connectors/sharepoint-online_lists/connector.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
{
"value": "app-username-password",
"label": "User name / password"
},
{
"value": "app-basic",
"label": "Individual User name / password"
}
]
},
Expand Down Expand Up @@ -70,6 +74,13 @@
"parameterSetId": "app-username-password",
"visibilityCondition": "model.auth_type == 'app-username-password'"
},
{
"name": "app_basic",
"label": "App basic",
"type": "PRESET",
"parameterSetId": "app-basic",
"visibilityCondition": "model.auth_type == 'app-basic'"
},
{
"name": "sharepoint_list_title",
"label": "List title",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
{
"value": "app-username-password",
"label": "User name / password"
},
{
"value": "app-basic",
"label": "Individual User name / password"
}
]
},
Expand Down Expand Up @@ -67,6 +71,13 @@
"parameterSetId": "app-username-password",
"visibilityCondition": "model.auth_type == 'app-username-password'"
},
{
"name": "app_basic",
"label": "App basic",
"type": "PRESET",
"parameterSetId": "app-basic",
"visibilityCondition": "model.auth_type == 'app-basic'"
},
{
"name": "advanced_parameters",
"label": "Show advanced parameters",
Expand Down
1 change: 1 addition & 0 deletions python-lib/dss_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class DSSConstants(object):
APPLICATION_JSON_NOMETADATA = "application/json;odata=nometadata"
AUTH_APP_CERTIFICATE = "app-certificate"
AUTH_APP_USERNAME_PASSWORD = "app-username-password"
AUTH_APP_BASIC = "app-basic"
AUTH_LOGIN = "login"
AUTH_OAUTH = "oauth"
AUTH_SITE_APP = "site-app-permissions"
Expand Down
23 changes: 23 additions & 0 deletions python-lib/sharepoint_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,29 @@ def __init__(self, config):
max_retries=SharePointConstants.MAX_RETRIES,
base_retry_timer_sec=SharePointConstants.WAIT_TIME_BEFORE_RETRY_SEC
)
elif config.get('auth_type') == DSSConstants.AUTH_APP_BASIC:
logger.info("SharePointClient:app-basic")
login_details = config.get('app_basic')
self.setup_sharepoint_online_url(login_details)
self.setup_login_details(login_details)
self.apply_paths_overwrite(config)
self.tenant_id = login_details.get("tenant_id")
self.client_id = login_details.get("client_id")
self.sharepoint_tenant = login_details.get("sharepoint_tenant")
secure_token = login_details.get("secure_token", {})
username = secure_token.get("user")
password = secure_token.get("password")
self.sharepoint_access_token = self.get_username_password_access_token(username, password)
self.session.update_settings(session=SharePointSession(
None,
None,
self.sharepoint_url,
self.sharepoint_site,
sharepoint_access_token=self.sharepoint_access_token
),
max_retries=SharePointConstants.MAX_RETRIES,
base_retry_timer_sec=SharePointConstants.WAIT_TIME_BEFORE_RETRY_SEC
)
else:
raise SharePointClientError("The type of authentication is not selected")
self.sharepoint_list_title = config.get("sharepoint_list_title")
Expand Down
4 changes: 4 additions & 0 deletions tests/python/integration/test_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ def test_run_sharepoint_online_256_plus_chars_strings(user_dss_clients):

def test_run_sharepoint_online_app_username_password_auth(user_dss_clients):
dss_scenario.run(user_dss_clients, project_key=TEST_PROJECT_KEY, scenario_id="APPUSERNAMEPASSWORDAUTH")


def test_run_sharepoint_online_app_basic_auth(user_dss_clients):
dss_scenario.run(user_dss_clients, project_key=TEST_PROJECT_KEY, scenario_id="APPBASICAUTH")