From 1d337212fbf826082d6eadd2cff8746afeaf47ab Mon Sep 17 00:00:00 2001 From: MaribelleHGomez Date: Fri, 23 Jul 2021 09:55:26 -0500 Subject: [PATCH 1/7] remove invalid param --- fence/blueprints/data/indexd.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/fence/blueprints/data/indexd.py b/fence/blueprints/data/indexd.py index f6d98b9042..69269d7e25 100644 --- a/fence/blueprints/data/indexd.py +++ b/fence/blueprints/data/indexd.py @@ -985,8 +985,6 @@ def _generate_anonymous_google_storage_signed_url( http_verb, expires_in, extension_headers=None, - content_type="", - md5_value="", service_account_creds=private_key, requester_pays_user_project=r_pays_project, ) From ba24cad6ac102b124e8f84edd356c5aceaffb042 Mon Sep 17 00:00:00 2001 From: MaribelleHGomez Date: Wed, 4 Aug 2021 16:19:53 -0500 Subject: [PATCH 2/7] print for group sync --- fence/sync/sync_users.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fence/sync/sync_users.py b/fence/sync/sync_users.py index 8ec52d28b6..d708f06995 100644 --- a/fence/sync/sync_users.py +++ b/fence/sync/sync_users.py @@ -1581,6 +1581,7 @@ def _update_arborist(self, session, user_yaml): # Now add back policies that are in the user.yaml for policy in user_yaml.authz.get("anonymous_policies", []): + self.logger.info("anon policy: {}".format(str(e))) self.arborist_client.grant_group_policy("anonymous", policy) for policy in user_yaml.authz.get("all_users_policies", []): From 3787f0148794013de045504312e7baa8559091ff Mon Sep 17 00:00:00 2001 From: MaribelleHGomez Date: Wed, 4 Aug 2021 16:43:40 -0500 Subject: [PATCH 3/7] more prints for group in sync --- fence/sync/sync_users.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fence/sync/sync_users.py b/fence/sync/sync_users.py index d708f06995..8927194f12 100644 --- a/fence/sync/sync_users.py +++ b/fence/sync/sync_users.py @@ -1551,6 +1551,7 @@ def _update_arborist(self, session, user_yaml): self.arborist_client.delete_group(deleted_group) # create/update the groups defined in the user.yaml + self.logger.info("groups: {}".format(str(groups))) for group in groups: missing = {"name", "users", "policies"}.difference(set(group.keys())) if missing: @@ -1575,13 +1576,14 @@ def _update_arborist(self, session, user_yaml): # First recreate these groups in order to clear out old, possibly deleted policies for builtin_group in ["anonymous", "logged-in"]: try: + self.logger.info("builtin groups: {}".format(str(builtin_group))) response = self.arborist_client.put_group(builtin_group) except ArboristError as e: self.logger.info("couldn't put group: {}".format(str(e))) # Now add back policies that are in the user.yaml for policy in user_yaml.authz.get("anonymous_policies", []): - self.logger.info("anon policy: {}".format(str(e))) + self.logger.info("anon policy: {}".format(str(policy))) self.arborist_client.grant_group_policy("anonymous", policy) for policy in user_yaml.authz.get("all_users_policies", []): From 92b69c79e9a1d3a7f6d5d82a2746e7ee058ec7db Mon Sep 17 00:00:00 2001 From: MaribelleHGomez Date: Wed, 4 Aug 2021 17:02:48 -0500 Subject: [PATCH 4/7] print for policies in anon group --- fence/sync/sync_users.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fence/sync/sync_users.py b/fence/sync/sync_users.py index 8927194f12..1f5fd9f825 100644 --- a/fence/sync/sync_users.py +++ b/fence/sync/sync_users.py @@ -1551,7 +1551,6 @@ def _update_arborist(self, session, user_yaml): self.arborist_client.delete_group(deleted_group) # create/update the groups defined in the user.yaml - self.logger.info("groups: {}".format(str(groups))) for group in groups: missing = {"name", "users", "policies"}.difference(set(group.keys())) if missing: @@ -1576,12 +1575,16 @@ def _update_arborist(self, session, user_yaml): # First recreate these groups in order to clear out old, possibly deleted policies for builtin_group in ["anonymous", "logged-in"]: try: - self.logger.info("builtin groups: {}".format(str(builtin_group))) + self.logger.info("BUILT IN GROUP: {}".format(str(builtin_group))) response = self.arborist_client.put_group(builtin_group) + self.logger.info("PUT RESPONSE: {}".format(builtin_group)) except ArboristError as e: self.logger.info("couldn't put group: {}".format(str(e))) # Now add back policies that are in the user.yaml + self.logger.info( + "ANON POLICIES: {}".format(user_yaml.authz.get("anonymous_policies", [])) + ) for policy in user_yaml.authz.get("anonymous_policies", []): self.logger.info("anon policy: {}".format(str(policy))) self.arborist_client.grant_group_policy("anonymous", policy) From 383a64b7889ef413b89e95d6bf26872c0983aa98 Mon Sep 17 00:00:00 2001 From: MaribelleHGomez Date: Wed, 4 Aug 2021 17:27:06 -0500 Subject: [PATCH 5/7] print authz dict from yaml --- fence/sync/sync_users.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fence/sync/sync_users.py b/fence/sync/sync_users.py index 1f5fd9f825..9446760aa5 100644 --- a/fence/sync/sync_users.py +++ b/fence/sync/sync_users.py @@ -1582,9 +1582,7 @@ def _update_arborist(self, session, user_yaml): self.logger.info("couldn't put group: {}".format(str(e))) # Now add back policies that are in the user.yaml - self.logger.info( - "ANON POLICIES: {}".format(user_yaml.authz.get("anonymous_policies", [])) - ) + self.logger.info("YAML AUTHZ DICT: {}".format(user_yaml.authz)) for policy in user_yaml.authz.get("anonymous_policies", []): self.logger.info("anon policy: {}".format(str(policy))) self.arborist_client.grant_group_policy("anonymous", policy) From 70267c38b7725caf1a8a4500fd5a2b3fe302b415 Mon Sep 17 00:00:00 2001 From: MaribelleHGomez Date: Wed, 4 Aug 2021 17:52:37 -0500 Subject: [PATCH 6/7] print for ingested file --- fence/sync/sync_users.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fence/sync/sync_users.py b/fence/sync/sync_users.py index 9446760aa5..aaaae88eb8 100644 --- a/fence/sync/sync_users.py +++ b/fence/sync/sync_users.py @@ -160,10 +160,12 @@ def from_file(cls, filepath, encrypted=True, key=None, logger=None): """ data = {} if filepath: + logger.info("FILE PATH: {}".format(filepath)) with _read_file(filepath, encrypted=encrypted, key=key, logger=logger) as f: file_contents = f.read() validate_user_yaml(file_contents) # run user.yaml validation tests data = yaml.safe_load(file_contents) + logger.info("FILE DATA: {}".format(data)) else: if logger: logger.info("Did not sync a user.yaml, no file path provided.") @@ -1577,12 +1579,10 @@ def _update_arborist(self, session, user_yaml): try: self.logger.info("BUILT IN GROUP: {}".format(str(builtin_group))) response = self.arborist_client.put_group(builtin_group) - self.logger.info("PUT RESPONSE: {}".format(builtin_group)) except ArboristError as e: self.logger.info("couldn't put group: {}".format(str(e))) # Now add back policies that are in the user.yaml - self.logger.info("YAML AUTHZ DICT: {}".format(user_yaml.authz)) for policy in user_yaml.authz.get("anonymous_policies", []): self.logger.info("anon policy: {}".format(str(policy))) self.arborist_client.grant_group_policy("anonymous", policy) From e3a2a137c742e213dade2910352cb6f37ffc835d Mon Sep 17 00:00:00 2001 From: MaribelleHGomez Date: Mon, 16 Aug 2021 10:04:02 -0500 Subject: [PATCH 7/7] remove extra log print --- fence/sync/sync_users.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fence/sync/sync_users.py b/fence/sync/sync_users.py index aaaae88eb8..8ec52d28b6 100644 --- a/fence/sync/sync_users.py +++ b/fence/sync/sync_users.py @@ -160,12 +160,10 @@ def from_file(cls, filepath, encrypted=True, key=None, logger=None): """ data = {} if filepath: - logger.info("FILE PATH: {}".format(filepath)) with _read_file(filepath, encrypted=encrypted, key=key, logger=logger) as f: file_contents = f.read() validate_user_yaml(file_contents) # run user.yaml validation tests data = yaml.safe_load(file_contents) - logger.info("FILE DATA: {}".format(data)) else: if logger: logger.info("Did not sync a user.yaml, no file path provided.") @@ -1577,14 +1575,12 @@ def _update_arborist(self, session, user_yaml): # First recreate these groups in order to clear out old, possibly deleted policies for builtin_group in ["anonymous", "logged-in"]: try: - self.logger.info("BUILT IN GROUP: {}".format(str(builtin_group))) response = self.arborist_client.put_group(builtin_group) except ArboristError as e: self.logger.info("couldn't put group: {}".format(str(e))) # Now add back policies that are in the user.yaml for policy in user_yaml.authz.get("anonymous_policies", []): - self.logger.info("anon policy: {}".format(str(policy))) self.arborist_client.grant_group_policy("anonymous", policy) for policy in user_yaml.authz.get("all_users_policies", []):