Personal-Data-Linkage-Module / pxr-linkage

4 stars 1 forks source link

蓄積・共有の同意撤回を実行後、蓄積・共有ができてしまう #101

Closed jou-imaizumi closed 2 months ago

jou-imaizumi commented 4 months ago

以下のフローを実行した結果、想定とは異なるレスポンスが返却されたため、ご確認お願いします。 ※モノ蓄積APIは想定通りに動作しています。

■実行フロー 【蓄積の場合】 対象のユーザが対象の蓄積定義に対して、データ蓄積定義削除APIを実行 ↓ appのtype2ユーザが削除した蓄積定義に紐づくイベントに対して、イベント蓄積APIを実行

【共有の場合】 対象のユーザが対象の共有定義に対して、データ共有定義削除APIを実行 ↓ appのtype2ユーザが削除した共有定義に紐づくイベントに対して、共有APIを実行

■想定されるレスポンス内容 ・蓄積・共有に同意していないため、エラーが返却される想定

■実際のレスポンス内容 ・蓄積・共有に同意していないにも関わらず、蓄積・共有が成功してしまう

■確認事項 ・同意を撤回したあとに、何かバッチを動かさないと蓄積、共有ができてしまうのでしょうか? ・蓄積・共有定義のカタログに「requireConsent」のフラグがあるのですが、関係あるのでしょうか? ・以下のバグ修正前のバージョンは問題なく動作していたのですが、バージョンアップにより、何か構成変更が必要になったのでしょうか? 共有定義を「同意不要」で定義すると、蓄積イベント通知が送信されない

実行したAPIリクエスト

蓄積の場合

実行APIの流れ ①蓄積定義取得API実行(蓄積に同意していることの確認) ②蓄積定義のカタログ取得実行(蓄積定義の構成確認) ③イベントの蓄積API実行(蓄積できることの確認) ④蓄積定義削除API実行 ⑤蓄積定義取得API実行(削除した蓄積定義が返却されないことの確認) ⑥イベントの蓄積API実行(蓄積ができない想定)

①蓄積定義取得API

■リクエスト ・実行ユーザ:app1のtyp2 ・対象のユーザ:test_user ・appのカタログコード:1000800

curl -v -k \
-X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token:GrvGcs4O-Xyc54Rqdyhd1BdbZuy1MbyZnvgU' \
-b 'operator_type0_session=47e7c9871a287a0a7b9f513426a1440f149c33eb2748171502c9a3521a808137;_csrf=o4mGlnsOFDWWraWC0RmP2yNW' \
'https://{app1のホスト名}/pxr-block-proxy/pxr-block-proxy/?block=$pxr-root-block&path=%2Fbook-manage%2Fsettings%2Fstore%2Ftest_user%3Fapp%3D1000800'

■レスポンス

