Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(authz): get a list of all users (reserved to stellio admins) #977

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

bobeal
Copy link
Member

@bobeal bobeal commented Aug 7, 2023

No description provided.

@bobeal bobeal requested a review from junjou August 7, 2023 15:00
@github-actions github-actions bot added the feature New feature or request label Aug 7, 2023
@bobeal bobeal added the authz Relates to auth(z) topics label Aug 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

Test Results

  51 files  ±0    51 suites  ±0   1m 55s ⏱️ -5s
803 tests +8  803 ✔️ +8  0 💤 ±0  0 ±0 
842 runs  +8  842 ✔️ +8  0 💤 ±0  0 ±0 

Results for commit 8e4c934. ± Comparison against base commit be972dc.

This pull request removes 83 and adds 22 tests. Note that renamed tests count towards both.

               "2020-03-25T08:33:17.965206Z"
               "urn:ngsi-ld:Beekeeper:1234",
               20,
               25,
            "instanceId":"urn:ngsi-ld:Instance:45678",
            "instanceId":"urn:ngsi-ld:In…
            "observedAt":"2020-03-25T08:33:17.965206Z",
            "sub": "sub"
            "type":"Property",
…
com.egm.stellio.search.authorization.AuthorizationServiceTests ‑ get users should return a count of -1 if authentication is not enabled()
com.egm.stellio.search.authorization.EnabledAuthorizationServiceTests ‑ it should return serialized users along with a count for an admin()
com.egm.stellio.search.authorization.SubjectReferentialServiceTests ‑ it should get all users()
com.egm.stellio.search.authorization.SubjectReferentialServiceTests ‑ it should get an user with all available information()
com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [10] attributeAndResultsMap={TemporalEntityAttribute(id=52972268-90c8-424c-8366-ed44a9902de6, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Property, attributeValueType=STRING, datasetId=null, createdAt=2023-08-07T15:08:05.112580124Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[SimplifiedAttributeInstanceResult(temporalEntityAttribute=e316512d-1e82-45c2-a645-a22f9b41fba0, value=Beehive_incoming_123, time=2020-03-25T08:29:17.965206Z), SimplifiedAttributeInstanceRe…, withTemporalValues=true, withAudit=false, expectation={
  "id" : "urn:ngsi-ld:BeeHive:TESTC",
  "type" : "BeeHive",
  "incoming" : {
    "type" : "Property",
    "values" : [ ["Beehive_incoming_123","2020-03-25T08:29:17.965206Z"], ["Beehive_incoming_124","2020-03-25T08:33:17.965206Z"] ]
  }
}

com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [11] attributeAndResultsMap={TemporalEntityAttribute(id=f1cf80da-d4ac-4531-a52b-ac7197b3ec4c, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Relationship, attributeValueType=STRING, datasetId=urn:ngsi-ld:Dataset:45678, createdAt=2023-08-07T15:08:05.112580124Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[SimplifiedAttributeInstanceResult(temporalEntityAttribute=13bd3574-db25-4ea0-a581-e6c01ccadc2b, value=urn:ngsi-ld:Entity:1234, time=2020-03-25T08:29:17.965206Z), S…, withTemporalValues=true, withAudit=false, expectation={
  "id" : "urn:ngsi-ld:BeeHive:TESTC",
  "type" : "BeeHive",
  "incoming" : {
    "type" : "Relationship",
    "datasetId" : "urn:ngsi-ld:Dataset:45678",
    "objects" : [ ["urn:ngsi-ld:Entity:1234","2020-03-25T08:29:17.965206Z"], ["urn:ngsi-ld:Entity:5678","2020-03-25T08:33:17.965206Z"] ]
  }
}

com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [1] attributeAndResultsMap={TemporalEntityAttribute(id=7cb7993f-d788-485b-8aa7-bc22a8db9386, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Property, attributeValueType=NUMBER, datasetId=null, createdAt=2023-08-07T15:08:05.112580124Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[FullAttributeInstanceResult(temporalEntityAttribute=58b1a8a8-e0af-4895-8156-1049b7b61a06, payload={"type":"Property","instanceId":"urn:ngsi-ld:Instance:45678","observedAt":"2020-03-25T08:2…, withTemporalValues=false, withAudit=false, expectation={
  "id" : "urn:ngsi-ld:BeeHive:TESTC",
  "type" : "BeeHive",
  "incoming" : [ {
    "type" : "Property",
    "value" : 550.0,
    "instanceId" : "urn:ngsi-ld:Instance:45678",
    "observedAt" : "2020-03-25T08:29:17.965206Z"
  }, {
    "type" : "Property",
    "value" : 650.0,
    "instanceId" : "urn:ngsi-ld:Instance:45679",
    "observedAt" : "2020-03-25T08:33:17.965206Z"
  } ]
}

com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [1] queryResult=[(EntityPayload(entityId=urn:ngsi-ld:BeeHive:TESTC, types=[https://ontology.eglobalmark.com/apic#BeeHive], createdAt=2023-08-07T15:08:05.041288084Z, modifiedAt=null, contexts=[https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/master/apic/jsonld-contexts/apic-compound.jsonld], payload=JsonByteArrayInput{{}}, specificAccessPolicy=null), {TemporalEntityAttribute(id=22abf6e0-05b9-4bde-a0a8-1e4a40fe2cb1, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com…, withTemporalValues=false, withAudit=true, expectation=[
   {
      "id":"urn:ngsi-ld:BeeHive:TESTC",
      "type":"BeeHive",
      "incoming":[
         {
            "type":"Property",
            "value":20,
            "instanceId":"urn:ngsi-ld:Instance:45678",
            "observedAt":"2020-03-25T08:33:17.965206Z",
            "sub": "sub"
         }
      ]
   },
   {
      "id":"urn:ngsi-ld:BeeHive:TESTD",
      "type":"BeeHive",
      "outgoing":[
         {
            "type":"Property",
            "value":25,
            "instanceId":"urn:ngsi-ld:In…
com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [2] attributeAndResultsMap={TemporalEntityAttribute(id=13419c5a-149f-4073-aec8-28794c0e1d02, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Relationship, attributeValueType=STRING, datasetId=null, createdAt=2023-08-07T15:08:05.112580124Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[FullAttributeInstanceResult(temporalEntityAttribute=798972ca-0c76-409b-b632-14f7fb5ebc9f, payload={"type":"Relationship","instanceId":"urn:ngsi-ld:Instance:45678","observedAt":"2020-03…, withTemporalValues=false, withAudit=false, expectation={
  "id" : "urn:ngsi-ld:BeeHive:TESTC",
  "type" : "BeeHive",
  "incoming" : [ {
    "type" : "Relationship",
    "object" : "urn:ngsi-ld:Entity:1234",
    "instanceId" : "urn:ngsi-ld:Instance:45678",
    "observedAt" : "2020-03-25T08:29:17.965206Z"
  }, {
    "type" : "Relationship",
    "object" : "urn:ngsi-ld:Entity:5678",
    "instanceId" : "urn:ngsi-ld:Instance:45679",
    "observedAt" : "2020-03-25T08:33:17.965206Z"
  } ]
}

com.egm.stellio.search.service.TemporalEntityBuilderTests ‑ [2] queryResult=[(EntityPayload(entityId=urn:ngsi-ld:BeeHive:TESTC, types=[https://ontology.eglobalmark.com/apic#BeeHive], createdAt=2023-08-07T15:08:05.041288084Z, modifiedAt=null, contexts=[https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/master/apic/jsonld-contexts/apic-compound.jsonld], payload=JsonByteArrayInput{{}}, specificAccessPolicy=null), {TemporalEntityAttribute(id=90270bbf-1d4c-4b1d-b49d-4239a2e50af3, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com…, withTemporalValues=true, withAudit=false, expectation=[
   {
      "id":"urn:ngsi-ld:BeeHive:TESTC",
      "type":"BeeHive",
      "incoming": {
         "type":"Property",
         "values":[
            [
               20,
               "2020-03-25T08:33:17.965206Z"
            ]
         ]
      }
   },
   {
      "id":"urn:ngsi-ld:BeeHive:TESTD",
      "type":"BeeHive",
      "outgoing": {
         "type":"Property",
         "values":[
            [
               25,
               "2020-03-25T08:33:17.965206Z"
            ]
         ]
      }
   }
]

…

@sonarcloud
Copy link

sonarcloud bot commented Aug 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link

@junjou junjou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see all important unit tests are implemented so... LGTM !

@bobeal bobeal merged commit 0ddd81c into develop Aug 7, 2023
11 checks passed
@bobeal bobeal deleted the feature/add-admin-endpoint-to-get-users branch August 7, 2023 15:16
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
authz Relates to auth(z) topics feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants