Skip to content

Commit

Permalink
Resolved secure_connection Registry hostname issue. Needs certificate…
Browse files Browse the repository at this point in the history
… regeneration
  • Loading branch information
Chaffelson committed Mar 1, 2018
1 parent 22b1e87 commit 83bfd1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 36 deletions.
4 changes: 3 additions & 1 deletion nipyapi/demo/console.py
Expand Up @@ -11,8 +11,10 @@
# Note that this is the URI for NiFi to connect to Registry
# Which may be different from your localhost connection if using Docker
# Docker is likely to be http://<docker name for registry>:18080

_rc_endpoint = 'http://registry:18080'


_basename = "nipyapi_console"
_pg0 = _basename + '_process_group_0'
_proc0 = _basename + '_processor_0'
Expand Down Expand Up @@ -68,7 +70,7 @@
reg_client_0 = nipyapi.versioning.create_registry_client(
name=_rc0,
uri=_rc_endpoint,
description='NiPyApi Test'
description='NiPyApi Demo Console'
)
except ValueError:
reg_client_0 = nipyapi.versioning.get_registry_client(_rc0)
Expand Down
36 changes: 1 addition & 35 deletions nipyapi/demo/secure_connection.py
Expand Up @@ -146,40 +146,6 @@ def add_registry_user_to_access_policies(user_identity, access_policies=[]):
log.debug("Encountered REST API error: %s", e)


# def add_nifi_user_to_access_policies(user_identity, access_policies=[],
# read=True, write=True):
# """
# Add a specified user to a list of access policies in the NiFi server.
#
# Access policies in the form [ ('action1', 'resource1'), ('action2', 'resource2'), ... ]
#
# :param user_identity: the identity of the user to whom you want to give access
# :param access_policies: a list of ('action', 'resource') pairs for the access polices
# to grant the specified user
# """
# user = nipyapi.security.get_service_user(user_identity)
# user_tenant = nipyapi.nifi.TenantEntity(
# component=nipyapi.nifi.TenantDTO(
# id=user.component.id,
# identity=user.component.identity
# ),
# permissions=nipyapi.nifi.PermissionsDTO(
# can_write=write,
# can_read=read
# )
# )
#
# for policy in access_policies:
# ap = get_or_create_nifi_access_policy(policy[0], policy[1], policy[2])
# if ap is not None:
# # TODO, should probably check that user is not already a member of this access policy
# ap.component.users.append(user_tenant)
# try:
# nipyapi.nifi.PoliciesApi().update_access_policy(ap.component.id, ap)
# except nipyapi.nifi.rest.ApiException as e:
# log.debug("Encountered REST API error: %s", e)


def connect_nifi_to_registry():
"""
Add the NiFi server as a trusted client/proxy for the NiFi Registry
Expand Down Expand Up @@ -296,7 +262,7 @@ def bootstrap_nifi_access_policies():
try:
reg_client_0 = nipyapi.versioning.create_registry_client(
name=_rc0,
uri='https://localhost:18443',
uri='https://nipyapi_secure_reg:18443',
description='NiPyApi Secure Test'
)
except ValueError:
Expand Down

0 comments on commit 83bfd1a

Please sign in to comment.