sonata-nfv / son-gkeeper

SONATA's Service Platform Gatekeeper
http://www.sonata-nfv.eu
Apache License 2.0
2 stars 18 forks source link

Acquired licence does not appear in the licences retrieved from the gatekeeper #897

Open santiagordguez opened 6 years ago

santiagordguez commented 6 years ago

Hi, @jbonnet,

After acquiring a private licence, it seems that the process goes well because the user_licence field changes to "licenced" but when the BSS requests for the licences (GET https://sp.int3.sonata-nfv.eu/api/v2/licences), the new licence does not appear (in that case, only the public existing one):

[
        {
        "status": "ACTIVE",
        "validation_url": null,
        "description": "Default description",
        "license_uuid": "d8057e2f-9201-4c13-9edb-0c6038186739",
        "service_uuid": "8e114dcd-339d-4f9a-a6b6-b08641228484",
        "license_type": "PUBLIC",
        "user_uuid": "9491158b-44fd-4dea-8cf1-0d02820ddab5"
    }
]
jbonnet commented 6 years ago

Hi, @srodriguezOPT The license_typeand validation_url fields are part of the NSD. So maybe the GK should include them in the restricted fields that are returned when the service is not licensed, and then the BSS can include them in the parameters when the licence is created. What do you think?

santiagordguez commented 6 years ago

Hi, @jbonnet The problem is that BSS doesn't have a database and does not store any information. It can only show the information retrieved from the GK so if we want to show these fields in the BSS, it's necessary to send them from the Gatekeeper as a "GET licences" response. Otherwise, a secondary "GET all services" request will be needed to match licences and services with the aim of showing these fields, increasing the number of requests.

santiagordguez commented 6 years ago

Hi, @jbonnet An interesting field that is missing in the GET licences response is the related service name. The service uuid exists but the name could be helpful for the user:

image

jbonnet commented 6 years ago

Hi, @srodriguezOPT Ok, I'll open a specific issue to cover this missing service name. Problem with the GET /licences is... it lists all saved licences, but in this case the licence does not exist yet, right? You'll have to GET /services...

santiagordguez commented 6 years ago

Hi, @jbonnet

No, in this case, the licence already exists. This is the "already acquired" case. The case that you mention is the other tab, the "service licences that can be acquired..." and as you say, the BSS needs to make the GET /services request.

jbonnet commented 6 years ago

I'm checking this with @felipevicens, at the Licence Management module: it seems that there's a bug, and the private licence type plus the validation url fails to be saved...

jbonnet commented 6 years ago

Ok, @srodriguezOPT, please check if this has been solved.

santiagordguez commented 6 years ago

Hi, @jbonnet,

the acquired licence is still missing, only the public one appears. On the other hand, we don't have the service_name field yet.

jbonnet commented 6 years ago

@srodriguezOPT can you please post here the REST you're using? 'Cause creating a licence now seems ok:

{
    "description": "Default description", 
    "license_type": "PRIVATE", 
    "license_uuid": "28f4c338-a703-4f05-b6e8-04f811442424", 
    "service_uuid": "5cb12bf2-602a-47c8-b815-2e58ec446690", 
    "status": "ACTIVE", 
    "user_uuid": "54a3d0a0-dcb7-477b-aed0-abcb73768b2b", 
    "validation_url": "http://example.com"
}

And listing as well:

[
    {
        "description": "Default description", 
        "license_type": "PRIVATE", 
        "license_uuid": "28f4c338-a703-4f05-b6e8-04f811442424", 
        "service_uuid": "5cb12bf2-602a-47c8-b815-2e58ec446690", 
        "status": "ACTIVE", 
        "user_uuid": "54a3d0a0-dcb7-477b-aed0-abcb73768b2b", 
        "validation_url": "http://example.com"
    }
]

Thanks

santiagordguez commented 6 years ago

Hi, @jbonnet

GET https://sp.int3.sonata-nfv.eu/api/v2/licences?limit=10&offset=0:

[
        {
        "status": "ACTIVE",
        "validation_url": null,
        "description": "Default description",
        "license_uuid": "146528f8-54a7-42a6-a9f9-299d8b9fb195",
        "service_uuid": "0e59e724-814d-43e9-a56f-a5bd19fc8044",
        "license_type": "PUBLIC",
        "user_uuid": "5be281b7-69c2-4761-8763-3c225f30ceb8"
    }
]
jbonnet commented 6 years ago

Sorry, @srodriguezOPT Can not reproduce... are you sure you're on INT3? Also: to add the service's name, a new request must be made. Can the BSS do that request (.../services/<service_uuid>)?

santiagordguez commented 6 years ago

Hi, @jbonnet

The BSS can do the invocation but it will increase the invocations number (limited by GK, right?). There are two options:

You can reproduce the issue directly in the BSS and check the invocations with the web developer tools (in chrome F12):

image