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

Feature/attribute succession #124

Closed
wants to merge 83 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
743354b
chore: bump runtime dependency
J-Gann Dec 5, 2023
f3d39f4
fix: update createAttribute to use new runtime use case
J-Gann Dec 5, 2023
52c1933
feat: wip add endpoints to coreHttp
J-Gann Dec 5, 2023
f71879a
feat: wip yaml defintion
J-Gann Dec 5, 2023
c2590ec
feat: update sdk
J-Gann Dec 5, 2023
097ce42
fix: existing tests
J-Gann Dec 5, 2023
cfdabd1
fix: build workspaces
J-Gann Dec 5, 2023
2d9af1f
chore: comment outdated test
J-Gann Dec 5, 2023
149decf
fix: typo
J-Gann Dec 5, 2023
af22a47
test: identity attribute succession
J-Gann Dec 5, 2023
584eb69
chore: implement succeedIdentityAttribute endpoint and openapi spec
slavistan Dec 7, 2023
f0483b8
chore: implement succeedRelationship... endpoint and openapi spec
slavistan Dec 7, 2023
130c0eb
wip;
slavistan Dec 12, 2023
6028bd8
wip
J-Gann Dec 12, 2023
e9ad0a0
wip
J-Gann Dec 12, 2023
0d3a7ca
wip
J-Gann Dec 12, 2023
13daa8f
chore: move confidentiality into schema
slavistan Dec 18, 2023
88d89b2
chore: add todos
slavistan Dec 18, 2023
a687a37
fix: allow additional properties for attribute values
slavistan Dec 18, 2023
e4f6a69
chore: openapi: finish CreateAndShareRelationshipAttribute
slavistan Dec 18, 2023
3195d1d
chore: add todo
slavistan Dec 18, 2023
ffeb0d1
fix: typo
slavistan Dec 18, 2023
6354520
chore: minor
slavistan Dec 18, 2023
a8e2f26
chore: openapi: finish CreateIdentityAttribute
slavistan Dec 18, 2023
dbf5a19
chore: use dedicated schema for request
slavistan Dec 18, 2023
600770b
chore: openapi: finish shareidentityattribute
slavistan Dec 18, 2023
1aea115
openapi: finish succeedIdentityAttribute
slavistan Dec 18, 2023
6f5a1f0
chore: openapi: finish notifypeer.....
slavistan Dec 18, 2023
fb3599b
chore: openapi: finish succeedattribute
slavistan Dec 18, 2023
ecc5d98
chore: openapi: finish createAttribute
slavistan Dec 18, 2023
821097e
chore: remote any remains of shareAttribute
slavistan Dec 18, 2023
335ce87
chore: refactor valid{From,To} using a schema
slavistan Dec 18, 2023
482975e
chore: add todos
slavistan Dec 18, 2023
813ce89
chore: reorder fields
slavistan Dec 18, 2023
93aabd2
chore: remove comment
slavistan Dec 18, 2023
f875d54
chore: remove comment
slavistan Dec 18, 2023
6d0344a
wip
J-Gann Dec 19, 2023
c449907
wip;
slavistan Dec 19, 2023
ab7a9e9
chore: update lockfile
jkoenig134 Dec 19, 2023
fae1b4d
ci: run on local backbone
jkoenig134 Dec 19, 2023
6fde0bb
chore: bump libs
jkoenig134 Dec 19, 2023
3fb84c3
fix: test compiler errors
jkoenig134 Dec 19, 2023
fb7664d
wip
J-Gann Dec 19, 2023
e86545b
fix: iql
J-Gann Dec 19, 2023
eeb5b34
fix: tests
J-Gann Dec 19, 2023
5a3018e
wip review
J-Gann Dec 19, 2023
975d209
fix: paths
J-Gann Dec 19, 2023
d460bf8
chore: bump sdk to 2.3.0
J-Gann Dec 19, 2023
04f282c
fix: legacy createAttribute @type property
J-Gann Dec 19, 2023
96750d0
add todo
J-Gann Dec 19, 2023
3033770
chore: use more narrow types in sdk requests
slavistan Dec 20, 2023
c9d5810
chore: bump (correct) version
slavistan Dec 20, 2023
9a0158d
chore: changelog
slavistan Dec 20, 2023
32c04fd
chore: changelog
slavistan Dec 20, 2023
34d3d74
fix: deal with possibly undefined request content
slavistan Dec 20, 2023
076e687
chore: bump dependencies
slavistan Dec 20, 2023
48d6ddb
fix: handle possibly undefined requests
slavistan Dec 20, 2023
213dcfb
fix: correct sdk version
slavistan Dec 20, 2023
0c8a407
chore: slight change in wording
slavistan Dec 20, 2023
337552f
Chore/local backbone for tests (#127)
jkoenig134 Jan 10, 2024
57c3698
implement createRepositoryAttribute route
slavistan Jan 23, 2024
815b928
draft attribute succession route
slavistan Jan 23, 2024
cd0e6ed
Merge branch 'feature/attribute-succession' of github.com:nmshd/cns-c…
slavistan Jan 23, 2024
9b574b8
draft notify... route
slavistan Jan 23, 2024
1e057eb
remote obsolete routes and schemas
slavistan Jan 23, 2024
4ceb26f
adjust sdk to new routes
slavistan Jan 23, 2024
b9650b9
fix npm command name
slavistan Jan 23, 2024
7fe20a8
comment out broken tests; WIP
slavistan Jan 23, 2024
76b966f
add prefix for notification
sebbi08 Jan 23, 2024
e49a0d2
delete obsolete request files
slavistan Jan 24, 2024
cf16076
wip
slavistan Jan 24, 2024
bf68641
test: repository attriubte succeeding
sebbi08 Jan 25, 2024
d116761
add test for succeeding and sharing an repository attribute
sebbi08 Jan 25, 2024
670be2f
add notificationReference to shareInfo type
slavistan Jan 25, 2024
e1903fb
refactor: use proper union type for share info
slavistan Jan 25, 2024
dee1871
disable auto run in jest extension
sebbi08 Jan 25, 2024
ddfaca7
chore: remote todo; add to comment
slavistan Jan 25, 2024
1bec00a
Merge branch 'feature/attribute-succession' of github.com:nmshd/cns-c…
slavistan Jan 25, 2024
f5fe9ee
chore: update deps
slavistan Jan 25, 2024
652d8aa
fix: fix openapi payload declaration
slavistan Jan 25, 2024
0f41689
chore: remove answered questions
slavistan Jan 25, 2024
c5c48ea
chore: exclude vulnerabilities
slavistan Jan 25, 2024
829efaf
Merge branch 'main' into feature/attribute-succession
slavistan Jan 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
J-Gann committed Dec 19, 2023
commit 6d0344aeddcc0e73f5e548d8acbe44b399ec35fe
4 changes: 2 additions & 2 deletions packages/sdk/src/endpoints/AttributesEndpoint.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
ConnectorAttribute,
ConnectorAttributes,
ConnectorIdentityAttribute,
ConnectorRequest,
ConnectorResponse,
CreateAndShareRelationshipAttributeRequest,
CreateAttributeRequest,
CreateIdentityAttributeRequest,
ExecuteIQLQueryRequest,
ExecuteIdentityAttributeQueryRequest,
@@ -22,7 +22,7 @@ import {
import { Endpoint } from "./Endpoint";

export class AttributesEndpoint extends Endpoint {
public async createAttribute(request: ConnectorIdentityAttribute): Promise<ConnectorResponse<ConnectorAttribute>> {
public async createAttribute(request: CreateAttributeRequest): Promise<ConnectorResponse<ConnectorAttribute>> {
return await this.post("/api/v2/Attributes", request);
}

1 change: 1 addition & 0 deletions packages/sdk/src/types/attributes/index.ts
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ export * from "./IdentityAttributeQuery";
export * from "./RelationshipAttributeQuery";
export * from "./ThirdPartyAttributeQuery";
export * from "./requests/CreateAndShareRelationshipAttributeRequest";
export * from "./requests/CreateAttributeRequest";
export * from "./requests/CreateIdentityAttributeRequest";
export * from "./requests/ExecuteIQLQueryRequest";
export * from "./requests/ExecuteIdentityAttributeQueryRequest";
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ConnectorAttributeValue } from "../ConnectorAttribute";

export interface CreateAttributeRequest {
content: {
value: ConnectorAttributeValue;
tags?: string[];
validFrom?: string;
validTo?: string;
};
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { ConnectorAttributeValue } from "../ConnectorAttribute";

export interface CreateIdentityAttributeRequest {
value: ConnectorAttributeValue;
tags?: string[];
validFrom?: string;
validTo?: string;
content: {
value: ConnectorAttributeValue;
tags?: string[];
validFrom?: string;
validTo?: string;
};
}
4 changes: 2 additions & 2 deletions src/modules/coreHttpApi/controllers/AttributesController.ts
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@ export class AttributesController extends BaseController {
@POST
@Accept("application/json")
public async createAttribute(request: any): Promise<Return.NewResource<Envelope>> {
J-Gann marked this conversation as resolved.
Show resolved Hide resolved
Copy link

Choose a reason for hiding this comment

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

Due to the use of any, we might run into some issues with regards to exceptions here. Could you try unknown?

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean exactly by try? I can replace any with unknown, which the forces me to manually cast the request to some non-unknown type.

What's the problem with any here?

Copy link
Member

Choose a reason for hiding this comment

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

the problem is that you missed a null pointer bug b/c of any. any is fine if you don't do anything other than just passing it to the runtime, but can EXPLODE if you handle it like you did it.

Copy link
Member

Choose a reason for hiding this comment

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

don't get me wrong, we use any everywhere - and at some places there could be bugs because of this.. I think thats all Thomas wants to say :D

Copy link

Choose a reason for hiding this comment

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

I meant to try out how the code looks / development behaves, if we use unknown which requires us to cast manually if we want to implement additional logic. I fear, that we need to cast every call then.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a major pita to work with unknowns, but I do see the merits of it. We can use unknowns over anys, but I rather move this discussion/refactoring into a separate PR. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

yep, it is uncomfortable, but we should use unknown where we have custom logic on the request. I'm ok with doing it in another PR. The errors should now be resolved.

const attributeValue = request.value;
const result = await this.consumptionServices.attributes.createIdentityAttribute(attributeValue);
// TODO request.content contains unnecessary owner value => delete?
const result = await this.consumptionServices.attributes.createIdentityAttribute(request);
return this.created(result);
}

2 changes: 1 addition & 1 deletion src/modules/coreHttpApi/openapi.yml
Original file line number Diff line number Diff line change
@@ -293,7 +293,7 @@ paths:
additionalProperties: false
properties:
content:
"$ref": "#/components/schemas/IdentityAttribute"
"$ref": "#/components/schemas/IdentityAttribute" # TODO: specifies owner to be mandatory => we do not use this field
required:
- content
type: object