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

Maskinporten Delegations API (for A2 proxy) not setting supplier/consumer orgno #377

Open
jonkjetiloye opened this issue Mar 29, 2023 · 0 comments
Assignees
Labels
kind/bug Used when something isn't working

Comments

@jonkjetiloye
Copy link
Member

Description of the bug

Consumer and Supplier organization numbers are not being set correctly by the delegations API used by Maskinporten.

Steps To Reproduce

  1. GET {{EnvAccessManagementUrl}}/accessmanagement/api/v1/admin/delegations/maskinportenschema?Scope=altinn:test/seclvl2.read
Response:
[
    {
        "consumer_org": "810418672",
        "supplier_org": "0",
        "delegation_scheme_Id": "6e0cc605-a8ae-4a33-9fce-8f04b46625fc",
        "scopes": [
            "altinn:test/seclvl2.read",
            "altinn:test/seclvl2.write"
        ],
        "created": "2023-03-28T08:54:17.127055Z",
        "resourceid": "brg-maskinportenschemaid-119"
    },
    {
        "consumer_org": "0",
        "supplier_org": "0",
        "delegation_scheme_Id": "6e0cc605-a8ae-4a33-9fce-8f04b46625fc",
        "scopes": [
            "altinn:test/seclvl2.read",
            "altinn:test/seclvl2.write"
        ],
        "created": "2023-03-29T14:39:01.642675Z",
        "resourceid": "brg-maskinportenschemaid-119"
    }
]

Additional Information

No response

@jonkjetiloye jonkjetiloye added the kind/bug Used when something isn't working label Mar 29, 2023
@jonkjetiloye jonkjetiloye self-assigned this Mar 30, 2023
jonkjetiloye pushed a commit that referenced this issue Mar 30, 2023
#377
Old PartyId method in PartiesClient is not functional. It used to make calls to SBL bridge directly but has been changed to Register API but with incorrect model.

Removed old method and replaced with existing implementation using the PartyLookup model
jonkjetiloye added a commit that referenced this issue Apr 12, 2023
* AM-377 Remove broken PartyId lookup for organization number
#377
Old PartyId method in PartiesClient is not functional. It used to make calls to SBL bridge directly but has been changed to Register API but with incorrect model.

Removed old method and replaced with existing implementation using the PartyLookup model

* Fixed bug and code smells

* - Make admin/offered/received operations use the same helper method for building a complete Delegation model based on the change, offered/covered party and resource.
- Update missing fields in expected test data

* Reduced duplication

---------

Co-authored-by: Jon Kjetil Øye <acn-joye@ai-dev.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Used when something isn't working
Projects
Status: 🧪Test
Development

No branches or pull requests

1 participant