Skip to content

Commit 9fcd605

Browse files
Merge pull request #607 from mbonish/dx_update
Update UST/doc for api_key and tech_acct
2 parents 855b4c6 + 043150a commit 9fcd605

File tree

8 files changed

+32
-24
lines changed

8 files changed

+32
-24
lines changed

docs/en/user-manual/configuring_user_sync_tool.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ editor, and enter these values in the “enterprise” section:
124124
```YAML
125125
enterprise:
126126
org_id: "Organization ID goes here"
127-
api_key: "API key goes here"
127+
client_id: "Client ID goes here"
128128
client_secret: "Client Secret goes here"
129-
tech_acct: "Tech Account ID goes here"
129+
tech_acct_id: "Tech Account ID goes here"
130130
priv_key_path: "Path to Private Certificate goes here"
131131
```
132132
@@ -506,9 +506,9 @@ server:
506506
507507
enterprise:
508508
org_id: "Org ID goes here"
509-
api_key: "API key goes here"
509+
client_id: "Client ID goes here"
510510
client_secret: "Client secret goes here"
511-
tech_acct: "Tech account ID goes here"
511+
tech_acct_id: "Tech account ID goes here"
512512
priv_key_path: "Path to private.key goes here"
513513
# priv_key_data: "actual key data goes here" # This is an alternative to priv_key_path
514514
```

docs/en/user-manual/deployment_best_practices.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ connector-umapi.yml
8383

8484
enterprise:
8585
org_id: your org id
86-
secure_api_key_key: umapi_api_key
86+
secure_client_id_key: client_id
8787
secure_client_secret_key: umapi_client_secret
88-
tech_acct: your tech [email protected]
88+
tech_acct_id: your tech [email protected]
8989
secure_priv_key_data_key: umapi_private_key_data
9090

91-
Note the change of `api_key`, `client_secret`, and `priv_key_path` to `secure_api_key_key`, `secure_client_secret_key`, and `secure_priv_key_data_key`, respectively. These alternate configuration values give the key names to be looked up in the user keychain (or the equivalent service on other platforms) to retrieve the actual credential values. In this example, the credential key names are `umapi_api_key`, `umapi_client_secret`, and `umapi_private_key_data`.
91+
Note the change of `client_id`, `client_secret`, and `priv_key_path` to `secure_client_id_key`, `secure_client_secret_key`, and `secure_priv_key_data_key`, respectively. These alternate configuration values give the key names to be looked up in the user keychain (or the equivalent service on other platforms) to retrieve the actual credential values. In this example, the credential key names are `umapi_client_id`, `umapi_client_secret`, and `umapi_private_key_data`.
9292

9393
The contents of the private key file is used as the value of `umapi_private_key_data` in the credential store. This can only be done on platforms other than Windows. See below for how to secure the
9494
private key file on Windows.
@@ -118,9 +118,9 @@ private key file, respectively:
118118

119119
enterprise:
120120
org_id: your org id
121-
secure_api_key_key: umapi_api_key
121+
secure_client_id_key: umapi_client_id
122122
secure_client_secret_key: umapi_client_secret
123-
tech_acct: your tech [email protected]
123+
tech_acct_id: your tech [email protected]
124124
secure_priv_key_pass_key: umapi_private_key_passphrase
125125
priv_key_path: private-encrypted.key
126126

examples/config files - basic/connector-adobe-console.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ server:
3535
# if relative, it is interpreted relative to this configuration file.]
3636
integration:
3737
org_id: "Org ID goes here"
38-
api_key: "API key goes here"
38+
client_id: "Client ID goes here"
3939
client_secret: "Client secret goes here"
40-
tech_acct: "Tech account ID goes here"
40+
tech_acct_id: "Tech account ID goes here"
4141
priv_key_path: "private.key"
4242

4343
# (optional) As an alternative to priv_key_path, you can place the private key
@@ -54,11 +54,11 @@ integration:
5454
# (Windows Credential Manager, Mac Keychain, Linux Freedesktop Secret Service
5555
# or KWallet - these will be built into the Linux distribution).
5656
# To use this feature, uncomment the following entries and remove the
57-
# api_key, client_secret, and priv_key_data above.
57+
#client_id, client_secret, and priv_key_data above.
5858
# The actual credential values are placed in the credential store with the
5959
# username as the org_id value, and the key name (perhaps called internet
6060
# or network address) as one of the values below.
61-
#secure_api_key_key: umapi_api_key
61+
#secure_client_id_key: umapi_client_id
6262
#secure_client_secret_key: umapi_client_secret
6363
#secure_priv_key_data_key: umapi_private_key_data
6464
# Note: the Windows credential store generally can't store data as large as a private

examples/config files - basic/connector-umapi.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ server:
4646
# if relative, it is interpreted relative to this configuration file.]
4747
enterprise:
4848
org_id: "Org ID goes here"
49-
api_key: "API key goes here"
49+
client_id: "Client ID goes here"
5050
client_secret: "Client secret goes here"
51-
tech_acct: "Tech account ID goes here"
51+
tech_acct_id: "Tech account ID goes here"
5252
priv_key_path: "private.key"
5353

5454
# (optional) As an alternative to priv_key_path, you can place the private key
@@ -65,11 +65,11 @@ enterprise:
6565
# (Windows Credential Manager, Mac Keychain, Linux Freedesktop Secret Service
6666
# or KWallet - these will be built into the Linux distribution).
6767
# To use this feature, uncomment the following entries and remove the
68-
# api_key, client_secret, and priv_key_data above.
68+
# client_id, client_secret, and priv_key_data above.
6969
# The actual credential values are placed in the credential store with the
7070
# username as the org_id value, and the key name (perhaps called internet
7171
# or network address) as one of the values below.
72-
#secure_api_key_key: umapi_api_key
72+
#secure_client_id: umapi_client_id
7373
#secure_client_secret_key: umapi_client_secret
7474
#secure_priv_key_data_key: umapi_private_key_data
7575
# Note: the Windows credential store generally can't store data as large as a private

tests/fixture/connector-umapi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ server:
33
ims_host: ims-na1.adobelogin.com
44
enterprise:
55
org_id: "org_id"
6-
api_key: "api_key"
6+
client_id: "client_id"
77
client_secret: "client_secret"
8-
tech_acct: "tech_acct"
8+
tech_acct_id: "tech_acct_id"
99
priv_key_path: private.key

user_sync/connector/directory_adobe_console.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def __init__(self, caller_options):
9090
enterprise_config = caller_config.get_dict_config('integration')
9191
integration_builder = user_sync.config.OptionsBuilder(enterprise_config)
9292
integration_builder.require_string_value('org_id')
93-
integration_builder.require_string_value('tech_acct')
93+
tech_field = 'tech_acct_id' if 'tech_acct_id' in enterprise_config else 'tech_acct'
94+
integration_builder.require_string_value(tech_field)
9495
options['integration'] = integration_options = integration_builder.get_options()
9596

9697
self.logger = logger = user_sync.connector.helper.create_logger(options)
@@ -100,7 +101,7 @@ def __init__(self, caller_options):
100101

101102
ims_host = server_options['ims_host']
102103
self.org_id = org_id = integration_options['org_id']
103-
auth_dict = make_auth_dict(self.name, enterprise_config, org_id, integration_options['tech_acct'], logger)
104+
auth_dict = make_auth_dict(self.name, enterprise_config, org_id, integration_options[tech_field], logger)
104105

105106
# this check must come after we fetch all the settings
106107
caller_config.report_unused_values(logger)

user_sync/connector/umapi.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def __init__(self, name, caller_options):
7171
enterprise_config = caller_config.get_dict_config('enterprise')
7272
enterprise_builder = user_sync.config.OptionsBuilder(enterprise_config)
7373
enterprise_builder.require_string_value('org_id')
74-
enterprise_builder.require_string_value('tech_acct')
74+
tech_field = 'tech_acct_id' if 'tech_acct_id' in enterprise_config else 'tech_acct'
75+
enterprise_builder.require_string_value(tech_field)
7576
options['enterprise'] = enterprise_options = enterprise_builder.get_options()
7677
self.options = options
7778
self.logger = logger = user_sync.connector.helper.create_logger(options)
@@ -81,7 +82,7 @@ def __init__(self, name, caller_options):
8182

8283
ims_host = server_options['ims_host']
8384
self.org_id = org_id = enterprise_options['org_id']
84-
auth_dict = make_auth_dict(self.name, enterprise_config, org_id, enterprise_options['tech_acct'], logger)
85+
auth_dict = make_auth_dict(self.name, enterprise_config, org_id, enterprise_options[tech_field], logger)
8586
# this check must come after we fetch all the settings
8687
enterprise_config.report_unused_values(logger)
8788
# open the connection

user_sync/connector/umapi_util.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33

44

55
def make_auth_dict(name, config, org_id, tech_acct, logger):
6+
api_field = 'client_id' if 'client_id' in config or 'secure_client_id_key' in config else "api_key"
7+
if "api_key" in config and "client_id" in config:
8+
#word to be the same thing--take out api key--
9+
raise AssertionException('Cannot contain setting for both "api_key" and "client_id"(both fields set the same value). Please use "client_id."')
10+
if "api_key" in config and "secure_client_id" in config:
11+
raise AssertionException('Cannot contain setting for both "api_key" and "secure_client_id_key"(both fields set the same value). Please use "secure_client_id_key"')
612
auth_dict = {
713
'org_id': org_id,
814
'tech_acct_id': tech_acct,
9-
'api_key': config.get_credential('api_key', org_id),
15+
'api_key': config.get_credential(api_field, org_id),
1016
'client_secret': config.get_credential('client_secret', org_id),
1117
}
1218
# get the private key

0 commit comments

Comments
 (0)