Commit 864b73de authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Merge branch 'OCF222-update-publish-on-interconnected-ccfs' into 'staging'

Ocf222 update publish on interconnected ccfs

See merge request !202
parents e82eafcd e8b8f2d4
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -27,6 +27,10 @@ class AuthManager(Resource):

        auth_context = cert_col.find_one({"id":apf_id})

        # Service APIs published by an interconnected CCF have no certificate entry
        if auth_context is None:
            return

        if "services" in auth_context["resources"]:
            if service_id in auth_context["resources"]["services"]:
                auth_context["resources"]["services"].remove(service_id)
+372 −39

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
export CAPIF_NETWORK_NAME=capif-network-a
export COMPOSE_PROJECT_NAME=ocf_a
export CAPIF_INTERCONNECTION_HOSTNAME=capifcore-b

# Capif vault configuration
export CAPIF_VAULT_PORT=8200
+1 −0
Original line number Diff line number Diff line
export CAPIF_NETWORK_NAME=capif-network-b
export COMPOSE_PROJECT_NAME=ocf_b
export CAPIF_INTERCONNECTION_HOSTNAME=capifcore-a

# Capif vault configuration
export DEPLOY_VAULT=false
+10 −2
Original line number Diff line number Diff line
@@ -104,9 +104,13 @@ class CcfInstanceOperations(Resource):
        services_col = self.db.get_col_by_name(self.db.services_col)
        shareable_apis = services_col.find({
            "shareable_info.is_shareable": True,
            "shareable_info.capif_prov_doms": peer_dom,
            "apf_id": {"$ne": peer_ccf_id},
            "pub_api_path.ccf_ids": {"$ne": peer_ccf_id}
            "pub_api_path.ccf_ids": {"$ne": peer_ccf_id},
            "$or": [
                {"shareable_info.capif_prov_doms": peer_dom},
                {"shareable_info.capif_prov_doms": {"$exists": False}},
                {"shareable_info.capif_prov_doms": None}
            ]
        })

        url = "https://{}/published-apis/v1/{}/service-apis".format(peer_dom, local_ccf_id)
@@ -130,6 +134,10 @@ class CcfInstanceOperations(Resource):
                # The peer stores the API as its own, it must not share it any further
                payload['shareable_info'] = {"is_shareable": False}

                # Publish between CCFs (Interface CAPIF-6 and CAPIF-6e) must include ccfId to contact when serviceAPICategory is used. 
                if service_api.get("service_api_category") is not None:
                    payload['ccf_id'] = local_ccf_id

                try:
                    response = session.post(url,
                                            data=json.dumps(clean_n_camel_case(payload), cls=CustomJSONEncoder),
Loading