Loading openldap_primitives_v2_knf/charms/openldap-proxy_ubuntu-20.04-amd64.charm +19.6 KiB (3.01 MiB) File changed.No diff preview for this file type. View original file View changed file openldap_primitives_v2_knf/charms/ops/openldap-operator/actions.yaml +5 −5 Original line number Diff line number Diff line Loading @@ -20,8 +20,8 @@ get-user-info: - cn - dc get-user-info-blabla: description: Get user information blabla get-user-attribute: description: Get user attribute params: cn: type: string Loading @@ -29,10 +29,10 @@ get-user-info-blabla: dc: type: string description: Domain component. Dot-separated domain. newparam: attr: type: string description: Param. description: Desired attribute. required: - cn - dc - newparam - attr openldap_primitives_v2_knf/charms/ops/openldap-operator/src/charm.py +7 −7 Original line number Diff line number Diff line Loading @@ -78,14 +78,14 @@ class Ldap: finally: self._disconnect() def get_user_info_blabla(self, cn, dc, newparam): def get_user_attribute(self, cn, dc, attr): self._connect() try: if self.connection.search( search_base=f"{cn},{dc},{newparam}", search_base=f"{cn},{dc}", search_filter="(objectclass=*)", search_scope=SUBTREE, attributes=ALL_ATTRIBUTES, attributes=[attr], ): return self.connection.entries finally: Loading Loading @@ -128,14 +128,14 @@ class OpenldapOperatorCharm(CharmBase): except Exception as e: event.fail(f"Failed getting user info: {e}") def _on_get_user_info_blabla_action(self, event): """Handler for get-user-info-blabla action.""" def _on_get_user_attribute_action(self, event): """Handler for get-user-attribute action.""" cn_param = event.params["cn"] dc_param = event.params["dc"] newparam_param = event.params["newparam"] attr_param = event.params["attr"] cn = f"cn={cn_param}" dc = ",".join([f"dc={dc_component}" for dc_component in dc_param.split(".")]) newparam = newparam_param attr = attr_param try: openldap_service = self.osm_config.get_service("stable-openldap") ldap_uri = ( Loading openldap_primitives_v2_knf/openldap_vnfd.yaml +9 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,15 @@ vnfd: name: cn - data-type: STRING name: dc - name: get-user-attribute execution-environment-ref: openldap-ee parameter: - data-type: STRING name: cn - data-type: STRING name: dc - data-type: STRING name: attr ext-cpd: - id: mgmt-ext k8s-cluster-net: mgmtnet Loading Loading
openldap_primitives_v2_knf/charms/openldap-proxy_ubuntu-20.04-amd64.charm +19.6 KiB (3.01 MiB) File changed.No diff preview for this file type. View original file View changed file
openldap_primitives_v2_knf/charms/ops/openldap-operator/actions.yaml +5 −5 Original line number Diff line number Diff line Loading @@ -20,8 +20,8 @@ get-user-info: - cn - dc get-user-info-blabla: description: Get user information blabla get-user-attribute: description: Get user attribute params: cn: type: string Loading @@ -29,10 +29,10 @@ get-user-info-blabla: dc: type: string description: Domain component. Dot-separated domain. newparam: attr: type: string description: Param. description: Desired attribute. required: - cn - dc - newparam - attr
openldap_primitives_v2_knf/charms/ops/openldap-operator/src/charm.py +7 −7 Original line number Diff line number Diff line Loading @@ -78,14 +78,14 @@ class Ldap: finally: self._disconnect() def get_user_info_blabla(self, cn, dc, newparam): def get_user_attribute(self, cn, dc, attr): self._connect() try: if self.connection.search( search_base=f"{cn},{dc},{newparam}", search_base=f"{cn},{dc}", search_filter="(objectclass=*)", search_scope=SUBTREE, attributes=ALL_ATTRIBUTES, attributes=[attr], ): return self.connection.entries finally: Loading Loading @@ -128,14 +128,14 @@ class OpenldapOperatorCharm(CharmBase): except Exception as e: event.fail(f"Failed getting user info: {e}") def _on_get_user_info_blabla_action(self, event): """Handler for get-user-info-blabla action.""" def _on_get_user_attribute_action(self, event): """Handler for get-user-attribute action.""" cn_param = event.params["cn"] dc_param = event.params["dc"] newparam_param = event.params["newparam"] attr_param = event.params["attr"] cn = f"cn={cn_param}" dc = ",".join([f"dc={dc_component}" for dc_component in dc_param.split(".")]) newparam = newparam_param attr = attr_param try: openldap_service = self.osm_config.get_service("stable-openldap") ldap_uri = ( Loading
openldap_primitives_v2_knf/openldap_vnfd.yaml +9 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,15 @@ vnfd: name: cn - data-type: STRING name: dc - name: get-user-attribute execution-environment-ref: openldap-ee parameter: - data-type: STRING name: cn - data-type: STRING name: dc - data-type: STRING name: attr ext-cpd: - id: mgmt-ext k8s-cluster-net: mgmtnet Loading