Skip to content

Commit 7a009a2

Browse files
committed
Work on issues #90, #46, #101.
Many changes. Nostests don't work. In-process check-in so others can review.
1 parent 8cc5f84 commit 7a009a2

File tree

13 files changed

+307
-308
lines changed

13 files changed

+307
-308
lines changed

docs/success-guide/setup_config_files.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ Limits on deletion prevent accidental account deletion in the event of misconfig
121121
☐ If you expect the number of directory users to drop by more than 200 between User Sync runs, then you will need to raise the max\_missing\_users value. These config file entries are to prevent runaway deletion in case of misconfiguration or other problems.
122122

123123
limits:
124-
    max_deletions_per_run: 10 # ceiling on disable/remove/delete
125-
    max_missing_users: 200      # abort if this many directory users disappear
124+
    max_strays_to_process: 10 # ceiling on disable/remove/delete
125+
    max_strays_hard_limit: 200      # abort if this many directory users disappear
126126

127127

128128

docs/user-manual/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -561,13 +561,13 @@ groups:
561561
User accounts are removed from the Adobe dashboard when
562562
corresponding users are not present in the directory and the tool
563563
is invoked with the `--remove-nonexistent-users` option. The
564-
`max_deletions_per_run` and `max_missing_users` values in
564+
`max_strays_to_process` and `max_strays_hard_limit` values in
565565
the `limits` section of the configuration file set limits on
566566
how many users can be removed at any one time. These limits
567567
prevent accidental removal of a large number of accounts in case
568568
of misconfiguration or other errors:
569569

570-
- The value of `max_deletions_per_run` sets a limit on the number
570+
- The value of `max_strays_to_process` sets a limit on the number
571571
of account removals in a single run. If more users are flagged
572572
for removal, they are left for the next run.
573573

@@ -577,7 +577,7 @@ raise this value.
577577
- If your organization has a large number of users in the
578578
enterprise directory and the number of users read during a sync
579579
is suddenly small, this could indicate a misconfiguration or
580-
error situation. The value of `max_missing_users` is a threshold
580+
error situation. The value of `max_strays_hard_limit` is a threshold
581581
which causes the run to exit and report an error if there are
582582
this many fewer users in the enterprise directory than in the
583583
Adobe admin console.
@@ -589,8 +589,8 @@ For example:
589589

590590
```YAML
591591
limits:
592-
max_deletions_per_run: 10
593-
max_missing_users: 200
592+
max_strays_to_process: 10
593+
max_strays_hard_limit: 200
594594
```
595595

596596
This configuration causes User Sync to remove no more than 10
@@ -693,8 +693,8 @@ directory:
693693
- "Default Adobe Enterprise Support Program configuration"
694694
695695
limits:
696-
max_deletions_per_run: 10
697-
max_missing_users: 200
696+
max_strays_to_process: 10
697+
max_strays_hard_limit: 200
698698
699699
logging:
700700
log_to_file: True

examples/config files - basic/1 user-sync-config.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,14 @@ directory:
8787
# - enterpriseID
8888
# - federatedID
8989

90-
limits:
91-
max_deletions_per_run: 10 # if --remove-nonexistent-users is specified, this is the most users that will be removed. Others will be left for a later run. A critical message will be logged.
92-
max_missing_users: 200 # if more than this number of user accounts are not found in the directory, user sync will abort with an error and a critical message will be logged.
90+
limits: # provide processing controls over stray Adobe users (that is, that are unmatched on customer side)
91+
# these controls only apply when strays are being processed for removal or deletion from the Adobe side;
92+
# if strays are just being output to a file for later processing, these settings do not apply.
93+
max_strays_hard_limit: 200 # If more than this many stray users are found, no processing of them is done.
94+
# Instead, user sync will abort at the point it would remove or delete them.
95+
max_strays_to_process: 10 # If more than this many stray users are found, only this many of them will be
96+
# removed or deleted, and the the run will terminate normally. Later runs
97+
# can be used to process the next batch of them.
9398

9499
logging:
95100
# specifies whether you wish to generate a log file

examples/config files - custom attributes and mappings/1 user-sync-config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ extensions:
122122
target_groups.add('Company 2 Users')
123123
124124
limits:
125-
max_deletions_per_run: 10 # if --remove-nonexistent-users is specified, this is the most users that will be removed. Others will be left for a later run. A critical message will be logged.
126-
max_missing_users: 200 # if more than this number of user accounts are not found in the directory, user sync will abort with an error and a critical message will be logged.
125+
max_strays_to_process: 10 # if --remove-nonexistent-users is specified, this is the most users that will be removed. Others will be left for a later run. A critical message will be logged.
126+
max_strays_hard_limit: 200 # if more than this number of user accounts are not found in the directory, user sync will abort with an error and a critical message will be logged.
127127

128128
logging:
129129
# specifies whether you wish to generate a log file

tests/config_test.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,21 @@ def test_get_rule_options(self, mock_id_type,mock_get_dict,mock_get_list,mock_ge
9999
expected = {
100100
'after_mapping_hook': None,
101101
'default_country_code': 'test',
102-
'delete_list_output_path': None,
103-
'delete_nonexistent_users': False,
104-
'delete_user_key_list': None,
102+
'delete_strays': False,
105103
'directory_group_filter': None,
106104
'directory_group_mapped': False,
105+
'disentitle_strays': False,
107106
'exclude_groups': [],
108107
'exclude_identity_types': [],
109108
'exclude_users': [],
110109
'extended_attributes': None,
111110
'manage_groups': False,
112-
'max_deletions_per_run': 1,
113-
'max_missing_users': 1,
111+
'max_strays_hard_limit': 1,
112+
'max_strays_to_process': 1,
114113
'new_account_type': 'new_acc',
115-
'remove_list_output_path': None,
116-
'remove_nonexistent_users': False,
117-
'remove_user_key_list': None,
114+
'remove_strays': False,
115+
'stray_key_list': None,
116+
'stray_list_output_path': None,
118117
'update_user_info': True,
119118
'username_filter_regex': None,
120119
}

tests/connector/directory_csv_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CSVDirectoryTest(unittest.TestCase):
1111
def test_normal(self):
1212
_, file_path = tempfile.mkstemp(".csv")
1313

14-
field_names = ['firstname', 'lastname', 'email', 'country', 'groups']
14+
field_names = ['identity_type', 'firstname', 'lastname', 'email', 'country', 'groups']
1515
user1 = tests.helper.create_test_user(['Acrobat1', 'Acrobat2'])
1616
user2 = tests.helper.create_test_user([])
1717

tests/helper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def create_test_user(groups):
4242
firstName = 'User_%d' % next_user_id
4343
next_user_id += 1
4444
user = {
45+
'identity_type': 'enterpriseID',
4546
'firstname': firstName,
4647
'lastname': 'Test',
4748
'email': '%[email protected]' % firstName,

0 commit comments

Comments
 (0)