[
    {
        "id": 224,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "store": {
            "_value": 1000797,
            "_ver": 1
        },
        "storeCatalogId": "3ab775c7-2c8c-4b3b-bd72-4f69a5d2a3f2",
        "document": [],
        "event": [
            {
                "_code": {
                    "_value": 1000794,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000791,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 225,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "store": {
            "_value": 1000798,
            "_ver": 1
        },
        "storeCatalogId": "cf6a6dd9-7d00-450f-84b1-8523d0296ef9",
        "document": [],
        "event": [
            {
                "_code": {
                    "_value": 1000795,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000792,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 226,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "store": {
            "_value": 1000799,
            "_ver": 1
        },
        "storeCatalogId": "ef4eb7c4-81f3-40b8-a8b6-73f5132f8498",
        "document": [],
        "event": [
            {
                "_code": {
                    "_value": 1000796,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000793,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    }
]

②蓄積定義のカタログ取得実行

■リクエスト ・実行ユーザ:test_user ・対象のユーザ:test_user ・appのカタログコード:1000800 ・対象の蓄積定義のカタログコード:1000797

curl -v -k \
-X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token: dGTJlAUy-Bm7iukB4wUIaPJBnFLckpLuVtDs' \
-b 'operator_type2_session=53008e7f739806b20553669126254c699179fcdc6152917fc0f1dee53caf1619;_csrf=wAiaHQt5Hg0GSgpa6A83XZ7K' \
'https://{rootのホスト名}/pxr-block-proxy/pxr-block-proxy/ind/?path=%2Fcatalog%2F1000797'

■レスポンス

{
    "catalogItem": {
        "ns": "catalog/ext/test/actor/app/actor_1000787/store",
        "name": "test",
        "_code": {
            "_value": 1000797,
            "_ver": 1
        },
        "inherit": {
            "_value": 39,
            "_ver": 1
        },
        "description": "testの情報です。"
    },
    "template": {
        "_code": {
            "_value": 1000797,
            "_ver": 1
        },
        "store": [
            {
                "id": "3ab775c7-2c8c-4b3b-bd72-4f69a5d2a3f2",
                "event": [
                    {
                        "code": {
                            "_value": 1000794,
                            "_ver": 1
                        },
                        "requireConsent": false,
                        "thing": [
                            {
                                "code": {
                                    "_value": 1000791,
                                    "_ver": 1
                                },
                                "requireConsent": true
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "prop": [
        {
            "key": "store",
            "type": {
                "of": "inner[]",
                "inner": "Store",
                "cmatrix": null,
                "candidate": null
            },
            "description": "蓄積定義",
            "isInherit": true
        }
    ],
    "value": [
        {
            "key": "_code",
            "value": null
        },
        {
            "key": "store",
            "value": [
                {
                    "key": "id",
                    "value": "3ab775c7-2c8c-4b3b-bd72-4f69a5d2a3f2"
                },
                {
                    "key": "event",
                    "value": [
                        {
                            "key": "code",
                            "value": [
                                {
                                    "key": "_value",
                                    "value": 1000794
                                },
                                {
                                    "key": "_ver",
                                    "value": 1
                                }
                            ]
                        },
                        {
                            "key": "requireConsent",
                            "value": false
                        },
                        {
                            "key": "thing",
                            "value": [
                                {
                                    "key": "code",
                                    "value": [
                                        {
                                            "key": "_value",
                                            "value": 1000791
                                        },
                                        {
                                            "key": "_ver",
                                            "value": 1
                                        }
                                    ]
                                },
                                {
                                    "key": "requireConsent",
                                    "value": true
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "attribute": null
}

③イベントの蓄積

■リクエスト ・実行ユーザ:app1のtyp2 ・対象のユーザ:test_user ・appのカタログコード:1000800 ・蓄積対象のイベントカタログコード:1000794

curl -v -k \
-X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token: GrvGcs4O-Xyc54Rqdyhd1BdbZuy1MbyZnvgU' \
-b 'operator_type2_session=47e7c9871a287a0a7b9f513426a1440f149c33eb2748171502c9a3521a808137;_csrf=o4mGlnsOFDWWraWC0RmP2yNW' \
-d '{
    "_code": {
        "_value": 1000794,
        "_ver": 1
    },
    "app": {
        "code": {
            "index": "2_3_1",
            "value": {
                "_value": 1000787,
                "_ver": 2
            }
        },
        "app": {
            "index": "2_3_2",
            "value": {
                "_value": 1000800,
                "_ver": 3
            }
        }
    },
    "code": {
        "index": "3_1_2",
        "value": {
            "_value": 1000794,
            "_ver": 1
        }
    },
    "end": {
        "index": "3_2_2",
        "value": null
    },
    "env": null,
    "id": {
        "index": "3_1_1",
        "value": null
    },
    "location": {
        "index": "3_3_1",
        "value": null
    },
    "sourceId": null,
    "start": {
        "index": "3_2_1",
        "value": null
    },
    "thing": null,
    "userId": {
        "index": "3_6_1",
        "value": "test_user"
    },
    "wf": null
}' \
'https://{app1のホスト名}/pxr-block-proxy/pxr-block-proxy/?path=%2Fbook-operate%2Fevent%2Ftest_user'

■レスポンス

{
    "_code": {
        "_value": 1000794,
        "_ver": 1
    },
    "app": {
        "code": {
            "index": "2_3_1",
            "value": {
                "_value": 1000787,
                "_ver": 2
            }
        },
        "app": {
            "index": "2_3_2",
            "value": {
                "_value": 1000800,
                "_ver": 3
            }
        }
    },
    "code": {
        "index": "3_1_2",
        "value": {
            "_value": 1000794,
            "_ver": 1
        }
    },
    "end": {
        "index": "3_2_2",
        "value": null
    },
    "env": null,
    "id": {
        "index": "3_1_1",
        "value": "e6c38a3c-83b0-42ca-b9bd-a71d6c3a2238"
    },
    "location": {
        "index": "3_3_1",
        "value": null
    },
    "sourceId": null,
    "start": {
        "index": "3_2_1",
        "value": null
    },
    "thing": null,
    "userId": {
        "index": "3_6_1",
        "value": "test_user"
    },
    "wf": null
}

④蓄積定義削除API実行

■リクエスト ・実行ユーザ:test_user ・対象のユーザ:test_user ・appのカタログコード:1000800 ・削除対象の蓄積定義id:224(①蓄積定義取得APIのレスポンス内容参考)

curl -v -k \
-X DELETE \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token: dGTJlAUy-Bm7iukB4wUIaPJBnFLckpLuVtDs' \
-b 'operator_type0_session=53008e7f739806b20553669126254c699179fcdc6152917fc0f1dee53caf1619;_csrf=wAiaHQt5Hg0GSgpa6A83XZ7K' \
'https://{rootのホスト名}/pxr-block-proxy/pxr-block-proxy/ind/?path=%2Fbook-manage%2Fsettings%2Fstore%2F224'

■レスポンス

{
    "result": "success"
}

⑤蓄積定義取得API実行

■リクエスト ・実行ユーザ:app1のtyp2ユーザ ・対象のユーザ:test_user ・appのカタログコード:1000800

curl -v -k \
-X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token:GrvGcs4O-Xyc54Rqdyhd1BdbZuy1MbyZnvgU' \
-b 'operator_type0_session=47e7c9871a287a0a7b9f513426a1440f149c33eb2748171502c9a3521a808137;_csrf=o4mGlnsOFDWWraWC0RmP2yNW' \
'https://{app1のホスト名}/pxr-block-proxy/pxr-block-proxy/?block=$pxr-root-block&path=%2Fbook-manage%2Fsettings%2Fstore%2Ftest_user%3Fapp%3D1000800'

■レスポンス

[
    {
        "id": 225,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "store": {
            "_value": 1000798,
            "_ver": 1
        },
        "storeCatalogId": "cf6a6dd9-7d00-450f-84b1-8523d0296ef9",
        "document": [],
        "event": [
            {
                "_code": {
                    "_value": 1000795,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000792,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 226,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "store": {
            "_value": 1000799,
            "_ver": 1
        },
        "storeCatalogId": "ef4eb7c4-81f3-40b8-a8b6-73f5132f8498",
        "document": [],
        "event": [
            {
                "_code": {
                    "_value": 1000796,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000793,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    }
]

⑥イベントの蓄積API実行

■リクエスト ・実行ユーザ:app1のtyp2ユーザ ・対象のユーザ:test_user ・appのカタログコード:1000800 ・対象のイベントカタログコード:1000794

curl -v -k \
-X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token: GrvGcs4O-Xyc54Rqdyhd1BdbZuy1MbyZnvgU' \
-b 'operator_type2_session=47e7c9871a287a0a7b9f513426a1440f149c33eb2748171502c9a3521a808137;_csrf=o4mGlnsOFDWWraWC0RmP2yNW' \
-d '{
    "_code": {
        "_value": 1000794,
        "_ver": 1
    },
    "app": {
        "code": {
            "index": "2_3_1",
            "value": {
                "_value": 1000787,
                "_ver": 2
            }
        },
        "app": {
            "index": "2_3_2",
            "value": {
                "_value": 1000800,
                "_ver": 3
            }
        }
    },
    "code": {
        "index": "3_1_2",
        "value": {
            "_value": 1000794,
            "_ver": 1
        }
    },
    "end": {
        "index": "3_2_2",
        "value": null
    },
    "env": null,
    "id": {
        "index": "3_1_1",
        "value": null
    },
    "location": {
        "index": "3_3_1",
        "value": null
    },
    "sourceId": null,
    "start": {
        "index": "3_2_1",
        "value": null
    },
    "thing": null,
    "userId": {
        "index": "3_6_1",
        "value": "test_user"
    },
    "wf": null
}' \
'https://{app1のhost名}/pxr-block-proxy/pxr-block-proxy/?path=%2Fbook-operate%2Fevent%2Ftest_user'

■レスポンス 蓄積ができてしまう

{
    "_code": {
        "_value": 1000794,
        "_ver": 1
    },
    "app": {
        "code": {
            "index": "2_3_1",
            "value": {
                "_value": 1000787,
                "_ver": 2
            }
        },
        "app": {
            "index": "2_3_2",
            "value": {
                "_value": 1000800,
                "_ver": 3
            }
        }
    },
    "code": {
        "index": "3_1_2",
        "value": {
            "_value": 1000794,
            "_ver": 1
        }
    },
    "end": {
        "index": "3_2_2",
        "value": null
    },
    "env": null,
    "id": {
        "index": "3_1_1",
        "value": "e5c5eb4d-e9fe-4312-a292-79ea8327cad6"
    },
    "location": {
        "index": "3_3_1",
        "value": null
    },
    "sourceId": null,
    "start": {
        "index": "3_2_1",
        "value": null
    },
    "thing": null,
    "userId": {
        "index": "3_6_1",
        "value": "test_user"
    },
    "wf": null
}

共有の場合

実行APIの流れ ①共有定義取得API実行(共有に同意していることの確認) ②カタログ取得API実行(共有定義の構造確認) ③共有API実行(共有できることの確認) ④共有定義削除API実行 ⑤共有定義取得API実行(削除した共有定義が返却されないことの確認) ⑥共有API実行(共有ができない想定)

①共有定義取得API実行

■リクエスト ・実行ユーザ:app1のtyp2ユーザ ・対象のユーザ:test_user ・appのカタログコード:1000800

curl -v -k -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token:GrvGcs4O-Xyc54Rqdyhd1BdbZuy1MbyZnvgU'\
 -b 'operator_type2_session=47e7c9871a287a0a7b9f513426a1440f149c33eb2748171502c9a3521a808137;_csrf=o4mGlnsOFDWWraWC0RmP2yNW' \ 
 'https://{app1のホスト名}/pxr-block-proxy/pxr-block-proxy/?block=$pxr-root-block&path=%2Fbook-manage%2Fsetting%2Fshare%3Fid%3Dtest_user%26app%3D1000800'

■レスポンス

[
    {
        "id": 227,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000838",
                    "_ver": "1"
                }
            }
        ]
    },
    {
        "id": 228,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000839",
                    "_ver": "1"
                }
            }
        ]
    },
    {
        "id": 229,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000840",
                    "_ver": "1"
                }
            }
        ]
    },
    {
        "id": 230,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000841",
                    "_ver": "1"
                }
            }
        ]
    },
    {
        "id": 231,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000842",
                    "_ver": "1"
                }
            }
        ]
    },
    {
        "id": 232,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000843",
                    "_ver": "1"
                }
            }
        ]
    },
    {
        "id": 233,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000844",
                    "_ver": "1"
                }
            }
        ]
    }
]

②カタログ取得API実行

■リクエスト ・実行ユーザ:test_user ・対象のカタログコード:1000838(共有定義)

curl -v -k \
-X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token: dGTJlAUy-Bm7iukB4wUIaPJBnFLckpLuVtDs' \
-b 'operator_type2_session=53008e7f739806b20553669126254c699179fcdc6152917fc0f1dee53caf1619;_csrf=wAiaHQt5Hg0GSgpa6A83XZ7K' \
'https://{rootのホスト名}/pxr-block-proxy/pxr-block-proxy/ind/?path=%2Fcatalog%2F1000838'

■レスポンス

{
    "catalogItem": {
        "ns": "catalog/ext/test/actor/app/actor_1000787/share",
        "name": "test",
        "_code": {
            "_value": 1000838,
            "_ver": 1
        },
        "inherit": {
            "_value": 40,
            "_ver": 1
        },
        "description": "testの情報です。"
    },
    "template": {
        "_code": {
            "_value": 1000838,
            "_ver": 1
        },
        "share": [
            {
                "id": "e1bc4f2b-7f1b-4519-b101-93f72bda69c5",
                "role": null,
                "event": [
                    {
                        "code": {
                            "_value": 1000819,
                            "_ver": 1
                        },
                        "requireConsent": false,
                        "thing": [
                            {
                                "code": {
                                    "_value": 1000814,
                                    "_ver": 1
                                },
                                "requireConsent": true
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "prop": [
        {
            "key": "share",
            "type": {
                "of": "inner[]",
                "inner": "Share",
                "cmatrix": null,
                "candidate": null
            },
            "description": "状態共有機能定義",
            "isInherit": true
        }
    ],
    "value": [
        {
            "key": "share",
            "value": [
                {
                    "key": "id",
                    "value": "e1bc4f2b-7f1b-4519-b101-93f72bda69c5"
                },
                {
                    "key": "role",
                    "value": null
                },
                {
                    "key": "event",
                    "value": [
                        {
                            "key": "code",
                            "value": [
                                {
                                    "key": "_value",
                                    "value": 1000819
                                },
                                {
                                    "key": "_ver",
                                    "value": 1
                                }
                            ]
                        },
                        {
                            "key": "requireConsent",
                            "value": false
                        },
                        {
                            "key": "thing",
                            "value": [
                                {
                                    "key": "code",
                                    "value": [
                                        {
                                            "key": "_value",
                                            "value": 1000814
                                        },
                                        {
                                            "key": "_ver",
                                            "value": 1
                                        }
                                    ]
                                },
                                {
                                    "key": "requireConsent",
                                    "value": true
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "attribute": null
}

③共有API実行

■リクエスト ・実行ユーザ:app1のtype2ユーザ ・対象のユーザ:test_user ・対象のイベントカタログコード:1000819

curl -v -k \
-X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token:GrvGcs4O-Xyc54Rqdyhd1BdbZuy1MbyZnvgU' \
-b 'operator_type2_session=47e7c9871a287a0a7b9f513426a1440f149c33eb2748171502c9a3521a808137;_csrf=o4mGlnsOFDWWraWC0RmP2yNW' \
-d '{
    "userId": "test_user",
    "updatedAt": {
        "start": "2023-08-18T17:01:00.000+0900",
        "end": "2024-08-18T18:00:00.000+0900"
    },
    "event": [
        {
            "_value": 1000819,
            "_ver": 1
        }
    ]
}' \
'https://{app1のホスト名}/pxr-block-proxy/pxr-block-proxy/?&path=%2Fbook-operate%2Fshare'

■レスポンス

[
    {
        "document": null,
        "event": [
            {
                "id": {
                    "index": "3_1_1",
                    "value": "9bac806b-ab21-46c6-b727-677afa0d458c"
                },
                "code": {
                    "index": "3_1_2",
                    "value": {
                        "_value": 1000819,
                        "_ver": 1
                    }
                },
                "start": {
                    "index": "3_2_1",
                    "value": null
                },
                "end": {
                    "index": "3_2_2",
                    "value": null
                },
                "location": {
                    "index": "3_3_1",
                    "value": null
                },
                "sourceId": null,
                "env": null,
                "app": {
                    "code": {
                        "index": "3_5_1",
                        "value": {
                            "_value": 1000812,
                            "_ver": 2
                        }
                    },
                    "app": {
                        "index": "3_5_5",
                        "value": {
                            "_value": 1000829,
                            "_ver": 3
                        }
                    }
                },
                "wf": null,
                "thing": [
                    {
                        "app": {
                            "code": {
                                "index": "2_3_1",
                                "value": {
                                    "_value": 1000812,
                                    "_ver": 2
                                }
                            },
                            "app": {
                                "index": "2_3_2",
                                "value": {
                                    "_value": 1000829,
                                    "_ver": 3
                                }
                            }
                        },
                        "code": {
                            "index": "4_1_2",
                            "value": {
                                "_value": 1000814,
                                "_ver": 1
                            }
                        },
                        "data": [
                            {
                                "start": "2023-07-27 00:00:00",
                                "end": "2023-08-30 00:00:00",
                                "json": {
                                    "pulse": 81,
                                    "systolic": 140,
                                    "diastolic": 100,
                                    "spo2": "69",
                                    "created_at": "2023-08-03 13:34:00"
                                }
                            }
                        ],
                        "env": [
                            {
                                "index": "4_3_1",
                                "value": {}
                            }
                        ],
                        "envelope": {},
                        "id": {
                            "index": "4_1_1",
                            "value": "7499b881-8110-4a60-b4b3-774e7c1654ee"
                        },
                        "sourceId": null,
                        "wf": null
                    }
                ]
            }
        ],
        "thing": null
    }
]

④共有定義削除API実行

■リクエスト ・実行ユーザ:test_user ・対象のユーザ:test_user ・対象の共有定義id:227(「①共有定義取得API実行」参考)

curl -v -k \
-X DELETE \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token: dGTJlAUy-Bm7iukB4wUIaPJBnFLckpLuVtDs' \
-b 'operator_type2_session=53008e7f739806b20553669126254c699179fcdc6152917fc0f1dee53caf1619;_csrf=wAiaHQt5Hg0GSgpa6A83XZ7K' \
'https://{app1のホスト名}/pxr-block-proxy/pxr-block-proxy/ind/?path=%2Fbook-manage%2Fsetting%2Fshare%2F227'

■レスポンス

{
    "result": "success"
}

⑤共有定義取得API実行

■リクエスト ・実行ユーザ:app1のtype2ユーザ ・対象のユーザ:test_user ・appのカタログコード:1000800

curl -v -k -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token:GrvGcs4O-Xyc54Rqdyhd1BdbZuy1MbyZnvgU' \
-b 'operator_type2_session=47e7c9871a287a0a7b9f513426a1440f149c33eb2748171502c9a3521a808137;_csrf=o4mGlnsOFDWWraWC0RmP2yNW' \
'https://{app1のホスト名}/pxr-block-proxy/pxr-block-proxy/?block=$pxr-root-block&path=%2Fbook-manage%2Fsetting%2Fshare%3Fid%3Dtest_user%26app%3D1000800'

■レスポンス

[
    {
        "id": 228,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000839",
                    "_ver": "1"
                }
            }
        ]
    },
    {
        "id": 229,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000840",
                    "_ver": "1"
                }
            }
        ]
    },
    {
        "id": 230,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000841",
                    "_ver": "1"
                }
            }
        ]
    },
    {
        "id": 231,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000842",
                    "_ver": "1"
                }
            }
        ]
    },
    {
        "id": 232,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000843",
                    "_ver": "1"
                }
            }
        ]
    },
    {
        "id": 233,
        "actor": {
            "_value": 1000787
        },
        "app": {
            "_value": 1000800
        },
        "share": [
            {
                "code": {
                    "_value": "1000844",
                    "_ver": "1"
                }
            }
        ]
    }
]

⑥共有API実行

■リクエスト ・実行ユーザ:app1のtype2ユーザ ・対象のユーザ:test_user ・対象のイベントカタログのカタログコード:1000800

curl -v -k \
-X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token:GrvGcs4O-Xyc54Rqdyhd1BdbZuy1MbyZnvgU' \
-b 'operator_type2_session=47e7c9871a287a0a7b9f513426a1440f149c33eb2748171502c9a3521a808137;_csrf=o4mGlnsOFDWWraWC0RmP2yNW' \
-d '{
    "userId": "test_user",
    "updatedAt": {
        "start": "2023-08-18T17:01:00.000+0900",
        "end": "2024-08-18T18:00:00.000+0900"
    },
    "event": [
        {
            "_value": 1000819,
            "_ver": 1
        }
    ]
}' \
'https://{app1のホスト名}/pxr-block-proxy/pxr-block-proxy/?&path=%2Fbook-operate%2Fshare'

■レスポンス 共有できてしまう

[
    {
        "document": null,
        "event": [
            {
                "id": {
                    "index": "3_1_1",
                    "value": "9bac806b-ab21-46c6-b727-677afa0d458c"
                },
                "code": {
                    "index": "3_1_2",
                    "value": {
                        "_value": 1000819,
                        "_ver": 1
                    }
                },
                "start": {
                    "index": "3_2_1",
                    "value": null
                },
                "end": {
                    "index": "3_2_2",
                    "value": null
                },
                "location": {
                    "index": "3_3_1",
                    "value": null
                },
                "sourceId": null,
                "env": null,
                "app": {
                    "code": {
                        "index": "3_5_1",
                        "value": {
                            "_value": 1000812,
                            "_ver": 2
                        }
                    },
                    "app": {
                        "index": "3_5_5",
                        "value": {
                            "_value": 1000829,
                            "_ver": 3
                        }
                    }
                },
                "wf": null,
                "thing": [
                    {
                        "app": {
                            "code": {
                                "index": "2_3_1",
                                "value": {
                                    "_value": 1000812,
                                    "_ver": 2
                                }
                            },
                            "app": {
                                "index": "2_3_2",
                                "value": {
                                    "_value": 1000829,
                                    "_ver": 3
                                }
                            }
                        },
                        "code": {
                            "index": "4_1_2",
                            "value": {
                                "_value": 1000814,
                                "_ver": 1
                            }
                        },
                        "data": [
                            {
                                "start": "2023-07-27 00:00:00",
                                "end": "2023-08-30 00:00:00",
                                "json": {
                                    "pulse": 81,
                                    "systolic": 140,
                                    "diastolic": 100,
                                    "spo2": "69",
                                    "created_at": "2023-08-03 13:34:00"
                                }
                            }
                        ],
                        "env": [
                            {
                                "index": "4_3_1",
                                "value": {}
                            }
                        ],
                        "envelope": {},
                        "id": {
                            "index": "4_1_1",
                            "value": "7499b881-8110-4a60-b4b3-774e7c1654ee"
                        },
                        "sourceId": null,
                        "wf": null
                    }
                ]
            }
        ],
        "thing": null
    }
]
jou-imaizumi commented 4 months ago

追加でバージョンアップ前の動作のログを共有します。

バージョンアップ前の動き(今年の1月に実行のログ)

蓄積の場合

実行の流れ ①蓄積定義取得API実行 ②蓄積定義のカタログ取得 ③蓄積定義削除API実行 ④イベントの蓄積API実行

①蓄積定義取得API実行

■リクエスト ・実行ユーザ:test_user ・対象のユーザ:test_user

curl -v -k -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token:07axhWTA-NhmIwbAcgFaxST4MvyiRFSGD4bI' \
-b 'operator_type0_session=11065e17a1b54988f2122aa3777c8368fde75fd738da034a9bd8d5d6ab033071; _csrf=mPJumS-OrEo0KKqYIcYuPRUY' \
'https://{rootのホスト名}/pxr-block-proxy/pxr-block-proxy/ind/?block=$pxr-root-block&path=%2Fbook-manage%2Fsettings%2Fstore%2Ftest_user'

■レスポンス

[
    {
        "id": 41,
        "actor": {
            "_value": 1000812,
            "_ver": 2
        },
        "app": {
            "_value": 1000829,
            "_ver": 3
        },
        "wf": null,
        "store": {
            "_value": 1000824,
            "_ver": 1
        },
        "storeCatalogId": "15dcf80b-beac-4b15-938b-55e4ad2ed816",
        "document": [],
        "event": [
            {
                "_code": {
                    "_value": 1000819,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000814,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 51,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "store": {
            "_value": 1000797,
            "_ver": 1
        },
        "storeCatalogId": "3ab775c7-2c8c-4b3b-bd72-4f69a5d2a3f2",
        "document": [],
        "event": [
            {
                "_code": {
                    "_value": 1000794,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000791,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 62,
        "actor": {
            "_value": 1000802,
            "_ver": 2
        },
        "app": {
            "_value": 1000810,
            "_ver": 3
        },
        "wf": null,
        "store": {
            "_value": 1000809,
            "_ver": 1
        },
        "storeCatalogId": "6771db58-78f9-4f6a-bd05-6c804a7eb1d0",
        "document": [],
        "event": [
            {
                "_code": {
                    "_value": 1000807,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000805,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    }
]

②蓄積定義のカタログ取得

■リクエスト ・実行ユーザ:test_user ・対象のユーザ:test_user ・対象の蓄積定義のカタログコード:1000797

curl -v -k -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token:EB8I4gcN-s2CHDSE73esubLNDysh5yBVVwW4' \
-b 'operator_type0_session=0361f0b56a863d48e16c4eb8f5704e6f77e5ec9331a17f48b108966f22118a0a;_csrf=yaDHDmMMhAxT1FVsC-3UgIBh' \
'https://{rootのホスト名}/pxr-block-proxy/pxr-block-proxy/ind/?block=\$pxr-root-block&path=%2Fcatalog%2F1000797'

■レスポンス

{
    "catalogItem": {
        "ns": "catalog/ext/test/actor/app/actor_1000787/store",
        "name": "test",
        "_code": {
            "_value": 1000797,
            "_ver": 1
        },
        "inherit": {
            "_value": 39,
            "_ver": 1
        },
        "description": "testの情報"
    },
    "template": {
        "_code": {
            "_value": 1000797,
            "_ver": 1
        },
        "store": [
            {
                "id": "o5mqjdz-81ta-cahz-jpcf-r7agwxgaszbw",
                "event": [
                    {
                        "code": {
                            "_value": 1000794,
                            "_ver": 1
                        },
                        "requireConsent": false,
                        "thing": [
                            {
                                "code": {
                                    "_value": 1000791,
                                    "_ver": 1
                                },
                                "requireConsent": true
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "prop": [
        {
            "key": "store",
            "type": {
                "of": "inner[]",
                "inner": "Store",
                "cmatrix": null,
                "candidate": null
            },
            "description": "蓄積定義",
            "isInherit": true
        }
    ],
    "value": [
        {
            "key": "_code",
            "value": null
        },
        {
            "key": "store",
            "value": [
                {
                    "key": "id",
                    "value": "o5mqjdz-81ta-cahz-jpcf-r7agwxgaszbw"
                },
                {
                    "key": "event",
                    "value": [
                        {
                            "key": "code",
                            "value": [
                                {
                                    "key": "_value",
                                    "value": 1000794
                                },
                                {
                                    "key": "_ver",
                                    "value": 1
                                }
                            ]
                        },
                        {
                            "key": "requireConsent",
                            "value": false
                        },
                        {
                            "key": "thing",
                            "value": [
                                {
                                    "key": "code",
                                    "value": [
                                        {
                                            "key": "_value",
                                            "value": 1000791
                                        },
                                        {
                                            "key": "_ver",
                                            "value": 1
                                        }
                                    ]
                                },
                                {
                                    "key": "requireConsent",
                                    "value": true
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "attribute": null
}

③蓄積定義削除API実行

■リクエスト ・実行ユーザ:test_user ・対象のユーザ:test_user ・対象の蓄積定義id:51

curl -v -k -X DELETE \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token:07axhWTA-NhmIwbAcgFaxST4MvyiRFSGD4bI' \
-b 'operator_type0_session=11065e17a1b54988f2122aa3777c8368fde75fd738da034a9bd8d5d6ab033071; _csrf=mPJumS-OrEo0KKqYIcYuPRUY' \
'https://{rootのホスト名}/pxr-block-proxy/pxr-block-proxy/ind/?block=$pxr-root-block&path=%2Fbook-manage%2Fsettings%2Fstore%2F51'

■レスポンス

{
    "result": "success"
}

④イベントの蓄積API実行

■リクエスト ・実行ユーザ:appのtyp2ユーザ ・対象のユーザ:test_user ・対象のイベントカタログコード:1000794

curl -v -k \
-X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token:FX4lFtai-RdPSJJuZPdG7gGPmSHQ2_tWHX2k' \
-b 'operator_type2_session=dfeb177729cce1bdb795145b3b22efca17954f14b5c9d760c758ac40b3e7bd87;_csrf=C5O7UK3D0O2lJw69pQcegSpS' \
-d '{
    "_code": {
        "_value": 1000794,
        "_ver": 1
    },
    "app": {
        "code": {
            "index": "2_3_1",
            "value": {
                "_value": 1000787,
                "_ver": 2
            }
        },
        "app": {
            "index": "2_3_2",
            "value": {
                "_value": 1000800,
                "_ver": 3
            }
        }
    },
    "code": {
        "index": "3_1_2",
        "value": {
            "_value": 1000794,
            "_ver": 1
        }
    },
    "end": {
        "index": "3_2_2",
        "value": null
    },
    "env": null,
    "id": {
        "index": "3_1_1",
        "value": null
    },
    "location": {
        "index": "3_3_1",
        "value": null
    },
    "sourceId": null,
    "start": {
        "index": "3_2_1",
        "value": null
    },
    "thing": null,
    "userId": {
        "index": "3_6_1",
        "value": "test_user"
    },
    "wf": null
}' \
'https://{app1のホスト名}/pxr-block-proxy/pxr-block-proxy/?path=%2Fbook-operate%2Fevent%2Ftest_user'

■レスポンス 以前のバージョンは正常に蓄積できないようになっていた。

{
    "status": 401,
    "message": "このリクエストは許可されませんでした"
}

共有の場合

実行の流れ ①共有定義取得API実行 ②共有定義のカタログ取得 ③共有定義削除API実行 ④共有API実行

①共有定義取得API実行

■リクエスト ・実行ユーザ:test_user ・対象のユーザ:test_user

''' curl -v -k -X GET \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'x-xsrf-token:07axhWTA-NhmIwbAcgFaxST4MvyiRFSGD4bI' \ -b 'operator_type0_session=11065e17a1b54988f2122aa3777c8368fde75fd738da034a9bd8d5d6ab033071; _csrf=mPJumS-OrEo0KKqYIcYuPRUY' \ 'https://{rootのホスト名}/pxr-block-proxy/pxr-block-proxy/ind/?block=$pxr-root-block&path=%2Fbook-manage%2Fsetting%2Fshare' '''

■レスポンス

[
    {
        "id": 46,
        "actor": {
            "_value": 1000812,
            "_ver": 2
        },
        "app": {
            "_value": 1000829,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000845,
            "_ver": 1
        },
        "shareCatalogId": "859faca4-9027-467a-8fca-f799b2a4f57f",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000794,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000791,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 47,
        "actor": {
            "_value": 1000812,
            "_ver": 2
        },
        "app": {
            "_value": 1000829,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000846,
            "_ver": 1
        },
        "shareCatalogId": "d7acb3b6-d401-448b-86e4-0f65c1eeb047",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000795,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000792,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 48,
        "actor": {
            "_value": 1000812,
            "_ver": 2
        },
        "app": {
            "_value": 1000829,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000847,
            "_ver": 1
        },
        "shareCatalogId": "e15964a8-5fe2-4dca-ae15-0b9e95475d00",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000796,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000793,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 49,
        "actor": {
            "_value": 1000812,
            "_ver": 2
        },
        "app": {
            "_value": 1000829,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000848,
            "_ver": 1
        },
        "shareCatalogId": "a257363c-89aa-4979-a721-1a8871038005",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000806,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000804,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 50,
        "actor": {
            "_value": 1000812,
            "_ver": 2
        },
        "app": {
            "_value": 1000829,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000849,
            "_ver": 1
        },
        "shareCatalogId": "2cd1421c-88fd-4a60-9197-fa4e33933a51",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000807,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000805,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 54,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000838,
            "_ver": 1
        },
        "shareCatalogId": "e1bc4f2b-7f1b-4519-b101-93f72bda69c5",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000819,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000814,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 55,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000839,
            "_ver": 1
        },
        "shareCatalogId": "efee0540-d011-4a73-b536-751f322250c6",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000820,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000815,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 56,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000840,
            "_ver": 1
        },
        "shareCatalogId": "1ae9e6f8-72fa-4d1d-a126-294b6df7417c",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000821,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000816,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 57,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000841,
            "_ver": 1
        },
        "shareCatalogId": "2b66169f-1b34-47db-988c-b3510fff5517",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000822,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000817,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 58,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000842,
            "_ver": 1
        },
        "shareCatalogId": "289cba55-7a27-4c0e-bd1c-cbc7b0d20679",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000823,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000818,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 59,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000843,
            "_ver": 1
        },
        "shareCatalogId": "1476fe40-e97f-4805-badd-a28fe347a4d7",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000806,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000804,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 60,
        "actor": {
            "_value": 1000787,
            "_ver": 2
        },
        "app": {
            "_value": 1000800,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000844,
            "_ver": 1
        },
        "shareCatalogId": "ce381c4f-4d44-4c17-91c7-4f669a098b21",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000807,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000805,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 63,
        "actor": {
            "_value": 1000802,
            "_ver": 2
        },
        "app": {
            "_value": 1000810,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000830,
            "_ver": 1
        },
        "shareCatalogId": "272166aa-9ee9-457a-9b79-94ca8a658c19",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000819,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000814,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 64,
        "actor": {
            "_value": 1000802,
            "_ver": 2
        },
        "app": {
            "_value": 1000810,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000831,
            "_ver": 1
        },
        "shareCatalogId": "4999e98b-2bf1-44ac-aee2-63649cc6afba",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000820,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000815,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 65,
        "actor": {
            "_value": 1000802,
            "_ver": 2
        },
        "app": {
            "_value": 1000810,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000832,
            "_ver": 1
        },
        "shareCatalogId": "7e7eef34-3d2a-4f30-a5fa-c134669af75d",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000821,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000816,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 66,
        "actor": {
            "_value": 1000802,
            "_ver": 2
        },
        "app": {
            "_value": 1000810,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000833,
            "_ver": 1
        },
        "shareCatalogId": "779f1ce6-0602-49fd-9379-5066eecadab7",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000822,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000817,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 67,
        "actor": {
            "_value": 1000802,
            "_ver": 2
        },
        "app": {
            "_value": 1000810,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000834,
            "_ver": 1
        },
        "shareCatalogId": "42a4850e-7291-43f1-82e1-d611b73b86e7",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000823,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000818,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 68,
        "actor": {
            "_value": 1000802,
            "_ver": 2
        },
        "app": {
            "_value": 1000810,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000835,
            "_ver": 1
        },
        "shareCatalogId": "7d6c5896-6a26-4269-ab6b-673ff35bd8ef",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000794,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000791,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 69,
        "actor": {
            "_value": 1000802,
            "_ver": 2
        },
        "app": {
            "_value": 1000810,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000836,
            "_ver": 1
        },
        "shareCatalogId": "b87245be-0752-4d09-ac3d-fe06c899d364",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000795,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000792,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    },
    {
        "id": 70,
        "actor": {
            "_value": 1000802,
            "_ver": 2
        },
        "app": {
            "_value": 1000810,
            "_ver": 3
        },
        "wf": null,
        "share": {
            "_value": 1000837,
            "_ver": 1
        },
        "shareCatalogId": "64bf1c0b-de04-4547-8336-f71b0701fca3",
        "document": null,
        "event": [
            {
                "_code": {
                    "_value": 1000796,
                    "_ver": 1
                },
                "thing": [
                    {
                        "_code": {
                            "_value": 1000793,
                            "_ver": 1
                        }
                    }
                ]
            }
        ],
        "thing": null
    }
]

②共有定義のカタログ取得

■リクエスト ・実行ユーザ:test_user ・対象のユーザ:test_user ・対象の共有定義のカタログコード:1000838

curl -v -k -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token:EB8I4gcN-s2CHDSE73esubLNDysh5yBVVwW4' \
-b 'operator_type0_session=0361f0b56a863d48e16c4eb8f5704e6f77e5ec9331a17f48b108966f22118a0a;_csrf=yaDHDmMMhAxT1FVsC-3UgIBh' \
'https://{rootのホスト名}/pxr-block-proxy/pxr-block-proxy/ind/?block=\$pxr-root-block&path=%2Fcatalog%2F1000838'

■レスポンス

{
    "catalogItem": {
        "ns": "catalog/ext/test/actor/app/actor_1000787/share",
        "name": "test",
        "_code": {
            "_value": 1000838,
            "_ver": 1
        },
        "inherit": {
            "_value": 40,
            "_ver": 1
        },
        "description": "testの情報"
    },
    "template": {
        "_code": {
            "_value": 1000838,
            "_ver": 1
        },
        "share": [
            {
                "id": "fpoxnsx6-anyo-gazt-ajxj-mk3yfwxlpk7o",
                "role": null,
                "event": [
                    {
                        "code": {
                            "_value": 1000819,
                            "_ver": 1
                        },
                        "requireConsent": false,
                        "thing": [
                            {
                                "code": {
                                    "_value": 1000814,
                                    "_ver": 1
                                },
                                "requireConsent": true
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "prop": [
        {
            "key": "share",
            "type": {
                "of": "inner[]",
                "inner": "Share",
                "cmatrix": null,
                "candidate": null
            },
            "description":"共有定義",
            "isInherit": true
        }
    ],
    "value": [
        {
            "key": "share",
            "value": [
                {
                    "key": "id",
                    "value": "fpoxnsx6-anyo-gazt-ajxj-mk3yfwxlpk7o"
                },
                {
                    "key": "role",
                    "value": null
                },
                {
                    "key": "event",
                    "value": [
                        {
                            "key": "code",
                            "value": [
                                {
                                    "key": "_value",
                                    "value": 1000819
                                },
                                {
                                    "key": "_ver",
                                    "value": 1
                                }
                            ]
                        },
                        {
                            "key": "requireConsent",
                            "value": false
                        },
                        {
                            "key": "thing",
                            "value": [
                                {
                                    "key": "code",
                                    "value": [
                                        {
                                            "key": "_value",
                                            "value": 1000814
                                        },
                                        {
                                            "key": "_ver",
                                            "value": 1
                                        }
                                    ]
                                },
                                {
                                    "key": "requireConsent",
                                    "value": true
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "attribute": null
}

③共有定義削除API実行

■リクエスト ・実行ユーザ:test_user ・対象のユーザ:test_user ・対象の共有定義のid:54

curl -v -k -X DELETE \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' -H 'x-xsrf-token:07axhWTA-NhmIwbAcgFaxST4MvyiRFSGD4bI' \
-b 'operator_type0_session=11065e17a1b54988f2122aa3777c8368fde75fd738da034a9bd8d5d6ab033071; _csrf=mPJumS-OrEo0KKqYIcYuPRUY' \
'https://{rootのホスト名}/pxr-block-proxy/pxr-block-proxy/ind/?block=$pxr-root-block&path=%2Fbook-manage%2Fsetting%2Fshare%2F54

■レスポンス

{
    "result": "success"
}

④共有API実行

■リクエスト ・実行ユーザ:appのtype2ユーザ ・対象のユーザ:test_user ・共有対象のイベントカタログコード:1000819

curl -v -k \
-X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-xsrf-token:FX4lFtai-RdPSJJuZPdG7gGPmSHQ2_tWHX2k' \
-b 'operator_type2_session=dfeb177729cce1bdb795145b3b22efca17954f14b5c9d760c758ac40b3e7bd87;_csrf=C5O7UK3D0O2lJw69pQcegSpS' \
-d '{
    "userId": "test_user",
    "updatedAt": {
        "start": "2023-08-18T17:01:00.000+0900",
        "end": "2024-03-18T18:00:00.000+0900"
    },
    "event": [
        {
            "_value": 1000819,
            "_ver": 1
        }
    ]
}' \
'https://{app1のホスト名}/pxr-block-proxy/pxr-block-proxy/?&path=%2Fbook-operate%2Fshare'

■レスポンス 以前のバージョンは正常に共有できないようになっていた。

{
    "status": 400,
    "message": "いずれの状態共有機能定義においても、リクエストされたデータ種を共有できるように許可されていません"
}
r-saito-cw commented 3 months ago

先週は会議での情報共有ありがとうございました。状況確認してみますね。

r-saito-cw commented 3 months ago

@jou-imaizumi 情報整理ができましたので、回答します。

まず、前回の定例会合にてお伝えした通り、APIトークンの使用による部分についての条件があります。 APIトークンが有効な間は同じオペレーターからの同じリクエストでは可否判定が行われない仕様です。 即時実行していると伺いましたので、寿命のパラメータを変更してお試しください。

また、貼っていただいた1月のレスポンスには「蓄積できることの確認」がなく、その後の結果の信頼性が不明な部分がありました。前段での確認ほか、⑥で別オペレータで実行していたのではといった可能性もあるのではと推定しております。

「requireConsent」やバージョンアップとは、無関係です。

CLOSEしてよろしければ、1週間をめどにCLOSEします。

r-saito-cw commented 3 months ago

@jou-imaizumi トークン寿命のパラメータは以下です。

manifest の eks/configmap/root/access-control-manage-service-container.yaml に記載されている default.yaml → defaultExpire → addMinutes 単位は分のため、最小設定は1分です。

本Issueは一旦の回答を終えましたので、明日CLOSEいたします。

r-saito-cw commented 2 months ago

本件、1週間経過しましたのでCLOSEします。必要があれば再OPENについてご連絡ください。