diff --git a/.gitignore b/.gitignore index 485dee6..90da14d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ .idea +minio +db-data +.ipynb_checkpoints \ No newline at end of file diff --git a/.ipynb_checkpoints/student-claim-checkpoint.ipynb b/.ipynb_checkpoints/student-claim-checkpoint.ipynb new file mode 100644 index 0000000..030b5c4 --- /dev/null +++ b/.ipynb_checkpoints/student-claim-checkpoint.ipynb @@ -0,0 +1,1060 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 515, + "id": "3f0dd619", + "metadata": {}, + "outputs": [], + "source": [ + "import requests\n", + "import random\n", + "import json" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "47d42ec6", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 516, + "id": "22c16507", + "metadata": {}, + "outputs": [], + "source": [ + "base_url = \"http://localhost:8081\"" + ] + }, + { + "cell_type": "code", + "execution_count": 517, + "id": "4c0e4ef1", + "metadata": {}, + "outputs": [], + "source": [ + "resp = requests.get(base_url)\n", + "assert resp.status_code == 404\n", + "assert resp.json()[\"status\"] == 404\n", + "assert resp.json()[\"error\"] == \"Not Found\"" + ] + }, + { + "cell_type": "code", + "execution_count": 518, + "id": "27da0f32", + "metadata": {}, + "outputs": [], + "source": [ + "resp = requests.get(\"%s/api/docs/swagger.json\"%base_url)\n", + "assert resp.status_code == 200\n", + "assert resp.json()[\"swagger\"] == \"2.0\"\n", + "assert resp.json()[\"paths\"] != None" + ] + }, + { + "cell_type": "code", + "execution_count": 519, + "id": "0edbbada", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "dict_keys(['/api/v1/Institute/{entityId}', '/api/docs/Institute.json', '/api/v1/Institute/invite', '/api/v1/Institute/sign', '/api/v1/Institute/search', '/api/v1/Institute', '/api/v1/Institute/{entityId}/{property}/{propertyId}', '/api/v1/Institute/{entityId}/{property}', '/api/v1/Institute/{entityId}/{property}/{propertyId}/send', '/api/v1/Teacher/{entityId}', '/api/docs/Teacher.json', '/api/v1/Teacher/invite', '/api/v1/Teacher/sign', '/api/v1/Teacher/search', '/api/v1/Teacher', '/api/v1/Teacher/{entityId}/{property}/{propertyId}', '/api/v1/Teacher/{entityId}/{property}', '/api/v1/Teacher/{entityId}/{property}/{propertyId}/send', '/api/v1/BaseAttestationField/{entityId}', '/api/docs/BaseAttestationField.json', '/api/v1/BaseAttestationField/invite', '/api/v1/BaseAttestationField/sign', '/api/v1/BaseAttestationField/search', '/api/v1/BaseAttestationField', '/api/v1/BaseAttestationField/{entityId}/{property}/{propertyId}', '/api/v1/BaseAttestationField/{entityId}/{property}', '/api/v1/BaseAttestationField/{entityId}/{property}/{propertyId}/send', '/api/v1/Student/{entityId}', '/api/docs/Student.json', '/api/v1/Student/invite', '/api/v1/Student/sign', '/api/v1/Student/search', '/api/v1/Student', '/api/v1/Student/{entityId}/{property}/{propertyId}', '/api/v1/Student/{entityId}/{property}', '/api/v1/Student/{entityId}/{property}/{propertyId}/send', '/api/v1/Common/{entityId}', '/api/docs/Common.json', '/api/v1/Common/invite', '/api/v1/Common/sign', '/api/v1/Common/search', '/api/v1/Common', '/api/v1/Common/{entityId}/{property}/{propertyId}', '/api/v1/Common/{entityId}/{property}', '/api/v1/Common/{entityId}/{property}/{propertyId}/send'])" + ] + }, + "execution_count": 519, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "swaggerJson = resp.json()\n", + "swaggerJson[\"paths\"].keys()" + ] + }, + { + "cell_type": "code", + "execution_count": 520, + "id": "96d0bcfe", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'/api/docs/Institute.json'" + ] + }, + "execution_count": 520, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "jsonUrl = [f for f in swaggerJson[\"paths\"].keys() if \".json\" in f][0]\n", + "jsonUrl" + ] + }, + { + "cell_type": "code", + "execution_count": 521, + "id": "180d3352", + "metadata": {}, + "outputs": [], + "source": [ + "resp = requests.get(\"%s%s\"%(base_url, jsonUrl))\n", + "assert resp.status_code == 200" + ] + }, + { + "cell_type": "code", + "execution_count": 522, + "id": "9825fec2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'Institute': {'$id': '#/properties/Institute',\n", + " 'type': 'object',\n", + " 'title': 'The Institute Schema',\n", + " 'required': [],\n", + " 'properties': {'instituteName': {'$id': '#/properties/instituteName',\n", + " 'type': 'string',\n", + " 'title': 'Institute Name'},\n", + " 'address': {'type': 'object',\n", + " 'required': [],\n", + " 'properties': {'plot': {'type': 'string', 'title': 'Plot'},\n", + " 'street': {'type': 'string', 'title': 'Street'},\n", + " 'landmark': {'type': 'string', 'title': 'Landmark'},\n", + " 'locality': {'type': 'string', 'title': 'Locality'},\n", + " 'state': {'type': 'string', 'title': 'State'},\n", + " 'district': {'type': 'string', 'title': 'District'},\n", + " 'village': {'type': 'string', 'title': 'Village/Town/City'},\n", + " 'pincode': {'type': 'string', 'title': 'Pincode'}}},\n", + " 'establishmentYear': {'$id': '#/properties/establishmentYear',\n", + " 'type': 'string',\n", + " 'title': 'Year of establishment of institute'},\n", + " 'gstnId': {'$id': '#/properties/gstnId',\n", + " 'type': 'string',\n", + " 'title': 'GSTN ID'},\n", + " 'contactNumber': {'$id': '#/properties/contactNumber',\n", + " 'type': 'string',\n", + " 'title': 'Landline / Mobile'},\n", + " 'email': {'$id': '#/properties/email',\n", + " 'type': 'string',\n", + " 'format': 'email',\n", + " 'title': 'Email'},\n", + " 'website': {'$id': '#/properties/website',\n", + " 'type': 'string',\n", + " 'format': 'uri',\n", + " 'title': 'Website'},\n", + " 'category': {'$id': '#/properties/category',\n", + " 'type': 'string',\n", + " 'title': 'Institute Category (Primary/Secondary etc)',\n", + " 'enum': ['Primary', 'Secondary']},\n", + " 'schoolType': {'$id': '#/properties/schoolType',\n", + " 'type': 'string',\n", + " 'title': 'School Type ',\n", + " 'enum': ['Boys', 'Girls', 'Co-ed']},\n", + " 'instituteManagement': {'$id': '#/properties/instituteManagement',\n", + " 'type': 'string',\n", + " 'title': 'Management of institute'},\n", + " 'committee': {'$id': '#/properties/instituteManagement',\n", + " 'type': 'string',\n", + " 'title': 'Name of Trust / Society / Managing Committee'},\n", + " 'adminName': {'$id': '#/properties/adminName',\n", + " 'type': 'string',\n", + " 'title': 'Principal / Dean / Head - Full Name'},\n", + " 'adminEmail': {'$id': '#/properties/adminEmail',\n", + " 'type': 'string',\n", + " 'title': 'Principal / Dean / Head - Email'},\n", + " 'adminMobile': {'$id': '#/properties/adminMobile',\n", + " 'type': 'string',\n", + " 'title': 'Principal / Dean / Head - Mobile'},\n", + " 'affiliation': {'type': 'array',\n", + " 'items': {'type': 'object',\n", + " 'properties': {'medium': {'type': 'string',\n", + " 'title': 'Medium of Education'},\n", + " 'board': {'type': 'string', 'title': 'Affiliations Board'},\n", + " 'affiliationNumber': {'type': 'string', 'title': 'Affiliation Number'},\n", + " 'grantYear': {'type': 'string', 'title': 'Grant year'},\n", + " 'expiryYear': {'type': 'string', 'title': 'Expiry Year'},\n", + " 'classes': {'type': 'array',\n", + " 'items': {'type': 'string'},\n", + " 'title': 'Classes / Grades'}}},\n", + " 'title': 'Affiliation'}}}}" + ] + }, + "execution_count": 522, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "resp.json()" + ] + }, + { + "cell_type": "code", + "execution_count": 523, + "id": "50e5149a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['/api/v1/Institute/invite',\n", + " '/api/v1/Teacher/invite',\n", + " '/api/v1/BaseAttestationField/invite',\n", + " '/api/v1/Student/invite',\n", + " '/api/v1/Common/invite']" + ] + }, + "execution_count": 523, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "[f for f in swaggerJson[\"paths\"].keys() if \"/invite\" in f]" + ] + }, + { + "cell_type": "code", + "execution_count": 524, + "id": "8bd262de", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'/api/v1/Teacher/invite'" + ] + }, + "execution_count": 524, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "inviteUrl = [f for f in swaggerJson[\"paths\"].keys() if \"/invite\" in f][1]\n", + "inviteUrl" + ] + }, + { + "cell_type": "code", + "execution_count": 525, + "id": "9ad5283a", + "metadata": {}, + "outputs": [], + "source": [ + "def entity_for(userId):\n", + " return {\"personalDetails\":{\n", + " \"userName\":userId,\n", + " \"dob\":\"2020-12-12\",\n", + " },\n", + " \"IdentityDetails\":{\"type\":\"id\",\"value\":userId}, \n", + " \"ContactDetails\":{ \"mobile\":\"%s\"%userId,\"email\":\"%s@example.com\"%userId,\n", + " \"address\":{\"street\":\"abc\",\"state\":\"Karnataka\",\"pincode\":\"560001\"}}\n", + " }" + ] + }, + { + "cell_type": "code", + "execution_count": 526, + "id": "547ea7ab", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'{\"personalDetails\": {\"userName\": 12, \"dob\": \"2020-12-12\"}, \"IdentityDetails\": {\"type\": \"id\", \"value\": 12}, \"ContactDetails\": {\"mobile\": \"12\", \"email\": \"12@example.com\", \"address\": {\"street\": \"abc\", \"state\": \"Karnataka\", \"pincode\": \"560001\"}}}'" + ] + }, + "execution_count": 526, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "userId=12\n", + "json.dumps(entity_for(userId))" + ] + }, + { + "cell_type": "markdown", + "id": "749a18fc", + "metadata": {}, + "source": [ + "# invite" + ] + }, + { + "cell_type": "code", + "execution_count": 527, + "id": "0fbcad28", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "b'{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1644163757356,\"params\":{\"resmsgid\":\"\",\"msgid\":\"76eda9e2-23d5-448a-820e-3a89e62ab45a\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Teacher\":{\"osid\":\"1-f5115e92-9ceb-4898-a08a-44d6e9c76897\"}}}'\n", + "{'id': 'sunbird-rc.registry.invite', 'ver': '1.0', 'ets': 1644163757356, 'params': {'resmsgid': '', 'msgid': '76eda9e2-23d5-448a-820e-3a89e62ab45a', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'Teacher': {'osid': '1-f5115e92-9ceb-4898-a08a-44d6e9c76897'}}}\n" + ] + } + ], + "source": [ + "userId =str(random.randint(1e10,1e11))\n", + "resp = requests.post(\"%s%s\"%(base_url, inviteUrl), json=entity_for(userId)\n", + ")\n", + "print(resp.content)\n", + "assert resp.status_code == 200\n", + "print(resp.json())\n", + "assert(resp.json()[\"id\"]==\"sunbird-rc.registry.invite\")\n", + "assert resp.json()[\"params\"][\"status\"] == \"SUCCESSFUL\"\n", + "entity_name=next(iter(resp.json()[\"result\"].keys()))\n", + "assert \"Teacher\"==entity_name\n", + "idx = resp.json()[\"result\"][entity_name][\"osid\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 528, + "id": "e0096a4c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'1-f5115e92-9ceb-4898-a08a-44d6e9c76897'" + ] + }, + "execution_count": 528, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "idx" + ] + }, + { + "cell_type": "code", + "execution_count": 529, + "id": "a4ff65b9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'61532629118'" + ] + }, + "execution_count": 529, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "userId" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bdb276a7", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 613, + "id": "9e5c997a", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n" + ] + } + ], + "source": [ + "headers = {\n", + " 'content-type': 'application/x-www-form-urlencoded',\n", + "}\n", + "\n", + "data = {\n", + " 'client_id': 'registry-frontend',\n", + " 'username': userId,\n", + " 'password': 'abcd@123',\n", + " 'grant_type': 'password'\n", + "}\n", + "\n", + "response = requests.post('http://keycloak:8080/auth/realms/sunbird-rc/protocol/openid-connect/token', headers=headers, data=data)\n", + "\n", + "print(response.status_code)\n", + "token = response.json()[\"access_token\"]\n" + ] + }, + { + "cell_type": "code", + "execution_count": 614, + "id": "5162487f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJaUk4xbE9rdkloSjEzQjdjcEVXQlBIQURER01lZUFHVmUyTkx2QlpLT29vIn0.eyJleHAiOjE2NDQxNzUzNTIsImlhdCI6MTY0NDE3NDc1MiwianRpIjoiNTg3NDAzOTItNTAyMS00OTE5LTlmNmItNjU4OGE4MzNlOTM4IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIyYWViNzcwZS00ZTE1LTQ4YzUtOTViNC1hZTRhM2FhMzc2NzUiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiJkNzRjMDk2Mi01MjM4LTRiYjEtYWVlYi1iZDAzNDhjOGE5NjkiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiI2MTUzMjYyOTExOCIsImVudGl0eSI6WyJUZWFjaGVyIl0sImVtYWlsIjoiNjE1MzI2MjkxMThAZXhhbXBsZS5jb20ifQ.Ni3htjQFcIIEbu68WIWMXYptTI9PJ7IrEDbhluXZmWlH_eKnb5f_vaCiZPfe85yR5ITKYxbHW0gGmcYJFKzhrJqTV2_EJfAFAfwPNEVG2jDeKcLp0-YK-meXD07__1ZHmg50V89aqZXK8-W1iOFhQqC5ZXuEXs46XljBdGgMZYG9um8-zieC8-7DIZi2Yy1p48kuC2VsZ7OCxhTMrNqgFjKkV8qKsXHzFCw7ObKMRWo8BsNVmwlHm0Ionb4aJAtJiY2gkX_SVfXwTPX0DoC6gppHzah7fYK9_tlAPxpOSldIYbUGf4oeU2eCAcjsuzVUloDXO8z35n60NOM0DVLEkg'" + ] + }, + "execution_count": 614, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "token\n" + ] + }, + { + "cell_type": "code", + "execution_count": 569, + "id": "a398971a", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n" + ] + }, + { + "data": { + "text/plain": [ + "(200,\n", + " {'osUpdatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'ContactDetails': {'osid': '1-30a7cad8-9369-4ba7-bc47-376347fad897',\n", + " 'osUpdatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'address': {'osid': '1-5777a40b-4879-4aa6-a3b5-4d4ffef95382',\n", + " 'pincode': '560001',\n", + " 'osUpdatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osUpdatedBy': '',\n", + " 'street': 'abc',\n", + " 'osCreatedBy': '',\n", + " 'state': 'Karnataka'},\n", + " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osUpdatedBy': '',\n", + " 'osCreatedBy': '',\n", + " 'mobile': '61532629118',\n", + " 'email': '61532629118@example.com'},\n", + " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osUpdatedBy': '',\n", + " 'IdentityDetails': {'osid': '1-aa981655-301b-4f95-8207-508a0266dec2',\n", + " 'osUpdatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osUpdatedBy': '',\n", + " 'osCreatedBy': '',\n", + " 'type': 'id',\n", + " 'value': '61532629118'},\n", + " 'personalDetails': {'osid': '1-117254f3-ef91-428e-a4cd-486ae6b198f3',\n", + " 'osUpdatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osUpdatedBy': '',\n", + " 'dob': '2020-12-12',\n", + " 'osCreatedBy': '',\n", + " 'userName': '61532629118'},\n", + " 'osCreatedBy': '',\n", + " 'osid': '1-f5115e92-9ceb-4898-a08a-44d6e9c76897',\n", + " 'osOwner': ['2aeb770e-4e15-48c5-95b4-ae4a3aa37675']})" + ] + }, + "execution_count": 569, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'Authorization': 'Bearer %s'%token, \n", + "}\n", + "\n", + "response = requests.get('http://localhost:8081/api/v1/%s/%s'%(entity_name, idx), headers=headers)\n", + "print(response.status_code)\n", + "obj = response.json()\n", + "response.status_code, response.json()" + ] + }, + { + "cell_type": "markdown", + "id": "e164092c", + "metadata": {}, + "source": [ + "## update name and experience" + ] + }, + { + "cell_type": "code", + "execution_count": 570, + "id": "b31e0286", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\"ContactDetails\":{\"name\": \"test name 61532629118\"}, \"experience\":[{\"institute\":\"Some other school\"}]}\n" + ] + } + ], + "source": [ + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'authorization': 'bearer %s'%token,\n", + "}\n", + "\n", + "data = '{\"ContactDetails\":{\"name\": \"test name %s\"}, \"experience\":[{\"institute\":\"Some other school\"}]}'%userId\n", + "print(data)\n", + "response = requests.put('http://localhost:8081/api/v1/Teacher/%s'%idx, headers=headers, data=data)" + ] + }, + { + "cell_type": "code", + "execution_count": 571, + "id": "8ae86741", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(200,\n", + " {'id': 'sunbird-rc.registry.update',\n", + " 'ver': '1.0',\n", + " 'ets': 1644170925208,\n", + " 'params': {'resmsgid': '',\n", + " 'msgid': 'f5b2bd58-ecfa-45ae-b001-e25e0b034759',\n", + " 'err': '',\n", + " 'status': 'SUCCESSFUL',\n", + " 'errmsg': ''},\n", + " 'responseCode': 'OK'})" + ] + }, + "execution_count": 571, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "response.status_code, response.json()" + ] + }, + { + "cell_type": "code", + "execution_count": 572, + "id": "6bc19944", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'osUpdatedAt': '2022-02-06T18:08:48.460Z', 'ContactDetails': {'osid': '1-4d2f8f80-d505-440e-92f9-689a6988a011', 'osUpdatedAt': '2022-02-06T18:08:48.460Z', 'osCreatedAt': '2022-02-06T16:09:18.987Z', 'osUpdatedBy': 'osrc', 'osCreatedBy': '', 'mobile': '61532629118', 'name': 'test name 61532629118', 'email': '61532629118@example.com'}, 'osCreatedAt': '2022-02-06T16:09:18.987Z', 'osUpdatedBy': 'osrc', 'IdentityDetails': {'osid': '1-aa981655-301b-4f95-8207-508a0266dec2', 'osUpdatedAt': '2022-02-06T18:08:48.460Z', 'osCreatedAt': '2022-02-06T16:09:18.987Z', 'osUpdatedBy': 'osrc', 'osCreatedBy': '', 'type': 'id', 'value': '61532629118'}, 'personalDetails': {'osid': '1-117254f3-ef91-428e-a4cd-486ae6b198f3', 'osUpdatedAt': '2022-02-06T18:08:48.460Z', 'osCreatedAt': '2022-02-06T16:09:18.987Z', 'osUpdatedBy': 'osrc', 'dob': '2020-12-12', 'osCreatedBy': '', 'userName': '61532629118'}, 'osCreatedBy': '', 'experience': [{'osUpdatedAt': '2022-02-06T18:08:48.460Z', 'osUpdatedBy': 'osrc', 'institute': 'Some other school', 'osid': '1-ee2992de-5450-4398-b5eb-94d12a3f384e'}], 'osid': '1-f5115e92-9ceb-4898-a08a-44d6e9c76897', 'osOwner': ['2aeb770e-4e15-48c5-95b4-ae4a3aa37675']}\n" + ] + }, + { + "data": { + "text/plain": [ + "{'osUpdatedAt': '2022-02-06T18:08:48.460Z',\n", + " 'ContactDetails': {'osid': '1-4d2f8f80-d505-440e-92f9-689a6988a011',\n", + " 'osUpdatedAt': '2022-02-06T18:08:48.460Z',\n", + " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osUpdatedBy': 'osrc',\n", + " 'osCreatedBy': '',\n", + " 'mobile': '61532629118',\n", + " 'name': 'test name 61532629118',\n", + " 'email': '61532629118@example.com'},\n", + " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osUpdatedBy': 'osrc',\n", + " 'IdentityDetails': {'osid': '1-aa981655-301b-4f95-8207-508a0266dec2',\n", + " 'osUpdatedAt': '2022-02-06T18:08:48.460Z',\n", + " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osUpdatedBy': 'osrc',\n", + " 'osCreatedBy': '',\n", + " 'type': 'id',\n", + " 'value': '61532629118'},\n", + " 'personalDetails': {'osid': '1-117254f3-ef91-428e-a4cd-486ae6b198f3',\n", + " 'osUpdatedAt': '2022-02-06T18:08:48.460Z',\n", + " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osUpdatedBy': 'osrc',\n", + " 'dob': '2020-12-12',\n", + " 'osCreatedBy': '',\n", + " 'userName': '61532629118'},\n", + " 'osCreatedBy': '',\n", + " 'experience': [{'osUpdatedAt': '2022-02-06T18:08:48.460Z',\n", + " 'osUpdatedBy': 'osrc',\n", + " 'institute': 'Some other school',\n", + " 'osid': '1-ee2992de-5450-4398-b5eb-94d12a3f384e'}],\n", + " 'osid': '1-f5115e92-9ceb-4898-a08a-44d6e9c76897',\n", + " 'osOwner': ['2aeb770e-4e15-48c5-95b4-ae4a3aa37675']}" + ] + }, + "execution_count": 572, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'Authorization': 'Bearer %s'%token, \n", + "}\n", + "\n", + "response = requests.get('http://localhost:8081/api/v1/%s/%s'%(entity_name, idx), headers=headers)\n", + "assert response.status_code == 200\n", + "print(response.json())\n", + "assert response.json()[\"ContactDetails\"][\"name\"] == \"test name %s\"%userId\n", + "response.json()" + ] + }, + { + "cell_type": "markdown", + "id": "6eb1a18e", + "metadata": {}, + "source": [ + "## invite a student" + ] + }, + { + "cell_type": "code", + "execution_count": 626, + "id": "f85dc761", + "metadata": {}, + "outputs": [], + "source": [ + "headers = {\n", + " 'content-type': 'application/json',\n", + "}\n", + "\n", + "data = {\"identityDetails\":{\n", + " \"fullName\":\"Test %s\"%userId, \n", + " \"gender\":\"Male\"\n", + " },\n", + " \"educationDetails\":[{\n", + " \"institute\":\"Some other school\"\n", + " }\n", + " ]\n", + " }\n", + "#{\"name\": \"Prashant Joshi\",\\n\\t\\t\"phoneNumber\": \"9876543210\",\\n\\t\\t\"email\": \"prashant@upps.in\",\\n\\t\\t\"school\": \"UP Public School\"\\n\\t}\n", + "\n", + "\n", + "response = requests.post('http://localhost:8081/api/v1/Student/invite', headers=headers, json=data)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 627, + "id": "a486eb16", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'id': 'sunbird-rc.registry.invite',\n", + " 'ver': '1.0',\n", + " 'ets': 1644175094599,\n", + " 'params': {'resmsgid': '',\n", + " 'msgid': '0faa774a-1cb7-403b-905e-f07a483cc1af',\n", + " 'err': '',\n", + " 'status': 'SUCCESSFUL',\n", + " 'errmsg': ''},\n", + " 'responseCode': 'OK',\n", + " 'result': {'Student': {'osid': '1-42190594-210d-4ebf-8904-5cb2e222aa74'}}}" + ] + }, + "execution_count": 627, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "response.json()\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 628, + "id": "c634f6ae", + "metadata": {}, + "outputs": [], + "source": [ + "sid = response.json()[\"result\"][\"Student\"][\"osid\"]\n" + ] + }, + { + "cell_type": "code", + "execution_count": 629, + "id": "24a56dc8", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n" + ] + }, + { + "data": { + "text/plain": [ + "{'educationDetails': [{'institute': 'Some other school',\n", + " 'osid': '1-d3248abc-385f-4e8e-8856-0c0c0bbfa2e2'}],\n", + " 'osid': '1-42190594-210d-4ebf-8904-5cb2e222aa74',\n", + " 'identityDetails': {'osid': '1-c81f449f-6b77-40ab-bc08-7cf9df5289e7',\n", + " 'gender': 'Male',\n", + " 'fullName': 'Test 61532629118'}}" + ] + }, + "execution_count": 629, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'Authorization': 'Bearer %s'%token, \n", + "}\n", + "\n", + "response = requests.get('http://localhost:8081/api/v1/%s/%s'%(\"Student\", sid), headers=headers)\n", + "print(response.status_code)\n", + "response.json()\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "63492c6c", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "f84e8451", + "metadata": {}, + "source": [ + "## claim" + ] + }, + { + "cell_type": "code", + "execution_count": 630, + "id": "141a9dc9", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n" + ] + }, + { + "data": { + "text/plain": [ + "{'id': 'sunbird-rc.registry.send',\n", + " 'ver': '1.0',\n", + " 'ets': 1644175100079,\n", + " 'params': {'resmsgid': '',\n", + " 'msgid': '6f1b856a-1b69-47bd-8211-ad7052a03c81',\n", + " 'err': '',\n", + " 'status': 'SUCCESSFUL',\n", + " 'errmsg': ''},\n", + " 'responseCode': 'OK',\n", + " 'result': {'attestationOSID': '1-f5b466f3-c5eb-4eea-bc5f-c7e5ae8f60ab'}}" + ] + }, + "execution_count": 630, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "\n", + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'authorization': 'bearer %s'%token,\n", + "}\n", + "\n", + "params = (\n", + " ('send', 'true'),\n", + ")\n", + "\n", + "data = {\n", + " \"entityName\":\"Student\",\n", + " \"entityId\":\"%s\"%sid,\n", + " \"name\":\"schoolId\",\n", + " \"additionalInput\":{\"idx\": \"%s\"%sid}\n", + "}\n", + "response = requests.put('http://localhost:8081/api/v1/send', headers=headers, params=params, json=data)\n", + "print(response.status_code)\n", + "response.json()\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 632, + "id": "7647f0e1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n" + ] + }, + { + "data": { + "text/plain": [ + "{'educationDetails': [{'institute': 'Some other school',\n", + " 'osid': '1-d3248abc-385f-4e8e-8856-0c0c0bbfa2e2'}],\n", + " 'osid': '1-42190594-210d-4ebf-8904-5cb2e222aa74',\n", + " 'identityDetails': {'osid': '1-c81f449f-6b77-40ab-bc08-7cf9df5289e7',\n", + " 'gender': 'Male',\n", + " 'fullName': 'Test 61532629118'},\n", + " 'schoolId': [{'additionalInput': {'osid': '1-4ddd0126-289d-4bd2-8b68-82e271650dac',\n", + " 'idx': '1-42190594-210d-4ebf-8904-5cb2e222aa74'},\n", + " 'entityName': 'Student',\n", + " '_osState': 'DRAFT',\n", + " 'name': 'schoolId',\n", + " 'entityId': '1-42190594-210d-4ebf-8904-5cb2e222aa74',\n", + " 'osid': '1-f5b466f3-c5eb-4eea-bc5f-c7e5ae8f60ab',\n", + " 'propertyData': '{\"name\":\"Test 61532629118\",\"institute\":\"Some other school\"}'}]}" + ] + }, + "execution_count": 632, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'Authorization': 'Bearer %s'%token, \n", + "}\n", + "\n", + "response = requests.get('http://localhost:8081/api/v1/%s/%s'%(\"Student\", sid), headers=headers)\n", + "print(response.status_code)\n", + "response.json()" + ] + }, + { + "cell_type": "markdown", + "id": "4ca1ce2e", + "metadata": {}, + "source": [ + "## As a Teacher get claims" + ] + }, + { + "cell_type": "code", + "execution_count": 636, + "id": "9e091faf", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200 [{'id': '5249adac-4aa3-48a0-af65-3dc4ef475cf9', 'entity': 'Student', 'entityId': '1-5f19dcf9-42c6-4579-b9ae-0f28e681e610', 'propertyURI': '', 'createdAt': '2022-02-06T19:14:46.762+00:00', 'attestedOn': '2022-02-06T19:16:08.143+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'closed': True}, {'id': 'bf135815-6670-41ef-b10f-826a18b25df5', 'entity': 'Student', 'entityId': '1-42190594-210d-4ebf-8904-5cb2e222aa74', 'propertyURI': '', 'createdAt': '2022-02-06T19:18:20.597+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'closed': False}]\n" + ] + }, + { + "data": { + "text/plain": [ + "[{'id': '5249adac-4aa3-48a0-af65-3dc4ef475cf9',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-5f19dcf9-42c6-4579-b9ae-0f28e681e610',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-06T19:14:46.762+00:00',\n", + " 'attestedOn': '2022-02-06T19:16:08.143+00:00',\n", + " 'status': 'CLOSED',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'closed': True},\n", + " {'id': 'bf135815-6670-41ef-b10f-826a18b25df5',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-42190594-210d-4ebf-8904-5cb2e222aa74',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-06T19:18:20.597+00:00',\n", + " 'attestedOn': None,\n", + " 'status': 'OPEN',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'closed': False}]" + ] + }, + "execution_count": 636, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'Authorization': 'Bearer %s'%token, \n", + "}\n", + "\n", + "response = requests.get('http://localhost:8081/api/v1/Teacher/claims', headers=headers)\n", + "print(response.status_code, response.json())\n", + "claim_id = response.json()[-1][\"id\"]\n", + "response.json()" + ] + }, + { + "cell_type": "markdown", + "id": "e243966b", + "metadata": {}, + "source": [ + "## approve the claim" + ] + }, + { + "cell_type": "code", + "execution_count": 637, + "id": "336de33a", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n" + ] + }, + { + "data": { + "text/plain": [ + "{'resmsgid': '',\n", + " 'msgid': 'ec98c5a7-b012-4969-b95e-2a87345977a3',\n", + " 'err': '',\n", + " 'status': 'SUCCESSFUL',\n", + " 'errmsg': ''}" + ] + }, + "execution_count": 637, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'Authorization': 'Bearer %s'%token, \n", + "}\n", + "data = {\n", + " \"action\":\"GRANT_CLAIM\",\n", + "}\n", + "response = requests.post('http://localhost:8081/api/v1/Teacher/claims/%s/attest'%claim_id, headers=headers, json=data)\n", + "print(response.status_code)\n", + "response.json()" + ] + }, + { + "cell_type": "code", + "execution_count": 640, + "id": "a1247108", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n" + ] + }, + { + "data": { + "text/plain": [ + "[{'id': '5249adac-4aa3-48a0-af65-3dc4ef475cf9',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-5f19dcf9-42c6-4579-b9ae-0f28e681e610',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-06T19:14:46.762+00:00',\n", + " 'attestedOn': '2022-02-06T19:16:08.143+00:00',\n", + " 'status': 'CLOSED',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'closed': True},\n", + " {'id': 'bf135815-6670-41ef-b10f-826a18b25df5',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-42190594-210d-4ebf-8904-5cb2e222aa74',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-06T19:18:20.597+00:00',\n", + " 'attestedOn': '2022-02-06T19:19:58.840+00:00',\n", + " 'status': 'CLOSED',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'closed': True}]" + ] + }, + "execution_count": 640, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'Authorization': 'Bearer %s'%token, \n", + "}\n", + "\n", + "response = requests.get('http://localhost:8081/api/v1/Teacher/claims', headers=headers)\n", + "print(response.status_code)\n", + "claim_id = response.json()[0][\"id\"]\n", + "response.json()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docker-compose.yml b/docker-compose.yml index 12e989b..9eb71af 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,6 @@ version: "2.4" services: - mock-sms: - image: dockerhub/sms-service - ports: - - "8765:8765" redis: image: redis ports: @@ -24,6 +20,8 @@ services: retries: 4 db: image: postgres + volumes: + - ./db-data:/var/lib/postgresql/data ports: - "5432:5432" environment: @@ -31,7 +29,7 @@ services: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres registry: - image: dockerhub/sunbird-rc-core:latest + image: dockerhub/sunbird-rc-core:pre-v0.0.8-7 environment: - authentication_enabled=true - signature_enabled=false @@ -39,16 +37,20 @@ services: - connectionInfo_username=postgres - connectionInfo_password=postgres - elastic_search_connection_url=es:9200 - - search_provider=dev.sunbirdrc.registry.service.ElasticSearchService + - search_providerName=dev.sunbirdrc.registry.service.ElasticSearchService - sunbird_sso_realm=sunbird-rc - - sunbird_sso_url=http://keycloak:8080/auth + - sunbird_sso_url=https://demo-education-registry.xiv.in/auth - sunbird_sso_admin_client_id=admin-api - - sunbird_sso_admin_client_secret=014b8593-b82e-4f65-ae7a-b287c737fca4 + - sunbird_sso_admin_client_secret=d112548e-09b8-411d-a1e0-b5870247affa - sunbird_sso_client_id=registry-frontend - claims_url=http://claim-ms:8082 - - sunbird_set_default_password=true - - sunbird_default_password=abcd@123 - - logging.level.root=DEBUG + - sunbird_keycloak_user_set_password=true + - sunbird_keycloak_user_password=abcd@123 + - filestorage_connection_url=http://file-storage:9000 + - filestorage_access_key=admin + - filestorage_secret_key=ced9862ea6 + - filestorage_bucket_key=ndear + - external_entities=board-cbse ports: - "8081:8081" volumes: @@ -59,8 +61,11 @@ services: db: condition: service_started keycloak: - image: dockerhub/ndear-keycloak + image: dockerhub/ndear-keycloak:pre-v0.0.8 + volumes: + - ${PWD}/imports:/opt/jboss/keycloak/imports environment: + - KEYCLOAK_LOGO=https://svgshare.com/i/hCr.svg - DB_VENDOR=postgres - DB_ADDR=db - DB_PORT=5432 @@ -69,6 +74,8 @@ services: - DB_PASSWORD=postgres - KEYCLOAK_USER=admin - KEYCLOAK_PASSWORD=admin + - KEYCLOAK_IMPORT=/opt/jboss/keycloak/imports/realm-export.json + - PROXY_ADDRESS_FORWARDING=true healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:9990/ || exit 1"] @@ -82,8 +89,7 @@ services: db: condition: service_started claim-ms: - image: dockerhub/open-saber-claim-ms - #image: dockerhub/sunbird-rc-claim-ms + image: dockerhub/sunbird-rc-claim-ms:v0.0.5 environment: - connectionInfo_uri=jdbc:postgresql://db:5432/registry - connectionInfo_username=postgres @@ -97,3 +103,19 @@ services: condition: service_started registry: condition: service_started + file-storage: + image: quay.io/minio/minio + volumes: + - ./minio/data:/data + environment: + - MINIO_ROOT_USER=admin + - MINIO_ROOT_PASSWORD=ced9862ea6 + command: server --address 0.0.0.0:9000 --console-address 0.0.0.0:9001 /data + ports: + - "9000:9000" + - "9001:9001" + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ] + interval: 30s + timeout: 20s + retries: 3 diff --git a/edu-attestation-flows.ipynb b/edu-attestation-flows.ipynb new file mode 100644 index 0000000..27f5b56 --- /dev/null +++ b/edu-attestation-flows.ipynb @@ -0,0 +1,1090 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 34, + "id": "dc3d2384", + "metadata": {}, + "outputs": [], + "source": [ + "import requests\n", + "import random\n", + "import json" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "id": "f3912238", + "metadata": {}, + "outputs": [], + "source": [ + "baseUrl = \"http://localhost:8081/api/v1/\"\n", + "keycloakUrl = \"http://keycloak:8080\"" + ] + }, + { + "cell_type": "markdown", + "id": "4194d872", + "metadata": {}, + "source": [ + "# Institute invite" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "id": "1a79ff08", + "metadata": {}, + "outputs": [], + "source": [ + "instituteUserId = \"admin36@mailinator.com\"\n", + "instituteRequestBody = {\n", + " \"instituteName\": \"te\",\n", + " \"email\": instituteUserId,\n", + " \"contactNumber\": \"!23\"\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "id": "380429d2", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647406890973,\"params\":{\"resmsgid\":\"\",\"msgid\":\"5f29f6d2-2db7-4933-94db-9a2fbc310df9\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Institute\":{\"osid\":\"1-74e00bc3-1f9b-40ab-bf61-be4e1d983e6f\"}}}\n" + ] + } + ], + "source": [ + "headers = {\n", + " 'Content-Type': 'application/json'\n", + "}\n", + "\n", + "response = requests.request(\"POST\", baseUrl + \"Institute/invite\", headers=headers, json=instituteRequestBody)\n", + "\n", + "print(response.text)\n", + "assert response.status_code == 200" + ] + }, + { + "cell_type": "markdown", + "id": "5c3a42c6", + "metadata": {}, + "source": [ + "# get institute token" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "id": "afe497bd", + "metadata": {}, + "outputs": [], + "source": [ + "def getToken(userId):\n", + " headers = {\n", + " 'content-type': 'application/x-www-form-urlencoded',\n", + " }\n", + "\n", + " data = {\n", + " 'client_id': 'registry-frontend',\n", + " 'username': userId,\n", + " 'password': 'abcd@123',\n", + " 'grant_type': 'password'\n", + " }\n", + "\n", + " response = requests.post('%s/auth/realms/sunbird-rc/protocol/openid-connect/token'%(keycloakUrl), headers=headers, data=data)\n", + "# print(response.json())\n", + "# print(response.status_code)\n", + " token = response.json()[\"access_token\"]\n", + " return token\n" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "id": "2635238e", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGRVZ0dExTTDdYMU9pOE5BcmcxU25tN1lRZWVSODc4N3dwTDdwdzJJeE9NIn0.eyJleHAiOjE2NDc0MDc0OTgsImlhdCI6MTY0NzQwNjg5OCwianRpIjoiZDk3NGYwNjUtYzgzYy00ZTA5LThkOTItYjQyNjBmM2U3ZmY4IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI5OWQ2YTI1Zi1iZTY5LTRhOWEtYjYxNy1jYTgxMTVjMDBjMDciLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiIxMDc4ZDlhYy1jOTg1LTQzOTgtOWIzNi0zMjI4YmY3NzUzMGMiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJhZG1pbjM2QG1haWxpbmF0b3IuY29tIiwiZW50aXR5IjpbIkluc3RpdHV0ZSJdLCJlbWFpbCI6ImFkbWluMzZAbWFpbGluYXRvci5jb20ifQ.ifHzE2Z2he3mwqlfJPibukmCEkf2M-kNqohoHFA-miF27WKwuJg8RDwXGHsD7cdvtjVaPLFo-da35QHllkpnuNA1cFAy5D7nzAP5PAShcZjXO8zkDEL307RlzWxVIOB53w8OEGBbfaxIB6bOdfHZkeMkoGUiUu6XnL8AwF8carGQW3zDiR_-jY2OWkHzRAjk-lHYVl6WnXcZs1AaiuoOPAB81CJRQa6XuUaD1GE3lyIpqN7OlgAAl4ad1w6HlAn-MaBj7iBDnErYcYm6yzuaubiYnarQ8EJ7rgdt6LfB1uKabjqG2rbLt_9AtqwiOEM7zmfm-V_-uaf9Ft5L80aDcw\n" + ] + } + ], + "source": [ + "token = getToken(instituteUserId)\n", + "print(token)" + ] + }, + { + "cell_type": "markdown", + "id": "e03f92ca", + "metadata": {}, + "source": [ + "# get institute details" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "id": "6dd13699", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[{\"osUpdatedAt\":\"2022-03-16T05:01:32.760Z\",\"osCreatedAt\":\"2022-03-16T05:01:32.760Z\",\"osUpdatedBy\":\"\",\"contactNumber\":\"!23\",\"osCreatedBy\":\"\",\"osid\":\"1-74e00bc3-1f9b-40ab-bf61-be4e1d983e6f\",\"osOwner\":[\"99d6a25f-be69-4a9a-b617-ca8115c00c07\"],\"email\":\"admin36@mailinator.com\",\"instituteName\":\"te\"}]\n", + "1-74e00bc3-1f9b-40ab-bf61-be4e1d983e6f\n" + ] + } + ], + "source": [ + "\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%token,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"Institute\", headers=headers)\n", + "\n", + "print(response.text)\n", + "intituteOsid = response.json()[0][\"osid\"]\n", + "print(intituteOsid)\n", + "assert response.status_code == 200\n" + ] + }, + { + "cell_type": "markdown", + "id": "f927f44f", + "metadata": {}, + "source": [ + "# Affiliate Institute" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "id": "e2d1cfe8", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "{'id': 'sunbird-rc.registry.update', 'ver': '1.0', 'ets': 1647406905340, 'params': {'resmsgid': '', 'msgid': 'fbeff31e-bb3e-434d-8dff-882082e5a8a1', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK'}\n", + "1-8d6c9916-3c83-494c-abe8-58821e2e9cdc\n" + ] + } + ], + "source": [ + "# add affiliation details\n", + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'authorization': 'bearer %s'%token,\n", + "}\n", + "\n", + "data = \"\"\"{\n", + "\"affiliation\": [\n", + " {\n", + " \"medium\": \"English\",\n", + " \"board\": \"cbse\",\n", + " \"affiliationNumber\": \"123\",\n", + " \"grantYear\": \"2000\",\n", + " \"expiryYear\": \"3001\",\n", + " \"classes\": [\"Class XII\"]\n", + " }\n", + "]\n", + "}\"\"\"\n", + "# print(data)\n", + "response = requests.put('%sInstitute/%s'%(baseUrl, intituteOsid), headers=headers, data=data)\n", + "print(response)\n", + "print(response.json())\n", + "assert response.status_code == 200\n", + "\n", + "\n", + "# get institute details\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%token,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"Institute\", headers=headers)\n", + "\n", + "# print(response.text)\n", + "intituteAffiliateOsid = response.json()[0][\"affiliation\"][0][\"osid\"]\n", + "print(intituteAffiliateOsid)\n", + "assert response.status_code == 200\n" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "id": "31c1a78a", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n", + "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647406908601, 'params': {'resmsgid': '', 'msgid': 'a346839e-580e-40c3-be96-e57a736761dd', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-7dbd15cf-7adb-4d02-a64c-fdd86503eca6'}}\n" + ] + } + ], + "source": [ + "# raise attestation request\n", + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'authorization': 'bearer %s'%token,\n", + "}\n", + "\n", + "params = (\n", + " ('send', 'true'),\n", + ")\n", + "\n", + "data = {\n", + " \"entityName\":\"Institute\",\n", + " \"entityId\":\"%s\"%intituteOsid,\n", + " \"name\":\"instituteAffiliation\",\n", + " \"propertiesOSID\": {\n", + " \"affiliation\": [intituteAffiliateOsid]\n", + " }\n", + "}\n", + "response = requests.put(baseUrl+'send', headers=headers, params=params, json=data)\n", + "print(response.status_code)\n", + "response.json()\n", + "assert response.status_code == 200\n", + "print(response.json())\n", + "assert response.json()[\"params\"][\"status\"] == \"SUCCESSFUL\"" + ] + }, + { + "cell_type": "markdown", + "id": "ca3f2d1c", + "metadata": {}, + "source": [ + "# cbse board attest claims" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "id": "730e0879", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "OPEN\n", + "abf0e852-50cc-4caa-b973-db0dc4e2ebef\n", + "\n", + "{'resmsgid': '', 'msgid': '8d535783-74bb-4f36-92b7-6175a2743bb4', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}\n" + ] + } + ], + "source": [ + "# get claims for cbse board\n", + "# create user manually and attach board-cbse role\n", + "boardUserId = \"cbse-admin\"\n", + "boardToken = getToken(boardUserId)\n", + "# print(boardToken)\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%boardToken,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"board-cbse/claims\", headers=headers)\n", + "assert response.status_code == 200\n", + "print(response)\n", + "\n", + "# Attesting the claim as GRANT\n", + "data = {\n", + " \"action\":\"GRANT_CLAIM\",\n", + "}\n", + "# print(response.json())\n", + "attestingClaimId = None\n", + "for claim in response.json():\n", + "# print(claim)\n", + " print(claim[\"status\"])\n", + " if claim[\"status\"] == \"OPEN\":\n", + " attestingClaimId = claim[\"id\"]\n", + " print(claim[\"id\"])\n", + " attestResp = requests.request(\"POST\", \"%sboard-cbse/claims/%s/attest\" %(baseUrl, claim[\"id\"]), headers=headers, json=data)\n", + " assert response.status_code == 200\n", + " print(attestResp)\n", + " print(attestResp.json())\n", + " break\n", + "assert attestingClaimId != None\n", + "\n", + "# intituteAffiliateOsid = response.json()[0][\"affiliation\"][0][\"osid\"]\n", + "# print(intituteAffiliateOsid)\n", + "\n", + "import time\n", + "time.sleep(5)\n", + "# verify attestation status\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%token,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"Institute\", headers=headers)\n", + "\n", + "# print(response.text)\n", + "for affiliation in response.json()[0][\"instituteAffiliation\"]:\n", + " if affiliation[\"_osClaimId\"] == attestingClaimId:\n", + " assert affiliation[\"_osState\"] == \"PUBLISHED\"" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "id": "63b8aa77", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[{\"osUpdatedAt\":\"2022-03-16T05:02:00.003Z\",\"osCreatedAt\":\"2022-03-16T05:01:32.760Z\",\"osUpdatedBy\":\"\",\"affiliation\":[{\"osUpdatedAt\":\"2022-03-16T05:02:00.003Z\",\"grantYear\":\"2000\",\"osUpdatedBy\":\"\",\"classes\":[\"Class XII\"],\"affiliationNumber\":\"123\",\"osid\":\"1-8d6c9916-3c83-494c-abe8-58821e2e9cdc\",\"medium\":\"English\",\"expiryYear\":\"3001\",\"board\":\"cbse\"}],\"contactNumber\":\"!23\",\"osCreatedBy\":\"\",\"instituteAffiliation\":[{\"osUpdatedAt\":\"2022-03-16T05:02:00.003Z\",\"osUpdatedBy\":\"\",\"_osState\":\"PUBLISHED\",\"entityId\":\"1-74e00bc3-1f9b-40ab-bf61-be4e1d983e6f\",\"osid\":\"1-7dbd15cf-7adb-4d02-a64c-fdd86503eca6\",\"propertiesOSID\":{\"osid\":\"1-345517b9-0464-4d42-b37b-9465060881b0\",\"osUpdatedAt\":\"2022-03-16T05:01:48.784Z\",\"affiliation\":[\"1-8d6c9916-3c83-494c-abe8-58821e2e9cdc\"],\"osUpdatedBy\":\"99d6a25f-be69-4a9a-b617-ca8115c00c07\"},\"propertyData\":\"{\\\"affiliation\\\":[{\\\"osUpdatedAt\\\":\\\"2022-03-16T05:01:46.265Z\\\",\\\"grantYear\\\":\\\"2000\\\",\\\"osUpdatedBy\\\":\\\"99d6a25f-be69-4a9a-b617-ca8115c00c07\\\",\\\"classes\\\":[\\\"Class XII\\\"],\\\"affiliationNumber\\\":\\\"123\\\",\\\"osid\\\":\\\"1-8d6c9916-3c83-494c-abe8-58821e2e9cdc\\\",\\\"medium\\\":\\\"English\\\",\\\"expiryYear\\\":\\\"3001\\\",\\\"board\\\":\\\"cbse\\\"}],\\\"instituteName\\\":\\\"te\\\"}\",\"entityName\":\"Institute\",\"name\":\"instituteAffiliation\",\"_osAttestedData\":\"{\\\"affiliation\\\":[{\\\"osUpdatedAt\\\":\\\"2022-03-16T05:01:46.265Z\\\",\\\"grantYear\\\":\\\"2000\\\",\\\"osUpdatedBy\\\":\\\"99d6a25f-be69-4a9a-b617-ca8115c00c07\\\",\\\"classes\\\":[\\\"Class XII\\\"],\\\"affiliationNumber\\\":\\\"123\\\",\\\"osid\\\":\\\"1-8d6c9916-3c83-494c-abe8-58821e2e9cdc\\\",\\\"medium\\\":\\\"English\\\",\\\"expiryYear\\\":\\\"3001\\\",\\\"board\\\":\\\"cbse\\\"}],\\\"instituteName\\\":\\\"te\\\"}\",\"_osClaimId\":\"abf0e852-50cc-4caa-b973-db0dc4e2ebef\"}],\"osid\":\"1-74e00bc3-1f9b-40ab-bf61-be4e1d983e6f\",\"osOwner\":[\"99d6a25f-be69-4a9a-b617-ca8115c00c07\"],\"email\":\"admin36@mailinator.com\",\"instituteName\":\"te\"}]\n" + ] + } + ], + "source": [ + "# get institute details\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%token,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"Institute\", headers=headers)\n", + "\n", + "print(response.text)\n", + "for affiliation in response.json()[0][\"instituteAffiliation\"]:\n", + " if affiliation[\"_osClaimId\"] == attestingClaimId:\n", + " assert affiliation[\"_osState\"] == \"PUBLISHED\"" + ] + }, + { + "cell_type": "markdown", + "id": "f71c466c", + "metadata": {}, + "source": [ + "# Teacher attestations\n" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "id": "c9c84d59", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647406931706,\"params\":{\"resmsgid\":\"\",\"msgid\":\"8de9590d-335e-4476-80a8-ddea08274975\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Institute\":{\"osid\":\"1-f8f54222-fcb0-4f94-8ceb-19c16820dff5\"}}}\n", + "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647406931921,\"params\":{\"resmsgid\":\"\",\"msgid\":\"8345f6a7-e9b2-4e52-9eaa-c35faefe687b\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Institute\":{\"osid\":\"1-416a394f-5e8a-4432-ad80-597257209e79\"}}}\n" + ] + } + ], + "source": [ + "# create new institutions\n", + "institute1 = \"ABC1@mailinator.com\"\n", + "institute2 = \"XYZ1@mailinator.com\"\n", + "instituteRequestBody = {\n", + " \"instituteName\": \"ABC\",\n", + " \"email\": institute1,\n", + " \"contactNumber\": \"ABC1\"\n", + "}\n", + "headers = {\n", + " 'Content-Type': 'application/json'\n", + "}\n", + "\n", + "response = requests.request(\"POST\", baseUrl + \"Institute/invite\", headers=headers, json=instituteRequestBody)\n", + "\n", + "print(response.text)\n", + "assert response.status_code == 200\n", + "institute1Osid = response.json()[\"result\"][\"Institute\"][\"osid\"]\n", + "instituteRequestBody = {\n", + " \"instituteName\": \"XYZ\",\n", + " \"email\": institute2,\n", + " \"contactNumber\": \"XYZ1\"\n", + "}\n", + "headers = {\n", + " 'Content-Type': 'application/json'\n", + "}\n", + "\n", + "response = requests.request(\"POST\", baseUrl + \"Institute/invite\", headers=headers, json=instituteRequestBody)\n", + "\n", + "print(response.text)\n", + "assert response.status_code == 200\n", + "institute2Osid = response.json()[\"result\"][\"Institute\"][\"osid\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "id": "d3156938", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647406935308,\"params\":{\"resmsgid\":\"\",\"msgid\":\"f81e7df3-d291-4a01-b5b7-0d66b5663594\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Teacher\":{\"osid\":\"1-4475907c-5964-4724-b2b5-b60e4bf94ccc\"}}}\n" + ] + } + ], + "source": [ + "# create teacher\n", + "teacherUserId = \"t7\"\n", + "teacherRequestBody = {\n", + " \"identityDetails\": {\n", + " \"fullName\": \"teacher1\",\n", + " \"gender\": \"Male\",\n", + " \"dob\": \"1995-10-28\",\n", + " \"identityHolder\": {\n", + " \"AADHAAR\": \"123412323\"\n", + " }\n", + " },\n", + " \"contactDetails\": {\n", + " \"email\": \"%s@g.com\"%teacherUserId,\n", + " \"mobile\": teacherUserId\n", + " },\n", + " \"academicQualifications\": [\n", + " {\n", + " \"instituteOSID\": institute1Osid,\n", + " \"instituteName\": \"ABC\"\n", + " }\n", + " ],\n", + " \"experience\": [\n", + " {\n", + " \"instituteOSID\": institute2Osid,\n", + " \"instituteName\": \"XYZ\"\n", + " }\n", + " ]\n", + "}\n", + "headers = {\n", + " 'Content-Type': 'application/json'\n", + "}\n", + "\n", + "response = requests.request(\"POST\", baseUrl + \"Teacher/invite\", headers=headers, json=teacherRequestBody)\n", + "\n", + "print(response.text)\n", + "assert response.status_code == 200\n", + "teacherOsid = response.json()[\"result\"][\"Teacher\"][\"osid\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "id": "d9bf7bc7", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGRVZ0dExTTDdYMU9pOE5BcmcxU25tN1lRZWVSODc4N3dwTDdwdzJJeE9NIn0.eyJleHAiOjE2NDc0MDc1MzksImlhdCI6MTY0NzQwNjkzOSwianRpIjoiMWEwNjkxNTMtMGU4My00ZTUyLWI3ZTAtNjFkYmUxYjg3MGM1IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJkOTczZWVjOC0wM2FmLTRkNmUtODVhZC02ZDI3ZWY0ODYxOTkiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiI5NWJmYzY1OS1jZGUzLTQyM2MtYjVmOS0zNTFlYmMyZGRjZTciLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0NyIsImVudGl0eSI6WyJUZWFjaGVyIl0sImVtYWlsIjoidDdAZy5jb20ifQ.Q88oGgCi3Q-nrxpshJVuOB0E-j7ZNk5FvUsmQzfIKeo10de4O7f7XX3fBIjve-Cp_9wpzlrmsFOecFJYMsF19Ms6B-s50A6oVHjcWzrmuaQhamMx0t6QgT7S7ojVMNEVjhRVfCSMCKis0zNSs7-KQ8ixAyX9BkjMA3A8ZX-VFXPQvEoBkHh-er9gqoTZwn1XNdyJZhb2kp0XLDVD-id_70M1saB1F5YUmZYDVsvllwghjKwihvRtzJmBWIeKPJ4tJZ4XmwdUuaZltwPxgEDc95cjm0bCIceOEZF1IrDOdIwV0ayzx_eukNsIdI-c7KqSWkatx__GFntF51xKfxmASA\n" + ] + } + ], + "source": [ + "teacherToken = getToken(teacherUserId)\n", + "print(teacherToken)" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "id": "aeabd00a", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[{\"osUpdatedAt\":\"2022-03-16T05:02:15.601Z\",\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-16T05:02:15.601Z\",\"osCreatedAt\":\"2022-03-16T05:02:15.601Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"osid\":\"1-c15c6b3f-456d-4087-aea1-f27f306f0c0b\",\"instituteOSID\":\"1-f8f54222-fcb0-4f94-8ceb-19c16820dff5\",\"instituteName\":\"ABC\"}],\"osCreatedAt\":\"2022-03-16T05:02:15.601Z\",\"osUpdatedBy\":\"\",\"contactDetails\":{\"osid\":\"1-72afc1a9-6a6e-4042-9700-fb56711b54a7\",\"osUpdatedAt\":\"2022-03-16T05:02:15.601Z\",\"osCreatedAt\":\"2022-03-16T05:02:15.601Z\",\"osUpdatedBy\":\"\",\"mobile\":\"t7\",\"osCreatedBy\":\"\",\"email\":\"t7@g.com\"},\"osCreatedBy\":\"\",\"experience\":[{\"osUpdatedAt\":\"2022-03-16T05:02:15.601Z\",\"osCreatedAt\":\"2022-03-16T05:02:15.601Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"osid\":\"1-ef3b6d5c-d459-447a-a5f6-35f62d391a5c\",\"instituteOSID\":\"1-416a394f-5e8a-4432-ad80-597257209e79\",\"instituteName\":\"XYZ\"}],\"osid\":\"1-4475907c-5964-4724-b2b5-b60e4bf94ccc\",\"identityDetails\":{\"osid\":\"1-e68c52cb-6cef-48c3-a49d-c1ffb9f19628\",\"identityHolder\":{\"osid\":\"1-800dc7da-3f6d-4e58-990a-aa115665232a\",\"osUpdatedAt\":\"2022-03-16T05:02:15.601Z\",\"osCreatedAt\":\"2022-03-16T05:02:15.601Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"AADHAAR\":\"123412323\"},\"osUpdatedAt\":\"2022-03-16T05:02:15.601Z\",\"gender\":\"Male\",\"osCreatedAt\":\"2022-03-16T05:02:15.601Z\",\"osUpdatedBy\":\"\",\"dob\":\"1995-10-28\",\"osCreatedBy\":\"\",\"fullName\":\"teacher1\"},\"osOwner\":[\"d973eec8-03af-4d6e-85ad-6d27ef486199\"]}]\n", + "1-ef3b6d5c-d459-447a-a5f6-35f62d391a5c\n", + "1-c15c6b3f-456d-4087-aea1-f27f306f0c0b\n" + ] + } + ], + "source": [ + "# get teacher details\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%teacherToken,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"Teacher\", headers=headers)\n", + "\n", + "print(response.text)\n", + "assert response.status_code == 200\n", + "teacherEntity = response.json()[0]\n", + "print(teacherEntity[\"experience\"][0][\"osid\"])\n", + "experienceOsid = teacherEntity[\"experience\"][0][\"osid\"]\n", + "print(teacherEntity[\"academicQualifications\"][0][\"osid\"])\n", + "qualificationOsid = teacherEntity[\"academicQualifications\"][0][\"osid\"]" + ] + }, + { + "cell_type": "markdown", + "id": "0843d3d0", + "metadata": {}, + "source": [ + "# raise teacher's education attestation" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "91370c50", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 49, + "id": "5befaa8f", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n", + "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647406955903, 'params': {'resmsgid': '', 'msgid': '305aadb6-acc6-47d9-a335-61c388a7975b', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-6888f611-cf80-45d8-832e-572f18194d42'}}\n" + ] + } + ], + "source": [ + "# raise attestation request\n", + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'authorization': 'bearer %s'%teacherToken,\n", + "}\n", + "\n", + "data = {\n", + " \"entityName\":\"Teacher\",\n", + " \"entityId\":\"%s\"%teacherOsid,\n", + " \"name\":\"teacherExperience\",\n", + " \"propertiesOSID\": {\n", + " \"experience\": [experienceOsid]\n", + " }\n", + "}\n", + "response = requests.put(baseUrl+'send', headers=headers, json=data)\n", + "print(response.status_code)\n", + "response.json()\n", + "assert response.status_code == 200\n", + "print(response.json())\n", + "assert response.json()[\"params\"][\"status\"] == \"SUCCESSFUL\"" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "id": "5a219b6b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGRVZ0dExTTDdYMU9pOE5BcmcxU25tN1lRZWVSODc4N3dwTDdwdzJJeE9NIn0.eyJleHAiOjE2NDc0MDc1NTcsImlhdCI6MTY0NzQwNjk1NywianRpIjoiZDc0ZWNjYTQtNzY5ZC00NjBhLWFiZjctMjc3NmQ3OTk0NjgwIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI3N2VhOWU0Zi1hOGFmLTRlMjItOGY1OS02NWVmYTFkNWZjYmQiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiJiMWE2NGQzYy02MGI2LTQxZjEtYWIzZS1jZTc0YTY1Njc0MDgiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJhYmMxQG1haWxpbmF0b3IuY29tIiwiZW50aXR5IjpbIkluc3RpdHV0ZSJdLCJlbWFpbCI6ImFiYzFAbWFpbGluYXRvci5jb20ifQ.uU72x0gOPtjT3NfSXuOzDlmLwWUMpsQmLKIRDQOcpb7UM5EhyguTHSC0Wtai3F8GsDPisINe84S1YOMGe7grVuD9igzplkCKsC481w9-pEm0BmKkEMYMMsMSOr2AhDaABX79_3R876J5xLq_5-oNguxGlgNVF_WezwkG1_Lyh3Fl0yPP4ZCHAJDVWhUM8ld0ywWNfJYmcDxYTERDgwT4bktLS0hSGYTTv-TAwwz3fxgCJPreYYyqBRWIiTX0jQjfEZq86neTb4wQUOlJ9v7TV9qZuliccRzWgD3u6QSoYr6bop-Sex9b3Cky65okcl9JR_S7BIOaHru4t_2H1ZGrvg\n", + "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGRVZ0dExTTDdYMU9pOE5BcmcxU25tN1lRZWVSODc4N3dwTDdwdzJJeE9NIn0.eyJleHAiOjE2NDc0MDc1NTcsImlhdCI6MTY0NzQwNjk1NywianRpIjoiY2Q5YTBmYjYtNWM0NS00ZjlkLWI4NWItOTQzMzliYjJlMGIwIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJhNjI2NzJjOS1lMmE5LTRhMDQtYTBhOC0xYzYyZDAwM2E1N2IiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiI1OGUzMjNhZS00NWNjLTQzMjctYWExNy02MWY1NWI0MWYxMjciLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ4eXoxQG1haWxpbmF0b3IuY29tIiwiZW50aXR5IjpbIkluc3RpdHV0ZSJdLCJlbWFpbCI6Inh5ejFAbWFpbGluYXRvci5jb20ifQ.UEl3c9Ua64oxfOqcsNnuOqmHX3SPK23NFffr83cuy-YYHk6uL7nM_y4LdxyIbkGGPCSvjjvJrEunT7nv7niz8EsPYLDzNrjM565OMBx4yBr4VvlwwpycLGr7xKAf3rkS2eDDPZP3FFFQhK1sGUZpTd-nhpd5-DlFtGbZwO3EGHVDuAmTFkgalwsbtmHEFDzodKmvqsaK1HfyXm7MrX8Ga6W1mgLVI4Xt78tAJLNApTTBPcVp70dE5iD2VD9kkjBiIzcUOcuxGO_XcZo1g299TziICC1vQIritRTu2LX4-0ZPLPfMe4UppDpO0Euf-l-oa0W_fCnSRqXA18S5JhzJOA\n" + ] + } + ], + "source": [ + "# get institute token\n", + "institute1Token = getToken(institute1)\n", + "print(institute1Token)\n", + "institute2Token = getToken(institute2)\n", + "print(institute2Token)" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "id": "e07d0934", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "[{'id': '010e75d5-43f8-4efe-aaa5-f3d4e8850610', 'entity': 'Teacher', 'entityId': '1-4475907c-5964-4724-b2b5-b60e4bf94ccc', 'propertyURI': '', 'createdAt': '2022-03-16T05:02:36.610+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.osid#.contains('1-416a394f-5e8a-4432-ad80-597257209e79'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"experience\":[{\"osUpdatedAt\":\"2022-03-16T05:02:15.601Z\",\"osCreatedAt\":\"2022-03-16T05:02:15.601Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"osid\":\"1-ef3b6d5c-d459-447a-a5f6-35f62d391a5c\",\"instituteOSID\":\"1-416a394f-5e8a-4432-ad80-597257209e79\",\"instituteName\":\"XYZ\"}]}', 'attestationId': '1-6888f611-cf80-45d8-832e-572f18194d42', 'attestationName': 'teacherExperience', 'closed': False}]\n", + "OPEN\n", + "010e75d5-43f8-4efe-aaa5-f3d4e8850610\n", + "\n", + "{'resmsgid': '', 'msgid': '77c298ac-0bf5-456e-82e8-8457862e6030', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}\n" + ] + } + ], + "source": [ + "# get institute claims and grant the claim\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%institute2Token,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"Institute/claims\", headers=headers)\n", + "assert response.status_code == 200\n", + "print(response)\n", + "\n", + "# Attesting the claim as GRANT\n", + "data = {\n", + " \"action\":\"GRANT_CLAIM\",\n", + "}\n", + "print(response.json())\n", + "attestingClaimId = None\n", + "for claim in response.json():\n", + "# print(claim)\n", + " print(claim[\"status\"])\n", + " if claim[\"status\"] == \"OPEN\":\n", + " attestingClaimId = claim[\"id\"]\n", + " print(claim[\"id\"])\n", + " attestResp = requests.request(\"POST\", \"%sInstitute/claims/%s/attest\" %(baseUrl, claim[\"id\"]), headers=headers, json=data)\n", + " assert response.status_code == 200\n", + " print(attestResp)\n", + " print(attestResp.json())\n", + " break\n", + "assert attestingClaimId != None\n" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "id": "3988dd39", + "metadata": {}, + "outputs": [], + "source": [ + "import time\n", + "time.sleep(5)\n", + "# verify attestation status\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%teacherToken,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"Teacher\", headers=headers)\n", + "\n", + "# print(response.text)\n", + "for affiliation in response.json()[0][\"teacherExperience\"]:\n", + " if affiliation[\"_osClaimId\"] == attestingClaimId:\n", + " assert affiliation[\"_osState\"] == \"PUBLISHED\"\n" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "id": "610427a1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n", + "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647406968481, 'params': {'resmsgid': '', 'msgid': '83db1b59-148b-48f8-a7f0-1e6c3c831f06', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-feb35fd7-da36-43ab-b2e5-168a702c3553'}}\n" + ] + } + ], + "source": [ + "# raise qualification attestation request\n", + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'authorization': 'bearer %s'%teacherToken,\n", + "}\n", + "\n", + "data = {\n", + " \"entityName\":\"Teacher\",\n", + " \"entityId\":\"%s\"%teacherOsid,\n", + " \"name\":\"teacherAcademicsQualification\",\n", + " \"propertiesOSID\": {\n", + " \"academicQualifications\": [qualificationOsid]\n", + " }\n", + "}\n", + "response = requests.put(baseUrl+'send', headers=headers, json=data)\n", + "print(response.status_code)\n", + "response.json()\n", + "assert response.status_code == 200\n", + "print(response.json())\n", + "assert response.json()[\"params\"][\"status\"] == \"SUCCESSFUL\"\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "id": "2f551799", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGRVZ0dExTTDdYMU9pOE5BcmcxU25tN1lRZWVSODc4N3dwTDdwdzJJeE9NIn0.eyJleHAiOjE2NDc0MDc1NzIsImlhdCI6MTY0NzQwNjk3MiwianRpIjoiZmZhN2Y5YTMtMjA3ZS00MzY2LWIwZDMtYTkxOGFhMzUxOGJlIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI3N2VhOWU0Zi1hOGFmLTRlMjItOGY1OS02NWVmYTFkNWZjYmQiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiIwZjMxNTk5NS03YWYwLTQyNDMtYjcwZC1lOTE1YzU0OGIzYzgiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJhYmMxQG1haWxpbmF0b3IuY29tIiwiZW50aXR5IjpbIkluc3RpdHV0ZSJdLCJlbWFpbCI6ImFiYzFAbWFpbGluYXRvci5jb20ifQ.o9Mm4C0I_NLVfhRIx_cTcqeUiS5boHs0-GVC-HcPeoytd5hG4fnHwAUM2mEDH-1DJkXuBFPii5qJtjf1R797pGyH8ZIPmJD-74W3beF6NqMqmCugsbZdtqonDmbcfy8yincP-kp799eBEJhjIvC9LrLFiTLGBt6DmBsvcphZGoVlZnCz0WxGlHczEMwutsGw34CmVnnPLDK1B4NZ9h9Nxa42ioXR6HjpEmrgS9xbS-gk0TKzgK7bMfRINfGwQQm29DX0zor9EkEmMRJFS3IuTS8zlMkS7QvCP72hZuD4nJmri7HhIdwWm-56Qx23uj7IeNJNwo7wGfTEdX-6I9tlvA\n", + "\n", + "[{'id': 'a2d1a775-2ab5-4a8a-af7b-ca52017d4f79', 'entity': 'Teacher', 'entityId': '1-4475907c-5964-4724-b2b5-b60e4bf94ccc', 'propertyURI': '', 'createdAt': '2022-03-16T05:02:49.254+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.osid#.contains('1-f8f54222-fcb0-4f94-8ceb-19c16820dff5'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-16T05:02:40.022Z\",\"osCreatedAt\":\"2022-03-16T05:02:15.601Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"osid\":\"1-c15c6b3f-456d-4087-aea1-f27f306f0c0b\",\"instituteOSID\":\"1-f8f54222-fcb0-4f94-8ceb-19c16820dff5\",\"instituteName\":\"ABC\"}]}', 'attestationId': '1-feb35fd7-da36-43ab-b2e5-168a702c3553', 'attestationName': 'teacherAcademicsQualification', 'closed': False}]\n", + "OPEN\n", + "a2d1a775-2ab5-4a8a-af7b-ca52017d4f79\n", + "\n", + "{'resmsgid': '', 'msgid': '17dd8c4d-1935-4cee-8295-db9c85a3d902', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}\n" + ] + } + ], + "source": [ + "\n", + "# get institute token\n", + "institute1Token = getToken(institute1)\n", + "print(institute1Token)\n", + "\n", + "# get institute claims and grant the claim\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%institute1Token,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"Institute/claims\", headers=headers)\n", + "assert response.status_code == 200\n", + "print(response)\n", + "\n", + "# Attesting the claim as GRANT\n", + "data = {\n", + " \"action\":\"GRANT_CLAIM\",\n", + "}\n", + "print(response.json())\n", + "attestingClaimId = None\n", + "for claim in response.json():\n", + "# print(claim)\n", + " print(claim[\"status\"])\n", + " if claim[\"status\"] == \"OPEN\":\n", + " attestingClaimId = claim[\"id\"]\n", + " print(claim[\"id\"])\n", + " attestResp = requests.request(\"POST\", \"%sInstitute/claims/%s/attest\" %(baseUrl, claim[\"id\"]), headers=headers, json=data)\n", + " assert response.status_code == 200\n", + " print(attestResp)\n", + " print(attestResp.json())\n", + " break\n", + "assert attestingClaimId != None" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "id": "1d5abf7e", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'osUpdatedAt': '2022-03-16T05:02:52.429Z', 'osUpdatedBy': '', '_osState': 'PUBLISHED', 'entityId': '1-4475907c-5964-4724-b2b5-b60e4bf94ccc', 'osid': '1-feb35fd7-da36-43ab-b2e5-168a702c3553', 'propertiesOSID': {'osid': '1-88bd050f-d83e-4c2b-bfec-f662dcec8a92', 'osUpdatedAt': '2022-03-16T05:02:48.543Z', 'osUpdatedBy': 'd973eec8-03af-4d6e-85ad-6d27ef486199', 'academicQualifications': ['1-c15c6b3f-456d-4087-aea1-f27f306f0c0b']}, 'propertyData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-16T05:02:40.022Z\",\"osCreatedAt\":\"2022-03-16T05:02:15.601Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"osid\":\"1-c15c6b3f-456d-4087-aea1-f27f306f0c0b\",\"instituteOSID\":\"1-f8f54222-fcb0-4f94-8ceb-19c16820dff5\",\"instituteName\":\"ABC\"}]}', 'entityName': 'Teacher', 'name': 'teacherAcademicsQualification', '_osAttestedData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-16T05:02:40.022Z\",\"osCreatedAt\":\"2022-03-16T05:02:15.601Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"osid\":\"1-c15c6b3f-456d-4087-aea1-f27f306f0c0b\",\"instituteOSID\":\"1-f8f54222-fcb0-4f94-8ceb-19c16820dff5\",\"instituteName\":\"ABC\"}]}', '_osClaimId': 'a2d1a775-2ab5-4a8a-af7b-ca52017d4f79'}\n" + ] + } + ], + "source": [ + "\n", + "import time\n", + "time.sleep(3)\n", + "# verify attestation status\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%teacherToken,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"Teacher\", headers=headers)\n", + "\n", + "\n", + "for affiliation in response.json()[0][\"teacherAcademicsQualification\"]:\n", + " print(affiliation)\n", + " if affiliation[\"_osClaimId\"] == attestingClaimId:\n", + " assert affiliation[\"_osState\"] == \"PUBLISHED\"" + ] + }, + { + "cell_type": "markdown", + "id": "c022e941", + "metadata": {}, + "source": [ + "# Student Attestations" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "id": "ec61edde", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647407039305,\"params\":{\"resmsgid\":\"\",\"msgid\":\"363d9d30-f76c-4c4c-b94c-8f43e478f6bd\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Student\":{\"osid\":\"1-f89b0b11-9032-409a-8534-9ff344d06eca\"}}}\n" + ] + } + ], + "source": [ + "# create teacher\n", + "studentUserId = \"s5\"\n", + "studentRequestBody = {\n", + " \"identityDetails\": {\n", + " \"fullName\": \"student1\",\n", + " \"gender\": \"Male\",\n", + " \"dob\": \"1995-10-28\",\n", + " \"identityHolder\": {\n", + " \"AADHAAR\": \"123412323\"\n", + " }\n", + " },\n", + " \"contactDetails\": {\n", + " \"email\": \"%s@g.com\"%studentUserId,\n", + " \"mobile\": studentUserId\n", + " },\n", + " \"educationDetails\": [\n", + " {\n", + " \"instituteOSID\": institute2Osid,\n", + " \"instituteName\": \"XYZ\"\n", + " }\n", + " ]\n", + "}\n", + "headers = {\n", + " 'Content-Type': 'application/json'\n", + "}\n", + "\n", + "response = requests.request(\"POST\", baseUrl + \"Student/invite\", headers=headers, json=studentRequestBody)\n", + "\n", + "print(response.text)\n", + "assert response.status_code == 200\n", + "studentOsid = response.json()[\"result\"][\"Student\"][\"osid\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "id": "3c4d8483", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGRVZ0dExTTDdYMU9pOE5BcmcxU25tN1lRZWVSODc4N3dwTDdwdzJJeE9NIn0.eyJleHAiOjE2NDc0MDc2NDAsImlhdCI6MTY0NzQwNzA0MCwianRpIjoiMWRlNDE1MDQtYThiMi00YWYxLWEzYzgtODUyZTlmNTZkZjA1IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIzN2QwMmM2ZS1jNzllLTQ0YTktYWMzZi03YmNlY2Y5MjBmZTkiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiI1YzBlNWUyNS1hMDIwLTRiODctYTk4MS00ODdkYzNlYTg4NDciLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzNSIsImVudGl0eSI6WyJTdHVkZW50Il0sImVtYWlsIjoiczVAZy5jb20ifQ.XuAZG7oCWvGpkPHjLslduRxOVZVit6Cwa7TrEA6W-MaBvTt7DCiRCOM207FiWKvOFPMTAne9SvBfLep4mU7rtOsvZOcsAuFxXdFgSApPJPyQexapkjtEqDNgmM2WW1e8Y1KrBiA7_mJRZYdA8aauJPHs8BwPL8hbM9in8vhxp0-5S8N6KYXO53n7cceccAAsTPvxDLSinIe-qLtwN181IQSJv6A1spCizhLxrUjzp15IJ32hgVOyGDSk3QIhO7znyjrV9mym3uBtMMXl0loyNfMqOIY8XjRjwDsNWqGrrPP8RqbMPWXTE3akk54YH8Wo6TXrKbS_pmopCIBpI7nZIg\n" + ] + } + ], + "source": [ + "studentToken = getToken(studentUserId)\n", + "print(studentToken)" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "id": "fa0768fa", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[{\"educationDetails\":[{\"osid\":\"1-672eef11-c0e3-4c09-a599-3d628d0be8d9\",\"instituteOSID\":\"1-416a394f-5e8a-4432-ad80-597257209e79\",\"instituteName\":\"XYZ\"}],\"contactDetails\":{\"osid\":\"1-39a0faca-d612-4f2a-a5c9-4089e380e108\",\"mobile\":\"s5\",\"email\":\"s5@g.com\"},\"osid\":\"1-f89b0b11-9032-409a-8534-9ff344d06eca\",\"identityDetails\":{\"osid\":\"1-4238990a-bf61-462c-841a-6df5f6c38dcc\",\"identityHolder\":{\"osid\":\"1-f592308c-90e3-4755-9664-51f5709a0b7a\",\"AADHAAR\":\"123412323\"},\"gender\":\"Male\",\"dob\":\"1995-10-28\",\"fullName\":\"student1\"},\"osOwner\":[\"37d02c6e-c79e-44a9-ac3f-7bcecf920fe9\"]}]\n", + "1-672eef11-c0e3-4c09-a599-3d628d0be8d9\n" + ] + } + ], + "source": [ + "# get student details\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%studentToken,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"Student\", headers=headers)\n", + "\n", + "print(response.text)\n", + "assert response.status_code == 200\n", + "print(response.json()[0][\"educationDetails\"][0][\"osid\"])\n", + "educationDetailsOsid = response.json()[0][\"educationDetails\"][0][\"osid\"]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "da089e8d", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 64, + "id": "103655ed", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n", + "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647407043398, 'params': {'resmsgid': '', 'msgid': 'ebe47837-98b3-44b4-9c92-81c9f025f43f', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-85f67859-685b-4380-8379-3f8dad1dd17f'}}\n" + ] + } + ], + "source": [ + "# raise qualification attestation request\n", + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'authorization': 'bearer %s'%studentToken,\n", + "}\n", + "\n", + "data = {\n", + " \"entityName\":\"Student\",\n", + " \"entityId\":\"%s\"%studentOsid,\n", + " \"name\":\"studentInstituteAttest\",\n", + " \"propertiesOSID\": {\n", + " \"educationDetails\": [educationDetailsOsid]\n", + " }\n", + "}\n", + "response = requests.put(baseUrl+'send', headers=headers, json=data)\n", + "print(response.status_code)\n", + "response.json()\n", + "assert response.status_code == 200\n", + "print(response.json())\n", + "assert response.json()[\"params\"][\"status\"] == \"SUCCESSFUL\"\n" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "id": "8e71173c", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGRVZ0dExTTDdYMU9pOE5BcmcxU25tN1lRZWVSODc4N3dwTDdwdzJJeE9NIn0.eyJleHAiOjE2NDc0MDc2NDYsImlhdCI6MTY0NzQwNzA0NiwianRpIjoiNTg4M2EzNjYtM2E4My00YmI4LTk5Y2QtY2FlODdjOWQxNDExIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJkOTczZWVjOC0wM2FmLTRkNmUtODVhZC02ZDI3ZWY0ODYxOTkiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiJmNDNiZTQxOS1jYWI3LTQ5YzYtYTdiOS0xN2ZkMzllMzMxMTgiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0NyIsImVudGl0eSI6WyJUZWFjaGVyIl0sImVtYWlsIjoidDdAZy5jb20ifQ.oAcuUQrEbxdz4gqE2mSp-9v77xWzAu5EvtY9fZCswjY3KHZi-deQVLdkB977gWqOGxpedT-rHH-rQRojeZubh4tsR5gjuqyH3xXxyIj1Buw26f3mYSrD3aszaBaEkR0pdsg2XNCsBQZjn_3XV3_GzBicRlVa5PMbFmLv95lkePMNLHJJEW8O1xLHa93Ll07VIgSoOpORZuOrY9ectZVDuhG2moe7h1h2spcSkmVAUpR2is_Kf3XicblXFyOUj9VuUzvL-gUPob3izt2iaafDrNKHf8n0qiuGEthi7xHKwbtHT9u3x7hKQNLSSMNipRT0lO99HK5zpdvesdUYw4YotA\n", + "\n", + "[{'id': '3bcff842-1c8a-45dc-b42a-78655fd0a8dc', 'entity': 'Student', 'entityId': '1-f89b0b11-9032-409a-8534-9ff344d06eca', 'propertyURI': '', 'createdAt': '2022-03-16T05:04:03.568+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.experience.[*].instituteOSID#.contains('1-416a394f-5e8a-4432-ad80-597257209e79'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'propertyData': '{\"name\":\"student1\",\"educationDetails\":[{\"osid\":\"1-672eef11-c0e3-4c09-a599-3d628d0be8d9\",\"instituteOSID\":\"1-416a394f-5e8a-4432-ad80-597257209e79\",\"instituteName\":\"XYZ\"}]}', 'attestationId': '1-85f67859-685b-4380-8379-3f8dad1dd17f', 'attestationName': 'studentInstituteAttest', 'closed': False}]\n", + "OPEN\n", + "3bcff842-1c8a-45dc-b42a-78655fd0a8dc\n", + "\n", + "{'resmsgid': '', 'msgid': '05a96b25-e538-4113-b1cc-219ba84a02a1', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}\n" + ] + } + ], + "source": [ + "# get teacher token\n", + "teacherToken = getToken(teacherUserId)\n", + "print(teacherToken)\n", + "\n", + "# get institute claims and grant the claim\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%teacherToken,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"Teacher/claims\", headers=headers)\n", + "assert response.status_code == 200\n", + "print(response)\n", + "\n", + "# Attesting the claim as GRANT\n", + "data = {\n", + " \"action\":\"GRANT_CLAIM\",\n", + "}\n", + "print(response.json())\n", + "attestingClaimId = None\n", + "for claim in response.json():\n", + "# print(claim)\n", + " print(claim[\"status\"])\n", + " if claim[\"status\"] == \"OPEN\":\n", + " attestingClaimId = claim[\"id\"]\n", + " print(claim[\"id\"])\n", + " attestResp = requests.request(\"POST\", \"%sTeacher/claims/%s/attest\" %(baseUrl, claim[\"id\"]), headers=headers, json=data)\n", + " assert response.status_code == 200\n", + " print(attestResp)\n", + " print(attestResp.json())\n", + " break\n", + "assert attestingClaimId != None" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "id": "35071076", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'entityName': 'Student', '_osState': 'PUBLISHED', 'name': 'studentInstituteAttest', 'entityId': '1-f89b0b11-9032-409a-8534-9ff344d06eca', 'osid': '1-85f67859-685b-4380-8379-3f8dad1dd17f', '_osAttestedData': '{\"name\":\"student1\",\"educationDetails\":[{\"osid\":\"1-672eef11-c0e3-4c09-a599-3d628d0be8d9\",\"instituteOSID\":\"1-416a394f-5e8a-4432-ad80-597257209e79\",\"instituteName\":\"XYZ\"}]}', 'propertiesOSID': {'osid': '1-bf5121c6-754c-4ddd-aaad-3455bab06d70', 'educationDetails': ['1-672eef11-c0e3-4c09-a599-3d628d0be8d9']}, '_osClaimId': '3bcff842-1c8a-45dc-b42a-78655fd0a8dc', 'propertyData': '{\"name\":\"student1\",\"educationDetails\":[{\"osid\":\"1-672eef11-c0e3-4c09-a599-3d628d0be8d9\",\"instituteOSID\":\"1-416a394f-5e8a-4432-ad80-597257209e79\",\"instituteName\":\"XYZ\"}]}'}\n" + ] + } + ], + "source": [ + "\n", + "import time\n", + "time.sleep(1)\n", + "# verify attestation status\n", + "headers = {\n", + " 'Content-Type': 'application/json',\n", + " 'Authorization': 'bearer %s'%studentToken,\n", + "}\n", + "\n", + "response = requests.request(\"GET\", baseUrl + \"Student\", headers=headers)\n", + "\n", + "\n", + "for affiliation in response.json()[0][\"studentInstituteAttest\"]:\n", + " print(affiliation)\n", + " if affiliation[\"_osClaimId\"] == attestingClaimId:\n", + " assert affiliation[\"_osState\"] == \"PUBLISHED\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "22953353", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.5" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/imports/realm-export.json b/imports/realm-export.json new file mode 100644 index 0000000..7aed1cf --- /dev/null +++ b/imports/realm-export.json @@ -0,0 +1,3014 @@ +{ + "id": "sunbird-rc", + "realm": "sunbird-rc", + "notBefore": 1607576887, + "defaultSignatureAlgorithm": "RS256", + "revokeRefreshToken": false, + "refreshTokenMaxReuse": 0, + "accessTokenLifespan": 17280000, + "accessTokenLifespanForImplicitFlow": 900, + "ssoSessionIdleTimeout": 172800, + "ssoSessionMaxLifespan": 17280000, + "ssoSessionIdleTimeoutRememberMe": 0, + "ssoSessionMaxLifespanRememberMe": 0, + "offlineSessionIdleTimeout": 2592000, + "offlineSessionMaxLifespanEnabled": false, + "offlineSessionMaxLifespan": 5184000, + "clientSessionIdleTimeout": 600, + "clientSessionMaxLifespan": 600, + "clientOfflineSessionIdleTimeout": 0, + "clientOfflineSessionMaxLifespan": 0, + "accessCodeLifespan": 60, + "accessCodeLifespanUserAction": 300, + "accessCodeLifespanLogin": 1800, + "actionTokenGeneratedByAdminLifespan": 43200, + "actionTokenGeneratedByUserLifespan": 300, + "oauth2DeviceCodeLifespan": 600, + "oauth2DevicePollingInterval": 600, + "enabled": true, + "sslRequired": "external", + "registrationAllowed": false, + "registrationEmailAsUsername": false, + "rememberMe": false, + "verifyEmail": false, + "loginWithEmailAllowed": true, + "duplicateEmailsAllowed": false, + "resetPasswordAllowed": false, + "editUsernameAllowed": true, + "bruteForceProtected": false, + "permanentLockout": false, + "maxFailureWaitSeconds": 900, + "minimumQuickLoginWaitSeconds": 60, + "waitIncrementSeconds": 60, + "quickLoginCheckMilliSeconds": 1000, + "maxDeltaTimeSeconds": 43200, + "failureFactor": 30, + "roles": { + "realm": [ + { + "id": "a4b21820-1b52-4b6a-851e-0a9955ead1f0", + "name": "default-roles-ndear", + "description": "${role_default-roles-ndear}", + "composite": true, + "composites": { + "realm": [ + "offline_access", + "uma_authorization" + ], + "client": { + "account": [ + "manage-account", + "view-profile" + ] + } + }, + "clientRole": false, + "containerId": "sunbird-rc", + "attributes": {} + }, + { + "id": "a5777369-2e60-45ee-bfcd-0cc84a46470d", + "name": "uma_authorization", + "description": "${role_uma_authorization}", + "composite": false, + "clientRole": false, + "containerId": "sunbird-rc", + "attributes": {} + }, + { + "id": "23343597-65e4-45b2-9ce5-8ff2e95cedb1", + "name": "system-admin", + "description": "system admin can address", + "composite": false, + "clientRole": false, + "containerId": "sunbird-rc", + "attributes": {} + }, + { + "id": "30d1a784-d1af-43c0-9c86-8a3679503dee", + "name": "offline_access", + "description": "${role_offline-access}", + "composite": false, + "clientRole": false, + "containerId": "sunbird-rc", + "attributes": {} + }, + { + "id": "794f2583-03b5-4cc6-b4cc-4a9c4def72df", + "name": "board-cbse", + "composite": false, + "clientRole": false, + "containerId": "sunbird-rc", + "attributes": {} + } + ], + "client": { + "registry": [], + "realm-management": [ + { + "id": "855baf85-b31e-42cf-9967-6862e2b909a3", + "name": "manage-events", + "description": "${role_manage-events}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "03569918-e595-4d62-afcb-66e9a8a4ea49", + "name": "manage-users", + "description": "${role_manage-users}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "35ef501b-937a-46b3-8138-81dd8181a4ab", + "name": "view-clients", + "description": "${role_view-clients}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "query-clients" + ] + } + }, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "7a6420ce-275a-46da-984d-e7eb57bba9e6", + "name": "view-identity-providers", + "description": "${role_view-identity-providers}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "65f6d107-80d6-460c-ba76-a23cea490238", + "name": "manage-realm", + "description": "${role_manage-realm}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "35ea1bbd-aa7b-4ff6-bb97-cb276ed6a600", + "name": "manage-authorization", + "description": "${role_manage-authorization}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "2162feb6-53a2-4334-869b-f0931ec8f1b0", + "name": "query-groups", + "description": "${role_query-groups}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "fef7be98-f397-4d7d-9f13-7c0359990454", + "name": "view-authorization", + "description": "${role_view-authorization}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "a4014ded-0179-43fd-96ac-e57e8d046cc6", + "name": "impersonation", + "description": "${role_impersonation}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "f2cbb825-7e59-48ce-b772-889b30bb2bd2", + "name": "manage-clients", + "description": "${role_manage-clients}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "7257d396-561f-41db-a689-6fe504ee7182", + "name": "view-events", + "description": "${role_view-events}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "b4c0919e-e181-40da-9621-a28d6263ac7a", + "name": "view-users", + "description": "${role_view-users}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "query-groups", + "query-users" + ] + } + }, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "6c685df7-3a37-47c7-a62f-a8c5f1dae87c", + "name": "manage-identity-providers", + "description": "${role_manage-identity-providers}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "2ce77ff3-755e-41e8-b839-b572b34c2666", + "name": "query-users", + "description": "${role_query-users}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "d08a5987-9818-4a28-8acc-3c9a26952cee", + "name": "view-realm", + "description": "${role_view-realm}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "9c92ce94-4841-448f-bcdc-dca2624f0cb8", + "name": "realm-admin", + "description": "${role_realm-admin}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "manage-events", + "manage-users", + "view-clients", + "view-identity-providers", + "manage-realm", + "manage-authorization", + "query-groups", + "view-authorization", + "impersonation", + "manage-clients", + "view-events", + "view-users", + "manage-identity-providers", + "query-users", + "view-realm", + "create-client", + "query-clients", + "query-realms" + ] + } + }, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "2ba819e5-f0d9-4603-8241-3a4c427d092c", + "name": "create-client", + "description": "${role_create-client}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "8955dec5-4d52-4407-b853-e1eb6a42f286", + "name": "query-clients", + "description": "${role_query-clients}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + }, + { + "id": "4be89b85-1385-4234-812f-6d7ca7b75e9a", + "name": "query-realms", + "description": "${role_query-realms}", + "composite": false, + "clientRole": true, + "containerId": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "attributes": {} + } + ], + "learn-app": [], + "security-admin-console": [], + "admin-api": [ + { + "id": "3eaa069b-358f-42fc-99b4-9eca779caec2", + "name": "api", + "composite": false, + "clientRole": true, + "containerId": "cd59dfa9-6289-40f9-b5c1-d76b1565501d", + "attributes": {} + }, + { + "id": "b01557bb-22c8-4245-8182-dc777a11a2fb", + "name": "uma_protection", + "composite": false, + "clientRole": true, + "containerId": "cd59dfa9-6289-40f9-b5c1-d76b1565501d", + "attributes": {} + } + ], + "account-console": [], + "admin-portal": [ + { + "id": "21944755-484e-442a-9754-9ab2f23144ef", + "name": "system-admin", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "manage-users" + ] + } + }, + "clientRole": true, + "containerId": "1564a757-4d29-4542-bf74-1b4c5e717c49", + "attributes": {} + } + ], + "broker": [ + { + "id": "34e065c1-9549-46d1-857f-510dd2616a2a", + "name": "read-token", + "description": "${role_read-token}", + "composite": false, + "clientRole": true, + "containerId": "91c2b80c-73fe-4dd0-a1eb-0797cc0b8e60", + "attributes": {} + } + ], + "registry-frontend": [], + "certificate-login": [ + { + "id": "a68b96d7-0d27-4c1c-9d28-bbad8375cca4", + "name": "recipient", + "composite": false, + "clientRole": true, + "containerId": "ac354645-3c3c-4592-879b-20a2f4f48302", + "attributes": {} + } + ], + "admin-cli": [], + "t1": [], + "account": [ + { + "id": "e62c4257-82ae-4675-b5e4-13fb3d0a853d", + "name": "manage-account", + "description": "${role_manage-account}", + "composite": true, + "composites": { + "client": { + "account": [ + "manage-account-links" + ] + } + }, + "clientRole": true, + "containerId": "9ec6a48d-afbb-42b5-aa1b-372863b6ad8d", + "attributes": {} + }, + { + "id": "72923824-b6b8-44fa-a087-e58c4cc4c83d", + "name": "view-profile", + "description": "${role_view-profile}", + "composite": false, + "clientRole": true, + "containerId": "9ec6a48d-afbb-42b5-aa1b-372863b6ad8d", + "attributes": {} + }, + { + "id": "70ce30d7-70dd-436c-a398-056c42100763", + "name": "delete-account", + "description": "${role_delete-account}", + "composite": false, + "clientRole": true, + "containerId": "9ec6a48d-afbb-42b5-aa1b-372863b6ad8d", + "attributes": {} + }, + { + "id": "468ad610-b5bd-49d9-80f2-869af45c238f", + "name": "manage-consent", + "description": "${role_manage-consent}", + "composite": true, + "composites": { + "client": { + "account": [ + "view-consent" + ] + } + }, + "clientRole": true, + "containerId": "9ec6a48d-afbb-42b5-aa1b-372863b6ad8d", + "attributes": {} + }, + { + "id": "ea78b628-aafb-42b8-b189-df7b2cb1e161", + "name": "manage-account-links", + "description": "${role_manage-account-links}", + "composite": false, + "clientRole": true, + "containerId": "9ec6a48d-afbb-42b5-aa1b-372863b6ad8d", + "attributes": {} + }, + { + "id": "fcf80e05-2af1-4145-8cf9-cb787bf83f28", + "name": "view-consent", + "description": "${role_view-consent}", + "composite": false, + "clientRole": true, + "containerId": "9ec6a48d-afbb-42b5-aa1b-372863b6ad8d", + "attributes": {} + }, + { + "id": "a75eca07-aea9-42cb-a189-286399128b11", + "name": "view-applications", + "description": "${role_view-applications}", + "composite": false, + "clientRole": true, + "containerId": "9ec6a48d-afbb-42b5-aa1b-372863b6ad8d", + "attributes": {} + } + ] + } + }, + "groups": [ + { + "id": "fd78713f-2d21-4f23-871c-703ba812ac45", + "name": "board-cbse", + "path": "/board-cbse", + "attributes": {}, + "realmRoles": [ + "board-cbse" + ], + "clientRoles": {}, + "subGroups": [] + }, + { + "id": "5ea4e456-bf79-4a16-8903-ce6b95d9f328", + "name": "controller", + "path": "/controller", + "attributes": {}, + "realmRoles": [], + "clientRoles": {}, + "subGroups": [] + }, + { + "id": "860560da-911e-4db1-92f2-0cbbaad8f7b3", + "name": "facility admin", + "path": "/facility admin", + "attributes": {}, + "realmRoles": [], + "clientRoles": { + "realm-management": [ + "manage-users" + ] + }, + "subGroups": [] + }, + { + "id": "84682840-4c21-428d-b2d5-06e6298be1cc", + "name": "facility staff", + "path": "/facility staff", + "attributes": {}, + "realmRoles": [], + "clientRoles": { + "realm-management": [ + "view-users" + ] + }, + "subGroups": [] + }, + { + "id": "ee4cbc2d-f6a0-4424-9fcd-5dd876c2580c", + "name": "monitoring", + "path": "/monitoring", + "attributes": {}, + "realmRoles": [], + "clientRoles": {}, + "subGroups": [] + }, + { + "id": "7a859744-fae3-4d24-9f1c-4aeed92ba383", + "name": "recipient", + "path": "/recipient", + "attributes": {}, + "realmRoles": [], + "clientRoles": { + "certificate-login": [ + "recipient" + ] + }, + "subGroups": [] + }, + { + "id": "691ef8ed-110d-4855-84a6-7c68171e9579", + "name": "system admin", + "path": "/system admin", + "attributes": {}, + "realmRoles": [], + "clientRoles": { + "account": [ + "manage-account", + "view-profile" + ] + }, + "subGroups": [] + }, + { + "id": "dd163e2a-7bc6-4509-be7d-c18055bf3049", + "name": "test", + "path": "/test", + "attributes": {}, + "realmRoles": [], + "clientRoles": {}, + "subGroups": [] + } + ], + "defaultRole": { + "id": "a4b21820-1b52-4b6a-851e-0a9955ead1f0", + "name": "default-roles-ndear", + "description": "${role_default-roles-ndear}", + "composite": true, + "clientRole": false, + "containerId": "sunbird-rc" + }, + "requiredCredentials": [ + "password" + ], + "otpPolicyType": "totp", + "otpPolicyAlgorithm": "HmacSHA1", + "otpPolicyInitialCounter": 0, + "otpPolicyDigits": 6, + "otpPolicyLookAheadWindow": 1, + "otpPolicyPeriod": 30, + "otpSupportedApplications": [ + "FreeOTP", + "Google Authenticator" + ], + "webAuthnPolicyRpEntityName": "keycloak", + "webAuthnPolicySignatureAlgorithms": [ + "ES256" + ], + "webAuthnPolicyRpId": "", + "webAuthnPolicyAttestationConveyancePreference": "not specified", + "webAuthnPolicyAuthenticatorAttachment": "not specified", + "webAuthnPolicyRequireResidentKey": "not specified", + "webAuthnPolicyUserVerificationRequirement": "not specified", + "webAuthnPolicyCreateTimeout": 0, + "webAuthnPolicyAvoidSameAuthenticatorRegister": false, + "webAuthnPolicyAcceptableAaguids": [], + "webAuthnPolicyPasswordlessRpEntityName": "keycloak", + "webAuthnPolicyPasswordlessSignatureAlgorithms": [ + "RS256" + ], + "webAuthnPolicyPasswordlessRpId": "", + "webAuthnPolicyPasswordlessAttestationConveyancePreference": "not specified", + "webAuthnPolicyPasswordlessAuthenticatorAttachment": "not specified", + "webAuthnPolicyPasswordlessRequireResidentKey": "not specified", + "webAuthnPolicyPasswordlessUserVerificationRequirement": "not specified", + "webAuthnPolicyPasswordlessCreateTimeout": 0, + "webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister": false, + "webAuthnPolicyPasswordlessAcceptableAaguids": [], + "users": [ + { + "id": "d9e68be4-205a-4b44-8301-1fea2557f1cf", + "createdTimestamp": 1607599408105, + "username": "service-account-admin-api", + "enabled": true, + "totp": false, + "emailVerified": false, + "serviceAccountClientId": "admin-api", + "disableableCredentialTypes": [], + "requiredActions": [], + "realmRoles": [ + "uma_authorization", + "offline_access" + ], + "clientRoles": { + "realm-management": [ + "manage-users" + ], + "admin-api": [ + "api" + ], + "account": [ + "manage-account", + "view-profile" + ] + }, + "notBefore": 0, + "groups": [] + }, + { + "id": "6d36477b-5071-419a-8623-b9eac9fefb44", + "createdTimestamp": 1630326978632, + "username": "service-account-t1", + "enabled": true, + "totp": false, + "emailVerified": false, + "serviceAccountClientId": "t1", + "disableableCredentialTypes": [], + "requiredActions": [], + "realmRoles": [ + "default-roles-ndear" + ], + "notBefore": 0, + "groups": [] + }, + { + "username": "cbse-admin", + "enabled": true, + "credentials": [ + { + "type": "password", + "value": "abcd@123" + } + ], + "groups": ["board-cbse"], + "attributes": { + "email_id": [ + "cbse-admin" + ], + "mobile_number": [ + "cbse-admin" + ], + "entity": [ + "board-cbse" + ] + } + } + ], + "scopeMappings": [ + { + "clientScope": "offline_access", + "roles": [ + "offline_access" + ] + } + ], + "clientScopeMappings": { + "account": [ + { + "client": "account-console", + "roles": [ + "manage-account" + ] + } + ] + }, + "clients": [ + { + "id": "9ec6a48d-afbb-42b5-aa1b-372863b6ad8d", + "clientId": "account", + "name": "${client_account}", + "rootUrl": "${authBaseUrl}", + "baseUrl": "/realms/divoc/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [ + "/realms/divoc/account/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": {}, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "86b6a7f5-44a5-4a74-afaa-8627e0e85951", + "clientId": "account-console", + "name": "${client_account-console}", + "rootUrl": "${authBaseUrl}", + "baseUrl": "/realms/divoc/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [ + "/realms/divoc/account/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "b9ad22cd-f358-4437-bc0f-c6eb4dbaa583", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": {} + } + ], + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "cd59dfa9-6289-40f9-b5c1-d76b1565501d", + "clientId": "admin-api", + "rootUrl": "https://divoc.xiv.in/keycloak/auth/realms/divoc/account/", + "adminUrl": "https://divoc.xiv.in/keycloak/auth/realms/divoc/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "d112548e-09b8-411d-a1e0-b5870247affa", + "redirectUris": [ + "https://localhost:4202/*", + "https://divoc.xiv.in", + "https://divoc.xiv.in/keycloak/auth/realms/divoc/account/*", + "https://localhost:4200/*", + "http://ndear.xiv.in/*", + "https://oauth.pstmn.io/v1/callback" + ], + "webOrigins": [ + "https://localhost:4202/*", + "https://divoc.xiv.in", + "https://localhost:4200/*" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": true, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "access.token.lifespan": "34560000", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "login_theme": "base", + "token.endpoint.auth.signing.alg": "RS256", + "use.jwks.url": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "jwt.credential.certificate": "MIICoTCCAYkCBgF2I6zd1DANBgkqhkiG9w0BAQsFADAUMRIwEAYDVQQDDAlhZG1pbi1hcGkwHhcNMjAxMjAyMTMzNjQwWhcNMzAxMjAyMTMzODIwWjAUMRIwEAYDVQQDDAlhZG1pbi1hcGkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6OKVxSBGLhC+5JO7whAFB9Sk0qhGJ8xRmhaYTup1Mty4RiAwqwhkLDEBn/FJnHm3949DPRGKW6Kd1U4a6VoY95fQlSjiTUgRoOy+PDtbfboZ5Q6fDWCoFSbC+VOx9vt/9b4InY/y8o9zc6BNogrM8tjDzzSnUWNBC3+8EtKnlH8gbGsxg9BcnuxwmOWm81hnVj7z16dJDj3A0U7eLUgcEYDew5y4dEQq45Sav48Q2tCDhQPKpt7ckG1rO3Jv4SY/zAbg9tq6E6sMU7EFV+77zk92alfOA13NlxtnpP+cIgissq6IX4ier/SQ5EDEgm09lvYvxnCRz8y4h17MoXtAtAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAFpCEKPK1axRAIimmbWgHnN2wri8oB71q5MeHNM7GZPFOw03EljBR1WNaaVSBIj2mb30zV6S/4hxo/DFFN9h5h//FRLJoMu6EMVwevN0oxkLCOxtzDjMaoVwzPMJTQEd587ePojWVN2xm4IMMQ1PXuUI5Xj57oeg9Wg0xtsOEw9JpTd3UMEdAUXq040Ih/kr1WqXQiECk/Y7Qq+4+l6ZmwglBOe28g3skHh72BEmlTyYdMxVdVgyJBdvr58lWr1nqiIFMicE58datnBZmbRbMso2FW6CQJhixygCBscMMktmWkyJt+sm6emDVMGcSIoIzWIJ9xiKrGIQDCYbunJWsr8=", + "client.offline.session.idle.timeout": "34560000", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "client.offline.session.max.lifespan": "34560000", + "display.on.consent.screen": "false", + "client.session.max.lifespan": "34560000", + "client.session.idle.timeout": "34560000", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": { + "direct_grant": "575f3da5-2c05-40cf-a859-609507918ca3", + "browser": "9c46c7d1-2884-4e1b-ae42-cd9a81f2f867" + }, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "protocolMappers": [ + { + "id": "17167a3f-d8a0-4aa9-bd9d-1c9760206a19", + "name": "website", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "website", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "website", + "jsonType.label": "String" + } + }, + { + "id": "a02a49fb-58f7-44f3-8d0c-8a014030cc95", + "name": "Client ID", + "protocol": "openid-connect", + "protocolMapper": "oidc-usersessionmodel-note-mapper", + "consentRequired": false, + "config": { + "user.session.note": "clientId", + "userinfo.token.claim": "true", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "clientId", + "jsonType.label": "String" + } + }, + { + "id": "9ee48135-b338-4498-8a62-85ffa31d95a7", + "name": "Client Host", + "protocol": "openid-connect", + "protocolMapper": "oidc-usersessionmodel-note-mapper", + "consentRequired": false, + "config": { + "user.session.note": "clientHost", + "userinfo.token.claim": "true", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "clientHost", + "jsonType.label": "String" + } + }, + { + "id": "88f5310c-3d3f-4c2f-9115-39efd203bef2", + "name": "Client IP Address", + "protocol": "openid-connect", + "protocolMapper": "oidc-usersessionmodel-note-mapper", + "consentRequired": false, + "config": { + "user.session.note": "clientAddress", + "userinfo.token.claim": "true", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "clientAddress", + "jsonType.label": "String" + } + } + ], + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "472d720d-fb14-46bc-81fb-fb6f9ce4ea32", + "clientId": "admin-cli", + "name": "${client_admin-cli}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret-jwt", + "secret": "**********", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": false, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "jwt.credential.certificate": "MIICoTCCAYkCBgF2I6T8YDANBgkqhkiG9w0BAQsFADAUMRIwEAYDVQQDDAlhZG1pbi1jbGkwHhcNMjAxMjAyMTMyODAzWhcNMzAxMjAyMTMyOTQzWjAUMRIwEAYDVQQDDAlhZG1pbi1jbGkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCDtcvxqfyA99N24pA+E/bC4a4+dz21I7AsO3s8PDDUYmYJWtVmE2XzleGrbavWsP2xOFNM70XJ0eywfcagn+fVkvpidInxO5th0jygg2f3vOKPvOTpMZxaHYcxwmof0ANKyXr9GSw9WBMLCPyVdxNZwcxx5ns9PiYV2w4ADJY4hzJLqgxil2Z4TjbLNvyFSKbSETDMdx1N266EPXQnBCGikD1fv4x8OHcX8MFpCqHOVxDjL8UZ5QjDpBcQWS+eLibLoax06ehLeZQSvpjoUI9Jrww9Ub4Xzk5aF51nV/CT1+1iHkhE1saklysj9MGlVKVzmEnK+67gK7LhHjB2igXJAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAClgDTFjpVjOB6KpPW56mnFrxvQUerPmSPJ9Umi6U5/NHRwZEDPxFjz1UfoESVjj5QJOJDrPQxOQYFGp1x8M0HEc1aTaEu55z1TL4AH3v3hJ268uKQzlxW2uNlv0gxN3j6kzbf7eGcCslJVAy8+g5JNaSgBxo75+wZbbvDcvXJWLv9WY9CKMvn8bha/RXIQSy1Df9DdwfKPL6A0WfJmEjKbOMxP0gdumq4CC99p+WFiOqtQ1GLd+nhzsWSh7xm0RpXf+J/fONrpxgK0+dk9pOJsO1N+nixXNwxQTBIpi6BpB9C4sow7o9Z49FGc/Neoe5qaTrHkxP+vGdRTvzpxMl28=", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "1564a757-4d29-4542-bf74-1b4c5e717c49", + "clientId": "admin-portal", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [ + "https://divoc-portal.xiv.in/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "login_theme": "divoc", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "91c2b80c-73fe-4dd0-a1eb-0797cc0b8e60", + "clientId": "broker", + "name": "${client_broker}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": {}, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "ac354645-3c3c-4592-879b-20a2f4f48302", + "clientId": "certificate-login", + "rootUrl": "https://divoc.xiv.in/certificate/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [ + "http://192.168.0.103:3000/*", + "https://divoc.xiv.in/*", + "http://localhost:3000/*", + "*", + "https://divoc.xiv.in/certificate/", + "http://localhost/certificate/*", + "https://divoc.xiv.in/certificate/*" + ], + "webOrigins": [ + "https://divoc.xiv.in", + "*", + "http://localhost", + "http://192.168.0.103:3000", + "http://localhost:3000" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "login_theme": "sys-admin", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "protocolMappers": [ + { + "id": "9f13d0e8-4b1c-4bc1-8a9f-eaa99746cb06", + "name": "group", + "protocol": "openid-connect", + "protocolMapper": "oidc-group-membership-mapper", + "consentRequired": false, + "config": { + "full.path": "true", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "group", + "userinfo.token.claim": "true" + } + } + ], + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "bae6d79b-dbd7-437d-a031-cd11aa0eca5d", + "clientId": "learn-app", + "rootUrl": "https://learn.xiv.in/", + "adminUrl": "http://localhost:4200/", + "baseUrl": "https://learn.xiv.in/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "http://localhost:4200/*", + "https://learn.xiv.in/*" + ], + "webOrigins": [ + "https://learn.xiv.in", + "http://localhost:4200" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": true, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "access.token.lifespan": "86400", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "oauth2.device.authorization.grant.enabled": "false", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature.keyinfo.ext": "false", + "use.refresh.tokens": "true", + "oidc.ciba.grant.enabled": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "client.offline.session.idle.timeout": "86400", + "consent.screen.text": "Additional information will help in giving better experience", + "saml.client.signature": "false", + "client.offline.session.max.lifespan": "86400", + "client.session.max.lifespan": "86400", + "client.session.idle.timeout": "86400", + "id.token.as.detached.signature": "false", + "saml.assertion.signature": "false", + "saml.encrypt": "false", + "login_theme": "ndear", + "saml.server.signature": "false", + "exclude.session.state.from.auth.response": "false", + "saml.artifact.binding": "false", + "saml_force_name_id_format": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "true", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "class" + ], + "optionalClientScopes": [] + }, + { + "id": "67f8c3d3-bdc0-4994-afae-67a878fd5a2f", + "clientId": "realm-management", + "name": "${client_realm-management}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": true, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": {}, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "0e2a70ff-2160-4683-b069-b3b71ea3e198", + "clientId": "registry", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": {}, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "196eb736-fa2a-40b8-b993-80c3d0ef9576", + "clientId": "registry-frontend", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "https://localhost:4202/*", + "https://ndear.xiv.in/*", + "http://20.198.64.128/*", + "http://localhost:4200/*", + "http://localhost:4202/*", + "https://localhost:4200/*", + "http://ndear.xiv.in/*" + ], + "webOrigins": [ + "https://localhost:4202", + "http://localhost:4202", + "https://localhost:4200", + "https://ndear.xiv.in", + "http://localhost:4200", + "http://ndear.xiv.in", + "http://20.198.64.128" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "id.token.as.detached.signature": "false", + "saml.assertion.signature": "false", + "access.token.lifespan": "86400", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "login_theme": "ndear", + "oauth2.device.authorization.grant.enabled": "false", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "use.refresh.tokens": "true", + "exclude.session.state.from.auth.response": "false", + "oidc.ciba.grant.enabled": "false", + "saml.artifact.binding": "false", + "backchannel.logout.session.required": "false", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "protocolMappers": [ + { + "id": "e9c76356-abfb-4ec5-8ecd-b5fb08ff1af0", + "name": "entity_name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "multivalued": "true", + "userinfo.token.claim": "true", + "user.attribute": "entity", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "entity", + "jsonType.label": "String" + } + } + ], + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "6041b161-6b7d-4851-b8da-0f4df1a1d80f", + "clientId": "security-admin-console", + "name": "${client_security-admin-console}", + "rootUrl": "${authAdminUrl}", + "baseUrl": "/admin/divoc/console/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [ + "/admin/divoc/console/*" + ], + "webOrigins": [ + "+" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "7972c526-7d8b-48d9-a81b-53d6c7feea75", + "name": "locale", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "locale", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "locale", + "jsonType.label": "String" + } + } + ], + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "26476c51-6632-40ee-9d92-1fe005400240", + "clientId": "t1", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [ + "https://divoc.xiv.in", + "https://oauth.pstmn.io/v1/callback" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": true, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "id.token.as.detached.signature": "false", + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "oauth2.device.authorization.grant.enabled": "false", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "use.refresh.tokens": "true", + "exclude.session.state.from.auth.response": "false", + "oidc.ciba.grant.enabled": "false", + "saml.artifact.binding": "false", + "backchannel.logout.session.required": "false", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "protocolMappers": [ + { + "id": "0f8f50bd-3d8e-477f-99d5-11ed54c350ea", + "name": "Client ID", + "protocol": "openid-connect", + "protocolMapper": "oidc-usersessionmodel-note-mapper", + "consentRequired": false, + "config": { + "user.session.note": "clientId", + "userinfo.token.claim": "true", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "clientId", + "jsonType.label": "String" + } + }, + { + "id": "72bba109-74f7-45cd-8c59-da3fbf7b16cc", + "name": "Client Host", + "protocol": "openid-connect", + "protocolMapper": "oidc-usersessionmodel-note-mapper", + "consentRequired": false, + "config": { + "user.session.note": "clientHost", + "userinfo.token.claim": "true", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "clientHost", + "jsonType.label": "String" + } + }, + { + "id": "e63b9b03-bbbc-4ef4-88d3-ea246f41a4d8", + "name": "Client IP Address", + "protocol": "openid-connect", + "protocolMapper": "oidc-usersessionmodel-note-mapper", + "consentRequired": false, + "config": { + "user.session.note": "clientAddress", + "userinfo.token.claim": "true", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "clientAddress", + "jsonType.label": "String" + } + } + ], + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + } + ], + "clientScopes": [ + { + "id": "7ad23886-6d73-4677-9b70-5a0378e24535", + "name": "microprofile-jwt", + "description": "Microprofile - JWT built-in scope", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "6636deaa-f1fc-4523-93ff-159a969a54d0", + "name": "upn", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "username", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "upn", + "jsonType.label": "String" + } + }, + { + "id": "0f4a9204-dcd8-4397-a3c6-f0ea3f6c06cd", + "name": "groups", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-realm-role-mapper", + "consentRequired": false, + "config": { + "multivalued": "true", + "userinfo.token.claim": "true", + "user.attribute": "foo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "groups", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "78992b14-f74f-45b7-aba5-619e854a9f58", + "name": "address", + "description": "OpenID Connect built-in scope: address", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${addressScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "7736d2d7-6d91-47bd-99f8-8d09299f292b", + "name": "address", + "protocol": "openid-connect", + "protocolMapper": "oidc-address-mapper", + "consentRequired": false, + "config": { + "user.attribute.formatted": "formatted", + "user.attribute.country": "country", + "user.attribute.postal_code": "postal_code", + "userinfo.token.claim": "true", + "user.attribute.street": "street", + "id.token.claim": "true", + "user.attribute.region": "region", + "access.token.claim": "true", + "user.attribute.locality": "locality" + } + } + ] + }, + { + "id": "1cffca71-fa8d-4e64-9eba-a5dac03723f1", + "name": "profile", + "description": "OpenID Connect built-in scope: profile", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${profileScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "e832bc91-34e9-4ba2-9a58-34d895b9653c", + "name": "family name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "lastName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "family_name", + "jsonType.label": "String" + } + }, + { + "id": "e12aba9f-e940-4b57-abc6-f54c1f2bd22f", + "name": "locale", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "locale", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "locale", + "jsonType.label": "String" + } + }, + { + "id": "12fe1f93-8be2-4b63-bc1a-6bff006a5e7e", + "name": "nickname", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "nickname", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "nickname", + "jsonType.label": "String" + } + }, + { + "id": "901b0602-8b19-491f-9572-d66b4ec18a5a", + "name": "gender", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "gender", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "gender", + "jsonType.label": "String" + } + }, + { + "id": "2bf52f5d-6b5e-4ec6-b7cd-4d859b0f3bcf", + "name": "given name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "firstName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "given_name", + "jsonType.label": "String" + } + }, + { + "id": "b306682b-abb7-4d0c-97f3-bee95ab01591", + "name": "full name", + "protocol": "openid-connect", + "protocolMapper": "oidc-full-name-mapper", + "consentRequired": false, + "config": { + "id.token.claim": "true", + "access.token.claim": "true", + "userinfo.token.claim": "true" + } + }, + { + "id": "f625962b-6008-49b7-9929-5e9bde6bb760", + "name": "birthdate", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "birthdate", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "birthdate", + "jsonType.label": "String" + } + }, + { + "id": "e4ac24f8-51de-4fcb-820e-5d25ec804d80", + "name": "profile", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "profile", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "profile", + "jsonType.label": "String" + } + }, + { + "id": "8a0b9a51-f795-4806-9d3c-2d4fcae4de68", + "name": "middle name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "middleName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "middle_name", + "jsonType.label": "String" + } + }, + { + "id": "df2089bc-d124-461e-b072-b81f44a9ec2f", + "name": "website", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "website", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "website", + "jsonType.label": "String" + } + }, + { + "id": "97bf9dcd-57f1-43bc-a1c1-0deb18b6ce76", + "name": "username", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "username", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "preferred_username", + "jsonType.label": "String" + } + }, + { + "id": "15333cc5-0a83-4654-89e7-4ca8302f68e3", + "name": "updated at", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "updatedAt", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "updated_at", + "jsonType.label": "String" + } + }, + { + "id": "5cc7aad9-50a9-4eed-b2ff-d737b8fc2a6c", + "name": "zoneinfo", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "zoneinfo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "zoneinfo", + "jsonType.label": "String" + } + }, + { + "id": "34639bfe-ecbd-49eb-9814-f6aef0d896f0", + "name": "picture", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "picture", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "picture", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "b8fb69e6-d80f-41b6-b66e-4b8665577b8c", + "name": "role_list", + "description": "SAML role list", + "protocol": "saml", + "attributes": { + "consent.screen.text": "${samlRoleListScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "c561def0-5fc9-4cc6-9cae-e3381892f08e", + "name": "role list", + "protocol": "saml", + "protocolMapper": "saml-role-list-mapper", + "consentRequired": false, + "config": { + "single": "false", + "attribute.nameformat": "Basic", + "attribute.name": "Role" + } + } + ] + }, + { + "id": "653b3af4-f3ca-4729-99c9-a9200d1111b6", + "name": "email", + "description": "OpenID Connect built-in scope: email", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${emailScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "30207dd4-99c3-4d30-b38b-fd280f95217e", + "name": "email verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "emailVerified", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "email_verified", + "jsonType.label": "boolean" + } + }, + { + "id": "0adb3d2b-b23b-4ae3-80a9-1a49a471ed27", + "name": "email", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "email", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "email", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "8c8ac374-fbdd-4f7e-9124-e037b8c1e6b3", + "name": "web-origins", + "description": "OpenID Connect scope for add allowed web origins to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "false", + "consent.screen.text": "" + }, + "protocolMappers": [ + { + "id": "6a8e23a3-b2fd-4115-94cc-9d14ed77a738", + "name": "allowed web origins", + "protocol": "openid-connect", + "protocolMapper": "oidc-allowed-origins-mapper", + "consentRequired": false, + "config": {} + } + ] + }, + { + "id": "d0a95f3b-5194-468d-bbc5-9039a466986d", + "name": "roles", + "description": "OpenID Connect scope for add user roles to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "true", + "consent.screen.text": "${rolesScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "d1e42520-a94a-45d3-ab35-baa5fe882418", + "name": "realm roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-realm-role-mapper", + "consentRequired": false, + "config": { + "user.attribute": "foo", + "access.token.claim": "true", + "claim.name": "realm_access.roles", + "jsonType.label": "String", + "multivalued": "true" + } + }, + { + "id": "1f3f524a-91b4-47da-999b-fa55e2d75a43", + "name": "client roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-client-role-mapper", + "consentRequired": false, + "config": { + "user.attribute": "foo", + "access.token.claim": "true", + "claim.name": "resource_access.${client_id}.roles", + "jsonType.label": "String", + "multivalued": "true" + } + }, + { + "id": "b007df7d-2624-421e-b10e-1e584d936cf5", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": {} + } + ] + }, + { + "id": "70c3e7a7-8857-4474-a81c-d0ed8fff0ff0", + "name": "phone", + "description": "OpenID Connect built-in scope: phone", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${phoneScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "3cce37b5-a759-47c5-bf2e-9e995fcd7743", + "name": "phone number verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "phoneNumberVerified", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "phone_number_verified", + "jsonType.label": "boolean" + } + }, + { + "id": "78be47fb-0e4b-4334-bc08-f0a2fdf89893", + "name": "phone number", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "phoneNumber", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "phone_number", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "9210c44a-442d-4c06-9ffe-ffb27257d769", + "name": "class", + "description": "Current academic level", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "Current academic level" + }, + "protocolMappers": [ + { + "id": "bd6b76d1-be71-4732-891e-d4696f09d94b", + "name": "class", + "protocol": "openid-connect", + "protocolMapper": "oidc-hardcoded-claim-mapper", + "consentRequired": false, + "config": { + "claim.value": "1", + "userinfo.token.claim": "true", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "consent.educationDetails", + "jsonType.label": "JSON", + "access.tokenResponse.claim": "false" + } + } + ] + }, + { + "id": "ceff28ae-4438-4bbb-adfc-47ca2425bf9a", + "name": "offline_access", + "description": "OpenID Connect built-in scope: offline_access", + "protocol": "openid-connect", + "attributes": { + "consent.screen.text": "${offlineAccessScopeConsentText}", + "display.on.consent.screen": "true" + } + } + ], + "defaultDefaultClientScopes": [ + "role_list", + "profile", + "email", + "roles", + "web-origins" + ], + "defaultOptionalClientScopes": [ + "offline_access", + "address", + "phone", + "microprofile-jwt" + ], + "browserSecurityHeaders": { + "contentSecurityPolicyReportOnly": "", + "xContentTypeOptions": "nosniff", + "xRobotsTag": "none", + "xFrameOptions": "SAMEORIGIN", + "contentSecurityPolicy": "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", + "xXSSProtection": "1; mode=block", + "strictTransportSecurity": "max-age=31536000; includeSubDomains" + }, + "smtpServer": {}, + "loginTheme": "ndear", + "eventsEnabled": false, + "eventsListeners": [ + "jboss-logging" + ], + "enabledEventTypes": [], + "adminEventsEnabled": false, + "adminEventsDetailsEnabled": false, + "identityProviders": [], + "identityProviderMappers": [], + "components": { + "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy": [ + { + "id": "3d60db9a-b74e-4ac7-a52e-ee52c029f047", + "name": "Allowed Protocol Mapper Types", + "providerId": "allowed-protocol-mappers", + "subType": "authenticated", + "subComponents": {}, + "config": { + "allowed-protocol-mapper-types": [ + "oidc-address-mapper", + "oidc-sha256-pairwise-sub-mapper", + "oidc-usermodel-property-mapper", + "saml-role-list-mapper", + "oidc-full-name-mapper", + "saml-user-property-mapper", + "saml-user-attribute-mapper", + "oidc-usermodel-attribute-mapper" + ] + } + }, + { + "id": "6ce20f73-1d49-4da9-a662-bb25da3f874c", + "name": "Max Clients Limit", + "providerId": "max-clients", + "subType": "anonymous", + "subComponents": {}, + "config": { + "max-clients": [ + "200" + ] + } + }, + { + "id": "199185ad-786f-4d1a-ada0-7e8ba9777467", + "name": "Consent Required", + "providerId": "consent-required", + "subType": "anonymous", + "subComponents": {}, + "config": {} + }, + { + "id": "9674d2a1-c1bb-484d-852f-5e3b8108b364", + "name": "Allowed Client Scopes", + "providerId": "allowed-client-templates", + "subType": "authenticated", + "subComponents": {}, + "config": { + "allow-default-scopes": [ + "true" + ] + } + }, + { + "id": "28792a7d-cc3c-46ee-a653-b611d45ff110", + "name": "Allowed Client Scopes", + "providerId": "allowed-client-templates", + "subType": "anonymous", + "subComponents": {}, + "config": { + "allow-default-scopes": [ + "true" + ] + } + }, + { + "id": "b4efac18-20d9-4d6a-aa47-919e295dbbb8", + "name": "Trusted Hosts", + "providerId": "trusted-hosts", + "subType": "anonymous", + "subComponents": {}, + "config": { + "host-sending-registration-request-must-match": [ + "true" + ], + "client-uris-must-match": [ + "true" + ] + } + }, + { + "id": "99a4426d-dae8-412e-84b5-fcc411ffce83", + "name": "Allowed Protocol Mapper Types", + "providerId": "allowed-protocol-mappers", + "subType": "anonymous", + "subComponents": {}, + "config": { + "allowed-protocol-mapper-types": [ + "oidc-usermodel-attribute-mapper", + "oidc-full-name-mapper", + "oidc-usermodel-property-mapper", + "oidc-address-mapper", + "saml-user-property-mapper", + "oidc-sha256-pairwise-sub-mapper", + "saml-user-attribute-mapper", + "saml-role-list-mapper" + ] + } + }, + { + "id": "cc90e400-8359-4c5d-8486-259d84a2db89", + "name": "Full Scope Disabled", + "providerId": "scope", + "subType": "anonymous", + "subComponents": {}, + "config": {} + } + ], + "org.keycloak.keys.KeyProvider": [ + { + "id": "daa93bb0-bb8c-4e1a-a617-e05e2f6ec1f0", + "name": "hmac-generated", + "providerId": "hmac-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ], + "algorithm": [ + "HS256" + ] + } + }, + { + "id": "eb178d96-4d0b-4b34-94a1-f76141cb8a9d", + "name": "aes-generated", + "providerId": "aes-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ] + } + }, + { + "id": "cb7c7891-4bee-433a-812f-1d56c34c2e29", + "name": "rsa-generated", + "providerId": "rsa-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ] + } + } + ] + }, + "internationalizationEnabled": false, + "supportedLocales": [ + "" + ], + "authenticationFlows": [ + { + "id": "c33707ed-80f7-4b0d-bb65-bd51c832724f", + "alias": "Account verification options", + "description": "Method with which to verity the existing account", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-email-verification", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 20, + "flowAlias": "Verify Existing Account by Re-authentication", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "56466478-2ece-4d15-be94-45db9b927223", + "alias": "Authentication Options", + "description": "Authentication options.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "basic-auth", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "basic-auth-otp", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "auth-spnego", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 30, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "af0f575b-11af-4912-91f5-ce6c3c56929b", + "alias": "Browser - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "auth-otp-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "83bacafe-8a2e-4579-bca9-0c60c90b55cf", + "alias": "Direct Grant - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "direct-grant-validate-otp", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "053faacf-a64b-4339-adce-a00e73397eba", + "alias": "First broker login - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "auth-otp-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "78c3a8a5-d215-4588-b014-e4ab84237ef0", + "alias": "Handle Existing Account", + "description": "Handle what to do if there is existing account with same email/username like authenticated identity provider", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-confirm-link", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 20, + "flowAlias": "Account verification options", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "959b357d-2fc2-450b-af60-d023cb771071", + "alias": "Reset - Conditional OTP", + "description": "Flow to determine if the OTP should be reset or not. Set to REQUIRED to force.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "reset-otp", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "48af41a5-8fe2-472a-ab43-f66d891a1d27", + "alias": "User creation or linking", + "description": "Flow for the existing/non-existing user alternatives", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorConfig": "create unique user config", + "authenticator": "idp-create-user-if-unique", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 20, + "flowAlias": "Handle Existing Account", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "3d091355-f493-474f-b6d6-4421f37ee90b", + "alias": "Verify Existing Account by Re-authentication", + "description": "Reauthentication of existing account", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-username-password-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 20, + "flowAlias": "First broker login - Conditional OTP", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "9c46c7d1-2884-4e1b-ae42-cd9a81f2f867", + "alias": "browser", + "description": "browser based authentication", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "auth-cookie", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "auth-spnego", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "identity-provider-redirector", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 25, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 30, + "flowAlias": "forms", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "61387790-a480-417d-b84d-3acb5d465400", + "alias": "clients", + "description": "Base authentication for clients", + "providerId": "client-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "client-secret", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "client-jwt", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "client-secret-jwt", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 30, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "client-x509", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 40, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "575f3da5-2c05-40cf-a859-609507918ca3", + "alias": "direct grant", + "description": "OpenID Connect Resource Owner Grant", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "direct-grant-validate-username", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "direct-grant-validate-password", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 30, + "flowAlias": "Direct Grant - Conditional OTP", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "416588ed-32ad-49eb-8848-ec69d84d8e8e", + "alias": "docker auth", + "description": "Used by Docker clients to authenticate against the IDP", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "docker-http-basic-authenticator", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "69160a96-61c3-424e-ada1-305e893d1453", + "alias": "first broker login", + "description": "Actions taken after first broker login with identity provider account, which is not yet linked to any Keycloak account", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorConfig": "review profile config", + "authenticator": "idp-review-profile", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 20, + "flowAlias": "User creation or linking", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "3d4ca5bd-8fea-41b8-a72a-9ad22b4ce44d", + "alias": "forms", + "description": "Username, password, otp and other auth forms.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "auth-username-password-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 20, + "flowAlias": "Browser - Conditional OTP", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "79023637-6c0f-44bd-a636-e02e7e043fd2", + "alias": "http challenge", + "description": "An authentication flow based on challenge-response HTTP Authentication Schemes", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "no-cookie-redirect", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 20, + "flowAlias": "Authentication Options", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "e0932a41-41a2-49d1-ab1d-d804cf0318d2", + "alias": "mobile login", + "description": "browser based authentication", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": false, + "authenticationExecutions": [ + { + "authenticator": "auth-cookie", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "mobile-otp-login", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "identity-provider-redirector", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 25, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 30, + "flowAlias": "mobile login forms", + "userSetupAllowed": false, + "autheticatorFlow": true + }, + { + "authenticator": "auth-spnego", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 31, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "d747f766-f314-40b8-ad79-7ff9b45ee8de", + "alias": "mobile login forms", + "description": "Username, password, otp and other auth forms.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": false, + "authenticationExecutions": [ + { + "authenticator": "mobile-otp-login", + "authenticatorFlow": false, + "requirement": "CONDITIONAL", + "priority": 0, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "839f3012-68ff-467c-8d8e-3121182d54ff", + "alias": "registration", + "description": "registration flow", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "registration-page-form", + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 10, + "flowAlias": "registration form", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "5ad88eca-a962-4d73-82c7-5452db1c19fa", + "alias": "registration form", + "description": "registration form", + "providerId": "form-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "registration-user-creation", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "registration-profile-action", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 40, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "registration-password-action", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 50, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "registration-recaptcha-action", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 60, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "b2e902d7-684e-45db-bdfc-cf4355b48d27", + "alias": "reset credentials", + "description": "Reset credentials for a user if they forgot their password or something", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "reset-credentials-choose-user", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "reset-credential-email", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "reset-password", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 30, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 40, + "flowAlias": "Reset - Conditional OTP", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "c3f7d38d-23bf-41f4-b1d3-fc80c9c0cc7b", + "alias": "saml ecp", + "description": "SAML ECP Profile Authentication Flow", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "http-basic-authenticator", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + } + ], + "authenticatorConfig": [ + { + "id": "536b60b8-0432-4afb-96bf-45b3ff9b8269", + "alias": "create unique user config", + "config": { + "require.password.update.after.registration": "false" + } + }, + { + "id": "1426074c-5c56-49f2-928f-d464b94e4d01", + "alias": "review profile config", + "config": { + "update.profile.on.first.login": "missing" + } + } + ], + "requiredActions": [ + { + "alias": "CONFIGURE_TOTP", + "name": "Configure OTP", + "providerId": "CONFIGURE_TOTP", + "enabled": true, + "defaultAction": false, + "priority": 10, + "config": {} + }, + { + "alias": "terms_and_conditions", + "name": "Terms and Conditions", + "providerId": "terms_and_conditions", + "enabled": false, + "defaultAction": false, + "priority": 20, + "config": {} + }, + { + "alias": "UPDATE_PASSWORD", + "name": "Update Password", + "providerId": "UPDATE_PASSWORD", + "enabled": true, + "defaultAction": false, + "priority": 30, + "config": {} + }, + { + "alias": "UPDATE_PROFILE", + "name": "Update Profile", + "providerId": "UPDATE_PROFILE", + "enabled": true, + "defaultAction": false, + "priority": 40, + "config": {} + }, + { + "alias": "VERIFY_EMAIL", + "name": "Verify Email", + "providerId": "VERIFY_EMAIL", + "enabled": true, + "defaultAction": false, + "priority": 50, + "config": {} + }, + { + "alias": "delete_account", + "name": "Delete Account", + "providerId": "delete_account", + "enabled": false, + "defaultAction": false, + "priority": 60, + "config": {} + }, + { + "alias": "update_user_locale", + "name": "Update User Locale", + "providerId": "update_user_locale", + "enabled": true, + "defaultAction": false, + "priority": 1000, + "config": {} + } + ], + "browserFlow": "mobile login", + "registrationFlow": "registration", + "directGrantFlow": "direct grant", + "resetCredentialsFlow": "reset credentials", + "clientAuthenticationFlow": "clients", + "dockerAuthenticationFlow": "docker auth", + "attributes": { + "cibaBackchannelTokenDeliveryMode": "poll", + "cibaExpiresIn": "120", + "cibaAuthRequestedUserHint": "login_hint", + "oauth2DeviceCodeLifespan": "600", + "clientOfflineSessionMaxLifespan": "0", + "oauth2DevicePollingInterval": "600", + "clientSessionIdleTimeout": "600", + "clientSessionMaxLifespan": "600", + "frontendUrl": "", + "clientOfflineSessionIdleTimeout": "0", + "cibaInterval": "5" + }, + "keycloakVersion": "14.0.0", + "userManagedAccessAllowed": false, + "clientProfiles": { + "profiles": [] + }, + "clientPolicies": { + "policies": [] + } +} \ No newline at end of file diff --git a/schemas/.gitignore b/schemas/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/schemas/Common.json b/schemas/Common.json index ceb0ece..5a87ade 100644 --- a/schemas/Common.json +++ b/schemas/Common.json @@ -29,17 +29,28 @@ "format": "date", "title": "DOB" }, - "identityType": { - "$id": "#/properties/identityType", - "type": "string", - "$comment": "Nationality", - "title": "ID Type" - }, - "identityValue": { - "$id": "#/properties/identityValue", - "type": "string", - "$comment": "Nationality", - "title": "ID Value" + "identityHolder": { + "type": "object", + "properties": { + "type": { + "$id": "#/properties/type", + "type": "string", + "$comment": "Nationality", + "title": "ID Type", + "enum": [ + "AADHAR", + "PAN", + "LICENSE", + "OTHER" + ] + }, + "value": { + "$id": "#/properties/value", + "type": "string", + "$comment": "Nationality", + "title": "ID Value" + } + } } } }, @@ -49,10 +60,6 @@ "description": "Contact Details", "required": [], "properties": { - "name": { - "type": "string", - "title": "Name" - }, "email": { "$id": "#/properties/email", "type": "string", @@ -73,10 +80,15 @@ "AcademicQualification": { "type": "object", "properties": { - "institute": { - "$id": "#/properties/institute", + "instituteOSID": { + "$id": "#/properties/instituteOSID", "type": "string", - "title": "Institute Full Name" + "title": "Institute OSID" + }, + "instituteName": { + "$id": "#/properties/instituteName", + "type": "string", + "title": "Institute Name" }, "qualification": { "$id": "#/properties/qualification", @@ -103,10 +115,15 @@ "ExperienceType": { "type": "object", "properties": { - "institute": { - "$id": "#/properties/institute", + "instituteOSID": { + "$id": "#/properties/instituteOSID", "type": "string", - "title": "Institute Full Name" + "title": "Institute OSID" + }, + "instituteName": { + "$id": "#/properties/instituteName", + "type": "string", + "title": "Institute Name" }, "employmentType": { "$id": "#/properties/employmentType", @@ -135,40 +152,55 @@ "title": "Teacher Type", "enum": [ "Head teacher", + "Acting head teacher", + "Teacher", + "Instructor positioned as per RTE", "Principal", "VicePrincipal", - "Lecture" + "Lecturer" ] }, - "subjects": { - "$id": "#/properties/subjects", + "subjectsTaught": { + "$id": "#/properties/subjectsTaught", + "title": "Subjects Taught", "type": "array", - "title": "Subjects teaching at this Institute", "items": { - "type": "string" - } - }, - "grades": { - "$id": "#/properties/grades", - "type": "array", - "title": "Grades Taught (per subject taught)", - "items": { - "type": "string", - "enum": [ - "Pre-Pri.", - "Class I", - "Class II", - "Class III", - "Class IV", - "Class V", - "Class VI", - "Class VII", - "Class VIII", - "Class IX", - "Class X", - "Class XI", - "Class XII" - ] + "type": "object", + "properties": { + "subjects": { + "$id": "#/properties/subjects", + "type": "string", + "title": "Subject", + "enum": [ + "English", + "Kannada", + "Mathematics", + "Science", + "Social Science", + "Art" + ] + }, + "grades": { + "$id": "#/properties/grades", + "type": "string", + "title": "Grades", + "enum": [ + "Pre-Pri.", + "Class I", + "Class II", + "Class III", + "Class IV", + "Class V", + "Class VI", + "Class VII", + "Class VIII", + "Class IX", + "Class X", + "Class XI", + "Class XII" + ] + } + } } } } @@ -181,6 +213,11 @@ "type": "string", "title": "Institute Name" }, + "instituteOSID": { + "$id": "#/properties/instituteOSID", + "type": "string", + "title": "Institute Osid" + }, "board": { "$id": "#/properties/board", "type": "string", @@ -189,6 +226,13 @@ "medium": { "$id": "#/properties/program", "type": "string", + "enum": [ + "English", + "Hindi", + "Gujarati", + "Malayalam", + "Tamil" + ], "title": "Medium of Education" }, "class": { @@ -210,6 +254,19 @@ "Class XII" ], "title": "Current Enrollment Class / Std." + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fileName": { + "type": "string", + "format": "file" + } + } + }, + "title": "Education related documents" } } }, @@ -219,15 +276,12 @@ "fullName": { "$id": "#/properties/fullName", "type": "string", - "title": "Full Name" + "title": "Guardian's Full Name" }, "relation": { "$id": "#/properties/relation", "type": "string", - "title": "Relation type" - }, - "email": { - "$ref": "#/definitions/ContactDetails/properties/email" + "title": "Guardian Relation type" } } }, @@ -247,10 +301,18 @@ } } }, + "Document": { + "type": "object", + "properties": { + "fileName": { + "type": "string", + "format": "file" + } + } + }, "Address": { "type": "object", "required": [ - ], "properties": { "plot": { @@ -271,7 +333,46 @@ }, "state": { "type": "string", - "title": "State" + "title": "State", + "enum": [ + "Andaman and Nicobar Islands", + "Andhra Pradesh", + "Arunachal Pradesh", + "Assam", + "Bihar", + "Chandigarh", + "Chhattisgarh", + "Dadra and Nagar Haveli", + "Daman and Diu", + "Delhi", + "Goa", + "Gujarat", + "Haryana", + "Himachal Pradesh", + "Jammu and Kashmir", + "Jharkhand", + "Karnataka", + "Kerala", + "Ladakh", + "Lakshadweep", + "Madhya Pradesh", + "Maharashtra", + "Manipur", + "Meghalaya", + "Mizoram", + "Nagaland", + "Odisha", + "Puducherry", + "Punjab", + "Rajasthan", + "Sikkim", + "Tamil Nadu", + "Telangana", + "Tripura", + "Uttar Pradesh", + "Uttarakhand", + "West Bengal" + ] }, "district": { "type": "string", diff --git a/schemas/Institute.json b/schemas/Institute.json index a85f349..b561681 100644 --- a/schemas/Institute.json +++ b/schemas/Institute.json @@ -111,6 +111,7 @@ "properties": { "medium": { "type": "string", + "enum": ["English", "Hindi", "Gujarati", "Malayalam", "Tamil"], "title": "Medium of Education" }, "board": { @@ -132,7 +133,22 @@ "classes": { "type": "array", "items": { - "type": "string" + "type": "string", + "enum": [ + "Pre-Pri.", + "Class I", + "Class II", + "Class III", + "Class IV", + "Class V", + "Class VI", + "Class VII", + "Class VIII", + "Class IX", + "Class X", + "Class XI", + "Class XII" + ] }, "title": "Classes / Grades" } @@ -160,15 +176,30 @@ ], "attestationPolicies": [ { - "property": "affiliation/[]", - "paths": [ - "affiliation", - "instituteName" - ], - "attestorEntity": "board-cbse", - "conditions": "(ATTESTOR#$.[*]#.contains('board-cbse'))" + "name": "instituteAffiliation", + "conditions": "(ATTESTOR#$.[*]#.contains('board-cbse'))", + "type": "MANUAL", + "attestorPlugin": "did:internal:ClaimPluginActor?entity=board-cbse", + "attestationProperties": { + "affiliation": "$.affiliation", + "instituteName": "$.instituteName" + } } ], - "subjectJsonPath": "email" + "internalFields": [], + "inviteRoles":["anonymous"], + "enableLogin": true, + "ownershipAttributes": [ + { + "email": "/email", + "mobile": "/email", + "userId": "/email" + }, + { + "email": "/adminEmail", + "mobile": "/adminMobile", + "userId": "/adminEmail" + } + ] } } \ No newline at end of file diff --git a/schemas/Student.json b/schemas/Student.json index 3508b56..3b70c78 100644 --- a/schemas/Student.json +++ b/schemas/Student.json @@ -76,31 +76,27 @@ ], "attestationPolicies": [ { - "name": "schoolId", + "name": "studentInstituteAttest", "additionalInput": { "enrollmentNumber": {"type": "string"} }, "attestationProperties": { "name": "$.identityDetails.fullName", - "institute": "$.educationDetails[0].institute" + "educationDetails": "$.educationDetails" }, - "paths": ["$.educationDetails[?(@.osid == 'PROPERTY_ID')]['institute', 'program', 'graduationYear', 'marks']", "$.identityDetails['fullName']"], "type": "MANUAL", - "attestorEntity": "Teacher", - "conditions": "(ATTESTOR#$.experience.[*].institute#.contains(REQUESTER#$.institute#))", - "attestorPlugin": "did:internal:ClaimPluginActor?entity=Teacher", - "credentialTemplate": {} + "conditions": "(ATTESTOR#$.experience.[*].instituteOSID#.contains(REQUESTER#$.educationDetails.*.instituteOSID#))", + "attestorPlugin": "did:internal:ClaimPluginActor?entity=Teacher" } ], "inviteRoles":["anonymous"], "enableLogin": true, "ownershipAttributes": [ { - "email":"/ContactDetails/email", - "mobile":"/ContactDetails/mobile", - "userId":"/ContactDetails/mobile" + "email": "/contactDetails/email", + "mobile": "/contactDetails/mobile", + "userId": "/contactDetails/mobile" } ] - } } \ No newline at end of file diff --git a/schemas/Teacher.json b/schemas/Teacher.json index 9fd3daa..6f0a3b9 100644 --- a/schemas/Teacher.json +++ b/schemas/Teacher.json @@ -75,20 +75,22 @@ ], "attestationPolicies": [ { - "property": "experience/[]", - "paths": [ - "experience" - ], - "attestorEntity": "Institute", - "conditions": "(ATTESTOR#$.instituteName#.contains(REQUESTER#$.institute#))" + "name": "teacherExperience", + "conditions": "(ATTESTOR#$.osid#.contains(REQUESTER#$.experience.*.instituteOSID#))", + "type": "MANUAL", + "attestorPlugin": "did:internal:ClaimPluginActor?entity=Institute", + "attestationProperties": { + "experience": "$.experience" + } }, { - "property": "academicQualifications/[]", - "paths": [ - "academicQualifications" - ], - "attestorEntity": "Institute", - "conditions": "(ATTESTOR#$.instituteName#.contains(REQUESTER#$.institute#))" + "name": "teacherAcademicsQualification", + "conditions": "(ATTESTOR#$.osid#.contains(REQUESTER#$.academicQualifications.*.instituteOSID#))", + "type": "MANUAL", + "attestorPlugin": "did:internal:ClaimPluginActor?entity=Institute", + "attestationProperties": { + "academicQualifications": "$.academicQualifications" + } } ], "internalFields": [], @@ -96,10 +98,10 @@ "enableLogin": true, "ownershipAttributes": [ { - "email":"/ContactDetails/email", - "mobile":"/ContactDetails/mobile", - "userId":"/ContactDetails/mobile" + "email": "/contactDetails/email", + "mobile": "/contactDetails/mobile", + "userId": "/contactDetails/mobile" } ] } -} +} \ No newline at end of file diff --git a/student-claim.ipynb b/student-claim.ipynb index 030b5c4..6afd7ce 100644 --- a/student-claim.ipynb +++ b/student-claim.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 515, + "execution_count": 1, "id": "3f0dd619", "metadata": {}, "outputs": [], @@ -22,17 +22,18 @@ }, { "cell_type": "code", - "execution_count": 516, + "execution_count": 2, "id": "22c16507", "metadata": {}, "outputs": [], "source": [ - "base_url = \"http://localhost:8081\"" + "base_url = \"https://ndear.xiv.in/registry\"\n", + "keycloak_url = \"https://ndear.xiv.in\"" ] }, { "cell_type": "code", - "execution_count": 517, + "execution_count": 3, "id": "4c0e4ef1", "metadata": {}, "outputs": [], @@ -45,11 +46,12 @@ }, { "cell_type": "code", - "execution_count": 518, + "execution_count": 4, "id": "27da0f32", "metadata": {}, "outputs": [], "source": [ + "\n", "resp = requests.get(\"%s/api/docs/swagger.json\"%base_url)\n", "assert resp.status_code == 200\n", "assert resp.json()[\"swagger\"] == \"2.0\"\n", @@ -58,17 +60,17 @@ }, { "cell_type": "code", - "execution_count": 519, + "execution_count": 5, "id": "0edbbada", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "dict_keys(['/api/v1/Institute/{entityId}', '/api/docs/Institute.json', '/api/v1/Institute/invite', '/api/v1/Institute/sign', '/api/v1/Institute/search', '/api/v1/Institute', '/api/v1/Institute/{entityId}/{property}/{propertyId}', '/api/v1/Institute/{entityId}/{property}', '/api/v1/Institute/{entityId}/{property}/{propertyId}/send', '/api/v1/Teacher/{entityId}', '/api/docs/Teacher.json', '/api/v1/Teacher/invite', '/api/v1/Teacher/sign', '/api/v1/Teacher/search', '/api/v1/Teacher', '/api/v1/Teacher/{entityId}/{property}/{propertyId}', '/api/v1/Teacher/{entityId}/{property}', '/api/v1/Teacher/{entityId}/{property}/{propertyId}/send', '/api/v1/BaseAttestationField/{entityId}', '/api/docs/BaseAttestationField.json', '/api/v1/BaseAttestationField/invite', '/api/v1/BaseAttestationField/sign', '/api/v1/BaseAttestationField/search', '/api/v1/BaseAttestationField', '/api/v1/BaseAttestationField/{entityId}/{property}/{propertyId}', '/api/v1/BaseAttestationField/{entityId}/{property}', '/api/v1/BaseAttestationField/{entityId}/{property}/{propertyId}/send', '/api/v1/Student/{entityId}', '/api/docs/Student.json', '/api/v1/Student/invite', '/api/v1/Student/sign', '/api/v1/Student/search', '/api/v1/Student', '/api/v1/Student/{entityId}/{property}/{propertyId}', '/api/v1/Student/{entityId}/{property}', '/api/v1/Student/{entityId}/{property}/{propertyId}/send', '/api/v1/Common/{entityId}', '/api/docs/Common.json', '/api/v1/Common/invite', '/api/v1/Common/sign', '/api/v1/Common/search', '/api/v1/Common', '/api/v1/Common/{entityId}/{property}/{propertyId}', '/api/v1/Common/{entityId}/{property}', '/api/v1/Common/{entityId}/{property}/{propertyId}/send'])" + "dict_keys(['/api/v1/Institute/{entityId}', '/api/docs/Institute.json', '/api/v1/Institute/sign', '/api/v1/Institute/search', '/api/v1/Institute/invite', '/api/v1/Institute', '/api/v1/Institute/{entityId}/{property}/{propertyId}', '/api/v1/Institute/{entityId}/{property}', '/api/v1/Institute/{entityId}/{property}/{propertyId}/send', '/api/v1/Teacher/{entityId}', '/api/docs/Teacher.json', '/api/v1/Teacher/sign', '/api/v1/Teacher/search', '/api/v1/Teacher/invite', '/api/v1/Teacher', '/api/v1/Teacher/{entityId}/{property}/{propertyId}', '/api/v1/Teacher/{entityId}/{property}', '/api/v1/Teacher/{entityId}/{property}/{propertyId}/send', '/api/v1/BaseAttestationField/{entityId}', '/api/docs/BaseAttestationField.json', '/api/v1/BaseAttestationField/sign', '/api/v1/BaseAttestationField/search', '/api/v1/BaseAttestationField/invite', '/api/v1/BaseAttestationField', '/api/v1/BaseAttestationField/{entityId}/{property}/{propertyId}', '/api/v1/BaseAttestationField/{entityId}/{property}', '/api/v1/BaseAttestationField/{entityId}/{property}/{propertyId}/send', '/api/v1/Student/{entityId}', '/api/docs/Student.json', '/api/v1/Student/sign', '/api/v1/Student/search', '/api/v1/Student/invite', '/api/v1/Student', '/api/v1/Student/{entityId}/{property}/{propertyId}', '/api/v1/Student/{entityId}/{property}', '/api/v1/Student/{entityId}/{property}/{propertyId}/send', '/api/v1/Common/{entityId}', '/api/docs/Common.json', '/api/v1/Common/sign', '/api/v1/Common/search', '/api/v1/Common/invite', '/api/v1/Common', '/api/v1/Common/{entityId}/{property}/{propertyId}', '/api/v1/Common/{entityId}/{property}', '/api/v1/Common/{entityId}/{property}/{propertyId}/send'])" ] }, - "execution_count": 519, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -80,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 520, + "execution_count": 31, "id": "96d0bcfe", "metadata": {}, "outputs": [ @@ -90,7 +92,7 @@ "'/api/docs/Institute.json'" ] }, - "execution_count": 520, + "execution_count": 31, "metadata": {}, "output_type": "execute_result" } @@ -102,7 +104,7 @@ }, { "cell_type": "code", - "execution_count": 521, + "execution_count": 32, "id": "180d3352", "metadata": {}, "outputs": [], @@ -113,7 +115,7 @@ }, { "cell_type": "code", - "execution_count": 522, + "execution_count": 33, "id": "9825fec2", "metadata": {}, "outputs": [ @@ -180,18 +182,32 @@ " 'affiliation': {'type': 'array',\n", " 'items': {'type': 'object',\n", " 'properties': {'medium': {'type': 'string',\n", + " 'enum': ['English', 'Hindi', 'Gujarati', 'Malayalam', 'Tamil'],\n", " 'title': 'Medium of Education'},\n", " 'board': {'type': 'string', 'title': 'Affiliations Board'},\n", " 'affiliationNumber': {'type': 'string', 'title': 'Affiliation Number'},\n", " 'grantYear': {'type': 'string', 'title': 'Grant year'},\n", " 'expiryYear': {'type': 'string', 'title': 'Expiry Year'},\n", " 'classes': {'type': 'array',\n", - " 'items': {'type': 'string'},\n", + " 'items': {'type': 'string',\n", + " 'enum': ['Pre-Pri.',\n", + " 'Class I',\n", + " 'Class II',\n", + " 'Class III',\n", + " 'Class IV',\n", + " 'Class V',\n", + " 'Class VI',\n", + " 'Class VII',\n", + " 'Class VIII',\n", + " 'Class IX',\n", + " 'Class X',\n", + " 'Class XI',\n", + " 'Class XII']},\n", " 'title': 'Classes / Grades'}}},\n", " 'title': 'Affiliation'}}}}" ] }, - "execution_count": 522, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -202,7 +218,7 @@ }, { "cell_type": "code", - "execution_count": 523, + "execution_count": 34, "id": "50e5149a", "metadata": {}, "outputs": [ @@ -216,7 +232,7 @@ " '/api/v1/Common/invite']" ] }, - "execution_count": 523, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -227,7 +243,7 @@ }, { "cell_type": "code", - "execution_count": 524, + "execution_count": 35, "id": "8bd262de", "metadata": {}, "outputs": [ @@ -237,7 +253,7 @@ "'/api/v1/Teacher/invite'" ] }, - "execution_count": 524, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -249,7 +265,7 @@ }, { "cell_type": "code", - "execution_count": 525, + "execution_count": 36, "id": "9ad5283a", "metadata": {}, "outputs": [], @@ -259,25 +275,25 @@ " \"userName\":userId,\n", " \"dob\":\"2020-12-12\",\n", " },\n", - " \"IdentityDetails\":{\"type\":\"id\",\"value\":userId}, \n", - " \"ContactDetails\":{ \"mobile\":\"%s\"%userId,\"email\":\"%s@example.com\"%userId,\n", + " \"identityDetails\":{\"type\":\"id\",\"value\":userId}, \n", + " \"contactDetails\":{ \"mobile\":\"%s\"%userId,\"email\":\"%s@example.com\"%userId,\n", " \"address\":{\"street\":\"abc\",\"state\":\"Karnataka\",\"pincode\":\"560001\"}}\n", " }" ] }, { "cell_type": "code", - "execution_count": 526, + "execution_count": 37, "id": "547ea7ab", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'{\"personalDetails\": {\"userName\": 12, \"dob\": \"2020-12-12\"}, \"IdentityDetails\": {\"type\": \"id\", \"value\": 12}, \"ContactDetails\": {\"mobile\": \"12\", \"email\": \"12@example.com\", \"address\": {\"street\": \"abc\", \"state\": \"Karnataka\", \"pincode\": \"560001\"}}}'" + "'{\"personalDetails\": {\"userName\": 12, \"dob\": \"2020-12-12\"}, \"identityDetails\": {\"type\": \"id\", \"value\": 12}, \"contactDetails\": {\"mobile\": \"12\", \"email\": \"12@example.com\", \"address\": {\"street\": \"abc\", \"state\": \"Karnataka\", \"pincode\": \"560001\"}}}'" ] }, - "execution_count": 526, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -297,7 +313,7 @@ }, { "cell_type": "code", - "execution_count": 527, + "execution_count": 38, "id": "0fbcad28", "metadata": {}, "outputs": [ @@ -305,8 +321,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "b'{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1644163757356,\"params\":{\"resmsgid\":\"\",\"msgid\":\"76eda9e2-23d5-448a-820e-3a89e62ab45a\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Teacher\":{\"osid\":\"1-f5115e92-9ceb-4898-a08a-44d6e9c76897\"}}}'\n", - "{'id': 'sunbird-rc.registry.invite', 'ver': '1.0', 'ets': 1644163757356, 'params': {'resmsgid': '', 'msgid': '76eda9e2-23d5-448a-820e-3a89e62ab45a', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'Teacher': {'osid': '1-f5115e92-9ceb-4898-a08a-44d6e9c76897'}}}\n" + "b'{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1645085037352,\"params\":{\"resmsgid\":\"\",\"msgid\":\"c302a2df-dcda-4781-aa0e-66f1b16b9ca7\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Teacher\":{\"osid\":\"1-d416775c-731c-40bc-9e69-20ebcff327e5\"}}}'\n", + "{'id': 'sunbird-rc.registry.invite', 'ver': '1.0', 'ets': 1645085037352, 'params': {'resmsgid': '', 'msgid': 'c302a2df-dcda-4781-aa0e-66f1b16b9ca7', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'Teacher': {'osid': '1-d416775c-731c-40bc-9e69-20ebcff327e5'}}}\n" ] } ], @@ -326,17 +342,17 @@ }, { "cell_type": "code", - "execution_count": 528, + "execution_count": 39, "id": "e0096a4c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'1-f5115e92-9ceb-4898-a08a-44d6e9c76897'" + "'1-d416775c-731c-40bc-9e69-20ebcff327e5'" ] }, - "execution_count": 528, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -347,17 +363,17 @@ }, { "cell_type": "code", - "execution_count": 529, + "execution_count": 40, "id": "a4ff65b9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'61532629118'" + "'47266833823'" ] }, - "execution_count": 529, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } @@ -376,7 +392,7 @@ }, { "cell_type": "code", - "execution_count": 613, + "execution_count": 41, "id": "9e5c997a", "metadata": {}, "outputs": [ @@ -384,6 +400,7 @@ "name": "stdout", "output_type": "stream", "text": [ + "{'access_token': 'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJVVG9zZ2JYUFZHdmk2a19tVnVEa1oxTTZHeGNtYnBDZW9lTHJBUjJKcC04In0.eyJleHAiOjE2NDUwODU2NDIsImlhdCI6MTY0NTA4NTA0MiwianRpIjoiNzE0ZDA2NDItNTg5My00MDY5LWJmY2MtMDE0NTRmZWM2M2JjIiwiaXNzIjoiaHR0cDovL25kZWFyLnhpdi5pbi9hdXRoL3JlYWxtcy9zdW5iaXJkLXJjIiwiYXVkIjoiYWNjb3VudCIsInN1YiI6IjFjMTQxZWI0LWQwMTctNDFkNS05ODEwLTgxNmE1ZjZkZGVkZSIsInR5cCI6IkJlYXJlciIsImF6cCI6InJlZ2lzdHJ5LWZyb250ZW5kIiwic2Vzc2lvbl9zdGF0ZSI6ImI0ZTBkZTc5LWFjMGYtNGQ2ZS1hMjQzLWQxMzk4MDgwNzdmMSIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cHM6Ly9sb2NhbGhvc3Q6NDIwMiIsImh0dHA6Ly9sb2NhbGhvc3Q6NDIwMiIsImh0dHBzOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwczovL25kZWFyLnhpdi5pbiIsImh0dHA6Ly9sb2NhbGhvc3Q6NDIwMCIsImh0dHA6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vMjAuMTk4LjY0LjEyOCJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiIsImRlZmF1bHQtcm9sZXMtbmRlYXIiXX0sInJlc291cmNlX2FjY2VzcyI6eyJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6InByb2ZpbGUgZW1haWwiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsInByZWZlcnJlZF91c2VybmFtZSI6IjQ3MjY2ODMzODIzIiwiZW50aXR5IjpbIlRlYWNoZXIiXSwiZW1haWwiOiI0NzI2NjgzMzgyM0BleGFtcGxlLmNvbSJ9.k5GzJYBw1uSLu8Ul2F8zn2QxfxrcfLfU54gqUXTPfECqXznLMZseIsNEvPSPdMa-vW387s6bN3L-5iKSreziQZ31VBf63D5DDX1lcglzNkaSo22R1KUIo86AchEMNbLOJEgFCx0xlE1AhE79-mNFUbrHMl2NXG4feIXbXQRthPu623Yx9Bp9-fM2vtNSShtL23pJjVlrHk6D2cXG1wIGgFfcwGlI7ywNNcwsE9-cuEEPlUj5rQt4AGvB6-1vFAM4GHV55TkwO6wy4twtjoC5RqsrYXt-oetBPqHFoXXbDIs1w8pGrJJA4q_r-2Fk_2uWujD2G1iInVjBK2JZTvu6PQ', 'expires_in': 600, 'refresh_expires_in': 600, 'refresh_token': 'eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI1MjM1ZTJhMy1hNThkLTRlODEtYmJmNS00Y2NhZWI3YzYwYjEifQ.eyJleHAiOjE2NDUwODU2NDIsImlhdCI6MTY0NTA4NTA0MiwianRpIjoiOGQ2MDU5OTMtMDQxZi00ODNhLWEwYjUtOWIwNTQ3NGRjN2MxIiwiaXNzIjoiaHR0cDovL25kZWFyLnhpdi5pbi9hdXRoL3JlYWxtcy9zdW5iaXJkLXJjIiwiYXVkIjoiaHR0cDovL25kZWFyLnhpdi5pbi9hdXRoL3JlYWxtcy9zdW5iaXJkLXJjIiwic3ViIjoiMWMxNDFlYjQtZDAxNy00MWQ1LTk4MTAtODE2YTVmNmRkZWRlIiwidHlwIjoiUmVmcmVzaCIsImF6cCI6InJlZ2lzdHJ5LWZyb250ZW5kIiwic2Vzc2lvbl9zdGF0ZSI6ImI0ZTBkZTc5LWFjMGYtNGQ2ZS1hMjQzLWQxMzk4MDgwNzdmMSIsInNjb3BlIjoicHJvZmlsZSBlbWFpbCJ9.2d5mUyi1LO1zg8DQ5qIsVjA6-Q6UDK6GcIOdyQhZ88M', 'token_type': 'Bearer', 'not-before-policy': 1607576887, 'session_state': 'b4e0de79-ac0f-4d6e-a243-d139808077f1', 'scope': 'profile email'}\n", "200\n" ] } @@ -400,25 +417,25 @@ " 'grant_type': 'password'\n", "}\n", "\n", - "response = requests.post('http://keycloak:8080/auth/realms/sunbird-rc/protocol/openid-connect/token', headers=headers, data=data)\n", - "\n", + "response = requests.post('%s/auth/realms/sunbird-rc/protocol/openid-connect/token'%(keycloak_url), headers=headers, data=data)\n", + "print(response.json())\n", "print(response.status_code)\n", "token = response.json()[\"access_token\"]\n" ] }, { "cell_type": "code", - "execution_count": 614, + "execution_count": 42, "id": "5162487f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJaUk4xbE9rdkloSjEzQjdjcEVXQlBIQURER01lZUFHVmUyTkx2QlpLT29vIn0.eyJleHAiOjE2NDQxNzUzNTIsImlhdCI6MTY0NDE3NDc1MiwianRpIjoiNTg3NDAzOTItNTAyMS00OTE5LTlmNmItNjU4OGE4MzNlOTM4IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIyYWViNzcwZS00ZTE1LTQ4YzUtOTViNC1hZTRhM2FhMzc2NzUiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiJkNzRjMDk2Mi01MjM4LTRiYjEtYWVlYi1iZDAzNDhjOGE5NjkiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiI2MTUzMjYyOTExOCIsImVudGl0eSI6WyJUZWFjaGVyIl0sImVtYWlsIjoiNjE1MzI2MjkxMThAZXhhbXBsZS5jb20ifQ.Ni3htjQFcIIEbu68WIWMXYptTI9PJ7IrEDbhluXZmWlH_eKnb5f_vaCiZPfe85yR5ITKYxbHW0gGmcYJFKzhrJqTV2_EJfAFAfwPNEVG2jDeKcLp0-YK-meXD07__1ZHmg50V89aqZXK8-W1iOFhQqC5ZXuEXs46XljBdGgMZYG9um8-zieC8-7DIZi2Yy1p48kuC2VsZ7OCxhTMrNqgFjKkV8qKsXHzFCw7ObKMRWo8BsNVmwlHm0Ionb4aJAtJiY2gkX_SVfXwTPX0DoC6gppHzah7fYK9_tlAPxpOSldIYbUGf4oeU2eCAcjsuzVUloDXO8z35n60NOM0DVLEkg'" + "'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJVVG9zZ2JYUFZHdmk2a19tVnVEa1oxTTZHeGNtYnBDZW9lTHJBUjJKcC04In0.eyJleHAiOjE2NDUwODU2NDIsImlhdCI6MTY0NTA4NTA0MiwianRpIjoiNzE0ZDA2NDItNTg5My00MDY5LWJmY2MtMDE0NTRmZWM2M2JjIiwiaXNzIjoiaHR0cDovL25kZWFyLnhpdi5pbi9hdXRoL3JlYWxtcy9zdW5iaXJkLXJjIiwiYXVkIjoiYWNjb3VudCIsInN1YiI6IjFjMTQxZWI0LWQwMTctNDFkNS05ODEwLTgxNmE1ZjZkZGVkZSIsInR5cCI6IkJlYXJlciIsImF6cCI6InJlZ2lzdHJ5LWZyb250ZW5kIiwic2Vzc2lvbl9zdGF0ZSI6ImI0ZTBkZTc5LWFjMGYtNGQ2ZS1hMjQzLWQxMzk4MDgwNzdmMSIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cHM6Ly9sb2NhbGhvc3Q6NDIwMiIsImh0dHA6Ly9sb2NhbGhvc3Q6NDIwMiIsImh0dHBzOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwczovL25kZWFyLnhpdi5pbiIsImh0dHA6Ly9sb2NhbGhvc3Q6NDIwMCIsImh0dHA6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vMjAuMTk4LjY0LjEyOCJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiIsImRlZmF1bHQtcm9sZXMtbmRlYXIiXX0sInJlc291cmNlX2FjY2VzcyI6eyJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6InByb2ZpbGUgZW1haWwiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsInByZWZlcnJlZF91c2VybmFtZSI6IjQ3MjY2ODMzODIzIiwiZW50aXR5IjpbIlRlYWNoZXIiXSwiZW1haWwiOiI0NzI2NjgzMzgyM0BleGFtcGxlLmNvbSJ9.k5GzJYBw1uSLu8Ul2F8zn2QxfxrcfLfU54gqUXTPfECqXznLMZseIsNEvPSPdMa-vW387s6bN3L-5iKSreziQZ31VBf63D5DDX1lcglzNkaSo22R1KUIo86AchEMNbLOJEgFCx0xlE1AhE79-mNFUbrHMl2NXG4feIXbXQRthPu623Yx9Bp9-fM2vtNSShtL23pJjVlrHk6D2cXG1wIGgFfcwGlI7ywNNcwsE9-cuEEPlUj5rQt4AGvB6-1vFAM4GHV55TkwO6wy4twtjoC5RqsrYXt-oetBPqHFoXXbDIs1w8pGrJJA4q_r-2Fk_2uWujD2G1iInVjBK2JZTvu6PQ'" ] }, - "execution_count": 614, + "execution_count": 42, "metadata": {}, "output_type": "execute_result" } @@ -429,7 +446,25 @@ }, { "cell_type": "code", - "execution_count": 569, + "execution_count": 43, + "id": "e1701185", + "metadata": {}, + "outputs": [], + "source": [ + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'Authorization': 'Bearer %s'%token, \n", + "}\n", + "\n", + "resp = requests.get(\"%s/api/docs/swagger.json\"%base_url, headers=headers)\n", + "assert resp.status_code == 200\n", + "assert resp.json()[\"swagger\"] == \"2.0\"\n", + "assert resp.json()[\"paths\"] != None" + ] + }, + { + "cell_type": "code", + "execution_count": 201, "id": "a398971a", "metadata": {}, "outputs": [ @@ -444,44 +479,44 @@ "data": { "text/plain": [ "(200,\n", - " {'osUpdatedAt': '2022-02-06T16:09:18.987Z',\n", - " 'ContactDetails': {'osid': '1-30a7cad8-9369-4ba7-bc47-376347fad897',\n", - " 'osUpdatedAt': '2022-02-06T16:09:18.987Z',\n", - " 'address': {'osid': '1-5777a40b-4879-4aa6-a3b5-4d4ffef95382',\n", + " {'osUpdatedAt': '2022-02-15T08:34:33.092Z',\n", + " 'osCreatedAt': '2022-02-15T08:34:33.092Z',\n", + " 'osUpdatedBy': '',\n", + " 'contactDetails': {'osid': '1-bf6b46ae-5198-4ef4-a009-0c75aa01ae1c',\n", + " 'osUpdatedAt': '2022-02-15T08:34:33.092Z',\n", + " 'address': {'osid': '1-6c2ddf68-9ffe-4a07-a19c-13e43d1b01b1',\n", " 'pincode': '560001',\n", - " 'osUpdatedAt': '2022-02-06T16:09:18.987Z',\n", - " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osUpdatedAt': '2022-02-15T08:34:33.092Z',\n", + " 'osCreatedAt': '2022-02-15T08:34:33.092Z',\n", " 'osUpdatedBy': '',\n", " 'street': 'abc',\n", " 'osCreatedBy': '',\n", " 'state': 'Karnataka'},\n", - " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'osCreatedAt': '2022-02-15T08:34:33.092Z',\n", " 'osUpdatedBy': '',\n", + " 'mobile': '97767099632',\n", " 'osCreatedBy': '',\n", - " 'mobile': '61532629118',\n", - " 'email': '61532629118@example.com'},\n", - " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", - " 'osUpdatedBy': '',\n", - " 'IdentityDetails': {'osid': '1-aa981655-301b-4f95-8207-508a0266dec2',\n", - " 'osUpdatedAt': '2022-02-06T16:09:18.987Z',\n", - " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", - " 'osUpdatedBy': '',\n", - " 'osCreatedBy': '',\n", - " 'type': 'id',\n", - " 'value': '61532629118'},\n", - " 'personalDetails': {'osid': '1-117254f3-ef91-428e-a4cd-486ae6b198f3',\n", - " 'osUpdatedAt': '2022-02-06T16:09:18.987Z',\n", - " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'email': '97767099632@example.com'},\n", + " 'personalDetails': {'osid': '1-051191d3-c3b8-470e-873e-329b0f861168',\n", + " 'osUpdatedAt': '2022-02-15T08:34:33.092Z',\n", + " 'osCreatedAt': '2022-02-15T08:34:33.092Z',\n", " 'osUpdatedBy': '',\n", " 'dob': '2020-12-12',\n", " 'osCreatedBy': '',\n", - " 'userName': '61532629118'},\n", + " 'userName': '97767099632'},\n", " 'osCreatedBy': '',\n", - " 'osid': '1-f5115e92-9ceb-4898-a08a-44d6e9c76897',\n", - " 'osOwner': ['2aeb770e-4e15-48c5-95b4-ae4a3aa37675']})" + " 'osid': '1-32000beb-ede1-47ab-b5d2-eb15587ce264',\n", + " 'osOwner': ['135abd72-24d5-4098-b8fc-280f1ba80097'],\n", + " 'identityDetails': {'osid': '1-29beb1ab-f240-4c6d-a679-9fe675f66ef5',\n", + " 'osUpdatedAt': '2022-02-15T08:34:33.092Z',\n", + " 'osCreatedAt': '2022-02-15T08:34:33.092Z',\n", + " 'osUpdatedBy': '',\n", + " 'osCreatedBy': '',\n", + " 'type': 'id',\n", + " 'value': '97767099632'}})" ] }, - "execution_count": 569, + "execution_count": 201, "metadata": {}, "output_type": "execute_result" } @@ -498,6 +533,14 @@ "response.status_code, response.json()" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "7218f63f", + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "id": "e164092c", @@ -508,7 +551,7 @@ }, { "cell_type": "code", - "execution_count": 570, + "execution_count": 202, "id": "b31e0286", "metadata": {}, "outputs": [ @@ -516,7 +559,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{\"ContactDetails\":{\"name\": \"test name 61532629118\"}, \"experience\":[{\"institute\":\"Some other school\"}]}\n" + "{\"contactDetails\":{\"name\": \"test name 97767099632\"}, \"experience\":[{\"institute\":\"Some other school\"}]}\n" ] } ], @@ -526,14 +569,14 @@ " 'authorization': 'bearer %s'%token,\n", "}\n", "\n", - "data = '{\"ContactDetails\":{\"name\": \"test name %s\"}, \"experience\":[{\"institute\":\"Some other school\"}]}'%userId\n", + "data = '{\"contactDetails\":{\"name\": \"test name %s\"}, \"experience\":[{\"institute\":\"Some other school\"}]}'%userId\n", "print(data)\n", "response = requests.put('http://localhost:8081/api/v1/Teacher/%s'%idx, headers=headers, data=data)" ] }, { "cell_type": "code", - "execution_count": 571, + "execution_count": 203, "id": "8ae86741", "metadata": {}, "outputs": [ @@ -543,16 +586,16 @@ "(200,\n", " {'id': 'sunbird-rc.registry.update',\n", " 'ver': '1.0',\n", - " 'ets': 1644170925208,\n", + " 'ets': 1644914092489,\n", " 'params': {'resmsgid': '',\n", - " 'msgid': 'f5b2bd58-ecfa-45ae-b001-e25e0b034759',\n", + " 'msgid': 'a74cac73-61cb-426f-b3b0-1b5e0532955d',\n", " 'err': '',\n", " 'status': 'SUCCESSFUL',\n", " 'errmsg': ''},\n", " 'responseCode': 'OK'})" ] }, - "execution_count": 571, + "execution_count": 203, "metadata": {}, "output_type": "execute_result" } @@ -563,7 +606,7 @@ }, { "cell_type": "code", - "execution_count": 572, + "execution_count": 204, "id": "6bc19944", "metadata": {}, "outputs": [ @@ -571,47 +614,47 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'osUpdatedAt': '2022-02-06T18:08:48.460Z', 'ContactDetails': {'osid': '1-4d2f8f80-d505-440e-92f9-689a6988a011', 'osUpdatedAt': '2022-02-06T18:08:48.460Z', 'osCreatedAt': '2022-02-06T16:09:18.987Z', 'osUpdatedBy': 'osrc', 'osCreatedBy': '', 'mobile': '61532629118', 'name': 'test name 61532629118', 'email': '61532629118@example.com'}, 'osCreatedAt': '2022-02-06T16:09:18.987Z', 'osUpdatedBy': 'osrc', 'IdentityDetails': {'osid': '1-aa981655-301b-4f95-8207-508a0266dec2', 'osUpdatedAt': '2022-02-06T18:08:48.460Z', 'osCreatedAt': '2022-02-06T16:09:18.987Z', 'osUpdatedBy': 'osrc', 'osCreatedBy': '', 'type': 'id', 'value': '61532629118'}, 'personalDetails': {'osid': '1-117254f3-ef91-428e-a4cd-486ae6b198f3', 'osUpdatedAt': '2022-02-06T18:08:48.460Z', 'osCreatedAt': '2022-02-06T16:09:18.987Z', 'osUpdatedBy': 'osrc', 'dob': '2020-12-12', 'osCreatedBy': '', 'userName': '61532629118'}, 'osCreatedBy': '', 'experience': [{'osUpdatedAt': '2022-02-06T18:08:48.460Z', 'osUpdatedBy': 'osrc', 'institute': 'Some other school', 'osid': '1-ee2992de-5450-4398-b5eb-94d12a3f384e'}], 'osid': '1-f5115e92-9ceb-4898-a08a-44d6e9c76897', 'osOwner': ['2aeb770e-4e15-48c5-95b4-ae4a3aa37675']}\n" + "{'osUpdatedAt': '2022-02-15T08:34:53.526Z', 'osCreatedAt': '2022-02-15T08:34:33.092Z', 'osUpdatedBy': 'osrc', 'contactDetails': {'osid': '1-3813c4d3-2cf4-4d2b-af57-6df58a7f1acf', 'osUpdatedAt': '2022-02-15T08:34:53.526Z', 'osCreatedAt': '2022-02-15T08:34:33.092Z', 'osUpdatedBy': 'osrc', 'name': 'test name 97767099632', 'mobile': '97767099632', 'osCreatedBy': '', 'email': '97767099632@example.com'}, 'personalDetails': {'osid': '1-051191d3-c3b8-470e-873e-329b0f861168', 'osUpdatedAt': '2022-02-15T08:34:53.526Z', 'osCreatedAt': '2022-02-15T08:34:33.092Z', 'osUpdatedBy': 'osrc', 'dob': '2020-12-12', 'osCreatedBy': '', 'userName': '97767099632'}, 'osCreatedBy': '', 'experience': [{'osUpdatedAt': '2022-02-15T08:34:53.526Z', 'osUpdatedBy': 'osrc', 'institute': 'Some other school', 'osid': '1-fd1c9192-4134-4b85-a013-b8b5f8aa887f'}], 'osid': '1-32000beb-ede1-47ab-b5d2-eb15587ce264', 'osOwner': ['135abd72-24d5-4098-b8fc-280f1ba80097'], 'identityDetails': {'osid': '1-29beb1ab-f240-4c6d-a679-9fe675f66ef5', 'osUpdatedAt': '2022-02-15T08:34:53.526Z', 'osCreatedAt': '2022-02-15T08:34:33.092Z', 'osUpdatedBy': 'osrc', 'osCreatedBy': '', 'type': 'id', 'value': '97767099632'}}\n" ] }, { "data": { "text/plain": [ - "{'osUpdatedAt': '2022-02-06T18:08:48.460Z',\n", - " 'ContactDetails': {'osid': '1-4d2f8f80-d505-440e-92f9-689a6988a011',\n", - " 'osUpdatedAt': '2022-02-06T18:08:48.460Z',\n", - " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", - " 'osUpdatedBy': 'osrc',\n", - " 'osCreatedBy': '',\n", - " 'mobile': '61532629118',\n", - " 'name': 'test name 61532629118',\n", - " 'email': '61532629118@example.com'},\n", - " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + "{'osUpdatedAt': '2022-02-15T08:34:53.526Z',\n", + " 'osCreatedAt': '2022-02-15T08:34:33.092Z',\n", " 'osUpdatedBy': 'osrc',\n", - " 'IdentityDetails': {'osid': '1-aa981655-301b-4f95-8207-508a0266dec2',\n", - " 'osUpdatedAt': '2022-02-06T18:08:48.460Z',\n", - " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'contactDetails': {'osid': '1-3813c4d3-2cf4-4d2b-af57-6df58a7f1acf',\n", + " 'osUpdatedAt': '2022-02-15T08:34:53.526Z',\n", + " 'osCreatedAt': '2022-02-15T08:34:33.092Z',\n", " 'osUpdatedBy': 'osrc',\n", + " 'name': 'test name 97767099632',\n", + " 'mobile': '97767099632',\n", " 'osCreatedBy': '',\n", - " 'type': 'id',\n", - " 'value': '61532629118'},\n", - " 'personalDetails': {'osid': '1-117254f3-ef91-428e-a4cd-486ae6b198f3',\n", - " 'osUpdatedAt': '2022-02-06T18:08:48.460Z',\n", - " 'osCreatedAt': '2022-02-06T16:09:18.987Z',\n", + " 'email': '97767099632@example.com'},\n", + " 'personalDetails': {'osid': '1-051191d3-c3b8-470e-873e-329b0f861168',\n", + " 'osUpdatedAt': '2022-02-15T08:34:53.526Z',\n", + " 'osCreatedAt': '2022-02-15T08:34:33.092Z',\n", " 'osUpdatedBy': 'osrc',\n", " 'dob': '2020-12-12',\n", " 'osCreatedBy': '',\n", - " 'userName': '61532629118'},\n", + " 'userName': '97767099632'},\n", " 'osCreatedBy': '',\n", - " 'experience': [{'osUpdatedAt': '2022-02-06T18:08:48.460Z',\n", + " 'experience': [{'osUpdatedAt': '2022-02-15T08:34:53.526Z',\n", " 'osUpdatedBy': 'osrc',\n", " 'institute': 'Some other school',\n", - " 'osid': '1-ee2992de-5450-4398-b5eb-94d12a3f384e'}],\n", - " 'osid': '1-f5115e92-9ceb-4898-a08a-44d6e9c76897',\n", - " 'osOwner': ['2aeb770e-4e15-48c5-95b4-ae4a3aa37675']}" + " 'osid': '1-fd1c9192-4134-4b85-a013-b8b5f8aa887f'}],\n", + " 'osid': '1-32000beb-ede1-47ab-b5d2-eb15587ce264',\n", + " 'osOwner': ['135abd72-24d5-4098-b8fc-280f1ba80097'],\n", + " 'identityDetails': {'osid': '1-29beb1ab-f240-4c6d-a679-9fe675f66ef5',\n", + " 'osUpdatedAt': '2022-02-15T08:34:53.526Z',\n", + " 'osCreatedAt': '2022-02-15T08:34:33.092Z',\n", + " 'osUpdatedBy': 'osrc',\n", + " 'osCreatedBy': '',\n", + " 'type': 'id',\n", + " 'value': '97767099632'}}" ] }, - "execution_count": 572, + "execution_count": 204, "metadata": {}, "output_type": "execute_result" } @@ -625,7 +668,7 @@ "response = requests.get('http://localhost:8081/api/v1/%s/%s'%(entity_name, idx), headers=headers)\n", "assert response.status_code == 200\n", "print(response.json())\n", - "assert response.json()[\"ContactDetails\"][\"name\"] == \"test name %s\"%userId\n", + "assert response.json()[\"contactDetails\"][\"name\"] == \"test name %s\"%userId\n", "response.json()" ] }, @@ -639,7 +682,28 @@ }, { "cell_type": "code", - "execution_count": 626, + "execution_count": 212, + "id": "5d59a11f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'97767099632'" + ] + }, + "execution_count": 212, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "userId" + ] + }, + { + "cell_type": "code", + "execution_count": 214, "id": "f85dc761", "metadata": {}, "outputs": [], @@ -665,7 +729,7 @@ }, { "cell_type": "code", - "execution_count": 627, + "execution_count": 215, "id": "a486eb16", "metadata": {}, "outputs": [ @@ -674,17 +738,17 @@ "text/plain": [ "{'id': 'sunbird-rc.registry.invite',\n", " 'ver': '1.0',\n", - " 'ets': 1644175094599,\n", + " 'ets': 1644915265621,\n", " 'params': {'resmsgid': '',\n", - " 'msgid': '0faa774a-1cb7-403b-905e-f07a483cc1af',\n", + " 'msgid': 'fccebdf2-f44a-4db3-a296-52f2c1eeaec1',\n", " 'err': '',\n", " 'status': 'SUCCESSFUL',\n", " 'errmsg': ''},\n", " 'responseCode': 'OK',\n", - " 'result': {'Student': {'osid': '1-42190594-210d-4ebf-8904-5cb2e222aa74'}}}" + " 'result': {'Student': {'osid': '1-f487ba74-2b5b-4d4b-9619-471e75aec617'}}}" ] }, - "execution_count": 627, + "execution_count": 215, "metadata": {}, "output_type": "execute_result" } @@ -696,7 +760,7 @@ }, { "cell_type": "code", - "execution_count": 628, + "execution_count": 216, "id": "c634f6ae", "metadata": {}, "outputs": [], @@ -706,7 +770,7 @@ }, { "cell_type": "code", - "execution_count": 629, + "execution_count": 217, "id": "24a56dc8", "metadata": {}, "outputs": [ @@ -721,14 +785,14 @@ "data": { "text/plain": [ "{'educationDetails': [{'institute': 'Some other school',\n", - " 'osid': '1-d3248abc-385f-4e8e-8856-0c0c0bbfa2e2'}],\n", - " 'osid': '1-42190594-210d-4ebf-8904-5cb2e222aa74',\n", - " 'identityDetails': {'osid': '1-c81f449f-6b77-40ab-bc08-7cf9df5289e7',\n", + " 'osid': '1-45cecd72-ded5-4540-b3c8-861628537143'}],\n", + " 'osid': '1-f487ba74-2b5b-4d4b-9619-471e75aec617',\n", + " 'identityDetails': {'osid': '1-ea45774c-cd00-4bab-8c82-f0bf361c4990',\n", " 'gender': 'Male',\n", - " 'fullName': 'Test 61532629118'}}" + " 'fullName': 'Test 97767099632'}}" ] }, - "execution_count": 629, + "execution_count": 217, "metadata": {}, "output_type": "execute_result" } @@ -746,11 +810,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 218, "id": "63492c6c", "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "'1-f487ba74-2b5b-4d4b-9619-471e75aec617'" + ] + }, + "execution_count": 218, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sid" + ] }, { "cell_type": "markdown", @@ -762,7 +839,7 @@ }, { "cell_type": "code", - "execution_count": 630, + "execution_count": 219, "id": "141a9dc9", "metadata": {}, "outputs": [ @@ -778,17 +855,17 @@ "text/plain": [ "{'id': 'sunbird-rc.registry.send',\n", " 'ver': '1.0',\n", - " 'ets': 1644175100079,\n", + " 'ets': 1644915273377,\n", " 'params': {'resmsgid': '',\n", - " 'msgid': '6f1b856a-1b69-47bd-8211-ad7052a03c81',\n", + " 'msgid': 'f398ba1a-139f-4422-8edd-8994f23534db',\n", " 'err': '',\n", " 'status': 'SUCCESSFUL',\n", " 'errmsg': ''},\n", " 'responseCode': 'OK',\n", - " 'result': {'attestationOSID': '1-f5b466f3-c5eb-4eea-bc5f-c7e5ae8f60ab'}}" + " 'result': {'attestationOSID': '1-12c772ad-6dcc-412b-b61c-318ded5a0961'}}" ] }, - "execution_count": 630, + "execution_count": 219, "metadata": {}, "output_type": "execute_result" } @@ -807,7 +884,7 @@ "data = {\n", " \"entityName\":\"Student\",\n", " \"entityId\":\"%s\"%sid,\n", - " \"name\":\"schoolId\",\n", + " \"name\":\"studentInstituteAttest\",\n", " \"additionalInput\":{\"idx\": \"%s\"%sid}\n", "}\n", "response = requests.put('http://localhost:8081/api/v1/send', headers=headers, params=params, json=data)\n", @@ -818,7 +895,7 @@ }, { "cell_type": "code", - "execution_count": 632, + "execution_count": 220, "id": "7647f0e1", "metadata": {}, "outputs": [ @@ -833,22 +910,23 @@ "data": { "text/plain": [ "{'educationDetails': [{'institute': 'Some other school',\n", - " 'osid': '1-d3248abc-385f-4e8e-8856-0c0c0bbfa2e2'}],\n", - " 'osid': '1-42190594-210d-4ebf-8904-5cb2e222aa74',\n", - " 'identityDetails': {'osid': '1-c81f449f-6b77-40ab-bc08-7cf9df5289e7',\n", - " 'gender': 'Male',\n", - " 'fullName': 'Test 61532629118'},\n", - " 'schoolId': [{'additionalInput': {'osid': '1-4ddd0126-289d-4bd2-8b68-82e271650dac',\n", - " 'idx': '1-42190594-210d-4ebf-8904-5cb2e222aa74'},\n", + " 'osid': '1-45cecd72-ded5-4540-b3c8-861628537143'}],\n", + " 'studentInstituteAttest': [{'additionalInput': {'osid': '1-f8f46a25-8628-4e7e-94fa-2737018ea046',\n", + " 'idx': '1-f487ba74-2b5b-4d4b-9619-471e75aec617'},\n", " 'entityName': 'Student',\n", - " '_osState': 'DRAFT',\n", - " 'name': 'schoolId',\n", - " 'entityId': '1-42190594-210d-4ebf-8904-5cb2e222aa74',\n", - " 'osid': '1-f5b466f3-c5eb-4eea-bc5f-c7e5ae8f60ab',\n", - " 'propertyData': '{\"name\":\"Test 61532629118\",\"institute\":\"Some other school\"}'}]}" + " '_osState': 'ATTESTATION_REQUESTED',\n", + " 'name': 'studentInstituteAttest',\n", + " 'entityId': '1-f487ba74-2b5b-4d4b-9619-471e75aec617',\n", + " 'osid': '1-12c772ad-6dcc-412b-b61c-318ded5a0961',\n", + " '_osClaimId': '96852340-a171-43b6-b357-d8666aafac60',\n", + " 'propertyData': '{\"name\":\"Test 97767099632\",\"institute\":\"Some other school\"}'}],\n", + " 'osid': '1-f487ba74-2b5b-4d4b-9619-471e75aec617',\n", + " 'identityDetails': {'osid': '1-ea45774c-cd00-4bab-8c82-f0bf361c4990',\n", + " 'gender': 'Male',\n", + " 'fullName': 'Test 97767099632'}}" ] }, - "execution_count": 632, + "execution_count": 220, "metadata": {}, "output_type": "execute_result" } @@ -874,45 +952,143 @@ }, { "cell_type": "code", - "execution_count": 636, - "id": "9e091faf", + "execution_count": 221, + "id": "5f221ebb-59bf-4ec2-9a33-88a4549dcae7", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJSQ19zUTBRVUJydVozbTFuTEFUaHFMUXFKcWpNN2g5ZGV2dnR2RVF6OEZFIn0.eyJleHAiOjE2NDQ5MTU4NjAsImlhdCI6MTY0NDkxNTI2MCwianRpIjoiNGUwMmViYWEtNTFkOS00OGNiLTlhMTgtNTA3MGJlZjJlNTVjIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIxMzVhYmQ3Mi0yNGQ1LTQwOTgtYjhmYy0yODBmMWJhODAwOTciLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiJkMjdjN2FkYy04MzVhLTRhYWMtOTgzNS03MzMxOGE0NDQ0NjIiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiI5Nzc2NzA5OTYzMiIsImVudGl0eSI6WyJUZWFjaGVyIl0sImVtYWlsIjoiOTc3NjcwOTk2MzJAZXhhbXBsZS5jb20ifQ.FYzfeY9694XQxtQpcZY6-oWpkcwvVKquvM35ilUIZQ4H31JClZ7gJN0EFSVh64ZA7v50qVzW3nKroNTKaCuT2vgaIntFcre5l_w9uJnoI2-iNTbdGPJ5Pa1B_s0oCee584Oy-UylDTroMzx9H7v0eT4UNqEvTLma1Wcf031eA5QbGl0JKykIiNIsFCsLM_5sVpGHu7cQ7Pq5Ydcj_a2Nn3Y1NUzB-3hNYpSKHtDFD8YzMn6jVo7hVxaCdrFwUfd6wGUWaXGH9UPu_nKPP0QOiJbUDOdC-UE8bSHd9l4Wjq8-pVDPPf04IKcUxJ9OAkF6nbR4rtNhox5kcrzFLIa4CA'" + ] + }, + "execution_count": 221, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "token" + ] + }, + { + "cell_type": "code", + "execution_count": 222, + "id": "a5a215fb-b049-4605-ad53-6b41a58acc41", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "200 [{'id': '5249adac-4aa3-48a0-af65-3dc4ef475cf9', 'entity': 'Student', 'entityId': '1-5f19dcf9-42c6-4579-b9ae-0f28e681e610', 'propertyURI': '', 'createdAt': '2022-02-06T19:14:46.762+00:00', 'attestedOn': '2022-02-06T19:16:08.143+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'closed': True}, {'id': 'bf135815-6670-41ef-b10f-826a18b25df5', 'entity': 'Student', 'entityId': '1-42190594-210d-4ebf-8904-5cb2e222aa74', 'propertyURI': '', 'createdAt': '2022-02-06T19:18:20.597+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'closed': False}]\n" + "\n", + "200 [{'id': '7e912173-329a-490f-9561-c9943ce6f693', 'entity': 'Student', 'entityId': '1-383ecafc-eea0-4bcc-a061-42336753ae81', 'propertyURI': '', 'createdAt': '2022-02-15T12:54:51.731+00:00', 'attestedOn': '2022-02-15T12:57:40.834+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}', 'attestationId': '1-524c50f7-7241-4c7d-966c-a4dc1089c94f', 'attestationName': 'studentInstituteAttest', 'closed': True}, {'id': '325d7a14-900e-45d8-a928-82c92461969c', 'entity': 'Student', 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba', 'propertyURI': '', 'createdAt': '2022-02-15T07:57:08.877+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}', 'attestationId': '1-5e3c9f68-032a-4313-9d9f-f35762341b73', 'attestationName': 'studentInstituteAttest', 'closed': False}, {'id': '6c8755e5-519d-4d20-a24e-09b0a818eb93', 'entity': 'Student', 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba', 'propertyURI': '', 'createdAt': '2022-02-15T08:07:06.445+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}', 'attestationId': '1-b41147f0-3681-4288-bcfd-b532d60bb1c0', 'attestationName': 'studentInstituteAttest', 'closed': False}, {'id': '7dcde663-52b7-48d5-86fd-6fbcc616ab0d', 'entity': 'Student', 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba', 'propertyURI': '', 'createdAt': '2022-02-15T08:23:35.260+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}', 'attestationId': '1-b41147f0-3681-4288-bcfd-b532d60bb1c0', 'attestationName': 'studentInstituteAttest', 'closed': False}, {'id': '818ca6f0-6bf3-4295-ae87-63efc01efcac', 'entity': 'Student', 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba', 'propertyURI': '', 'createdAt': '2022-02-15T08:26:06.260+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}', 'attestationId': '1-b41147f0-3681-4288-bcfd-b532d60bb1c0', 'attestationName': 'studentInstituteAttest', 'closed': False}, {'id': '723354f0-fc36-46ea-9830-17bbe3382572', 'entity': 'Student', 'entityId': '1-c16dcbec-fa9c-4268-8634-7a0e133e0811', 'propertyURI': '', 'createdAt': '2022-02-15T08:35:16.345+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'propertyData': '{\"name\":\"Test 97767099632\",\"institute\":\"Some other school\"}', 'attestationId': '1-bf63cd2e-ffd0-4bcb-84ec-b833d6fd3a83', 'attestationName': 'studentInstituteAttest', 'closed': False}, {'id': '96852340-a171-43b6-b357-d8666aafac60', 'entity': 'Student', 'entityId': '1-f487ba74-2b5b-4d4b-9619-471e75aec617', 'propertyURI': '', 'createdAt': '2022-02-15T08:54:34.647+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'propertyData': '{\"name\":\"Test 97767099632\",\"institute\":\"Some other school\"}', 'attestationId': '1-12c772ad-6dcc-412b-b61c-318ded5a0961', 'attestationName': 'studentInstituteAttest', 'closed': False}]\n" ] }, { "data": { "text/plain": [ - "[{'id': '5249adac-4aa3-48a0-af65-3dc4ef475cf9',\n", + "[{'id': '7e912173-329a-490f-9561-c9943ce6f693',\n", " 'entity': 'Student',\n", - " 'entityId': '1-5f19dcf9-42c6-4579-b9ae-0f28e681e610',\n", + " 'entityId': '1-383ecafc-eea0-4bcc-a061-42336753ae81',\n", " 'propertyURI': '',\n", - " 'createdAt': '2022-02-06T19:14:46.762+00:00',\n", - " 'attestedOn': '2022-02-06T19:16:08.143+00:00',\n", + " 'createdAt': '2022-02-15T12:54:51.731+00:00',\n", + " 'attestedOn': '2022-02-15T12:57:40.834+00:00',\n", " 'status': 'CLOSED',\n", " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", " 'attestorEntity': 'Teacher',\n", " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-524c50f7-7241-4c7d-966c-a4dc1089c94f',\n", + " 'attestationName': 'studentInstituteAttest',\n", " 'closed': True},\n", - " {'id': 'bf135815-6670-41ef-b10f-826a18b25df5',\n", + " {'id': '325d7a14-900e-45d8-a928-82c92461969c',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-15T07:57:08.877+00:00',\n", + " 'attestedOn': None,\n", + " 'status': 'OPEN',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-5e3c9f68-032a-4313-9d9f-f35762341b73',\n", + " 'attestationName': 'studentInstituteAttest',\n", + " 'closed': False},\n", + " {'id': '6c8755e5-519d-4d20-a24e-09b0a818eb93',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-15T08:07:06.445+00:00',\n", + " 'attestedOn': None,\n", + " 'status': 'OPEN',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-b41147f0-3681-4288-bcfd-b532d60bb1c0',\n", + " 'attestationName': 'studentInstituteAttest',\n", + " 'closed': False},\n", + " {'id': '7dcde663-52b7-48d5-86fd-6fbcc616ab0d',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-15T08:23:35.260+00:00',\n", + " 'attestedOn': None,\n", + " 'status': 'OPEN',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-b41147f0-3681-4288-bcfd-b532d60bb1c0',\n", + " 'attestationName': 'studentInstituteAttest',\n", + " 'closed': False},\n", + " {'id': '818ca6f0-6bf3-4295-ae87-63efc01efcac',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-15T08:26:06.260+00:00',\n", + " 'attestedOn': None,\n", + " 'status': 'OPEN',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-b41147f0-3681-4288-bcfd-b532d60bb1c0',\n", + " 'attestationName': 'studentInstituteAttest',\n", + " 'closed': False},\n", + " {'id': '723354f0-fc36-46ea-9830-17bbe3382572',\n", " 'entity': 'Student',\n", - " 'entityId': '1-42190594-210d-4ebf-8904-5cb2e222aa74',\n", + " 'entityId': '1-c16dcbec-fa9c-4268-8634-7a0e133e0811',\n", " 'propertyURI': '',\n", - " 'createdAt': '2022-02-06T19:18:20.597+00:00',\n", + " 'createdAt': '2022-02-15T08:35:16.345+00:00',\n", " 'attestedOn': None,\n", " 'status': 'OPEN',\n", " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", " 'attestorEntity': 'Teacher',\n", " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 97767099632\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-bf63cd2e-ffd0-4bcb-84ec-b833d6fd3a83',\n", + " 'attestationName': 'studentInstituteAttest',\n", + " 'closed': False},\n", + " {'id': '96852340-a171-43b6-b357-d8666aafac60',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-f487ba74-2b5b-4d4b-9619-471e75aec617',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-15T08:54:34.647+00:00',\n", + " 'attestedOn': None,\n", + " 'status': 'OPEN',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 97767099632\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-12c772ad-6dcc-412b-b61c-318ded5a0961',\n", + " 'attestationName': 'studentInstituteAttest',\n", " 'closed': False}]" ] }, - "execution_count": 636, + "execution_count": 222, "metadata": {}, "output_type": "execute_result" } @@ -924,6 +1100,7 @@ "}\n", "\n", "response = requests.get('http://localhost:8081/api/v1/Teacher/claims', headers=headers)\n", + "print(response)\n", "print(response.status_code, response.json())\n", "claim_id = response.json()[-1][\"id\"]\n", "response.json()" @@ -939,7 +1116,28 @@ }, { "cell_type": "code", - "execution_count": 637, + "execution_count": 223, + "id": "4f9910de", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'96852340-a171-43b6-b357-d8666aafac60'" + ] + }, + "execution_count": 223, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "claim_id" + ] + }, + { + "cell_type": "code", + "execution_count": 224, "id": "336de33a", "metadata": {}, "outputs": [ @@ -954,13 +1152,13 @@ "data": { "text/plain": [ "{'resmsgid': '',\n", - " 'msgid': 'ec98c5a7-b012-4969-b95e-2a87345977a3',\n", + " 'msgid': '4abdf275-4259-4d89-a40c-661e85bdabb8',\n", " 'err': '',\n", " 'status': 'SUCCESSFUL',\n", " 'errmsg': ''}" ] }, - "execution_count": 637, + "execution_count": 224, "metadata": {}, "output_type": "execute_result" } @@ -980,7 +1178,7 @@ }, { "cell_type": "code", - "execution_count": 640, + "execution_count": 225, "id": "a1247108", "metadata": {}, "outputs": [ @@ -994,31 +1192,107 @@ { "data": { "text/plain": [ - "[{'id': '5249adac-4aa3-48a0-af65-3dc4ef475cf9',\n", + "[{'id': '7e912173-329a-490f-9561-c9943ce6f693',\n", " 'entity': 'Student',\n", - " 'entityId': '1-5f19dcf9-42c6-4579-b9ae-0f28e681e610',\n", + " 'entityId': '1-383ecafc-eea0-4bcc-a061-42336753ae81',\n", " 'propertyURI': '',\n", - " 'createdAt': '2022-02-06T19:14:46.762+00:00',\n", - " 'attestedOn': '2022-02-06T19:16:08.143+00:00',\n", + " 'createdAt': '2022-02-15T12:54:51.731+00:00',\n", + " 'attestedOn': '2022-02-15T12:57:40.834+00:00',\n", " 'status': 'CLOSED',\n", " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", " 'attestorEntity': 'Teacher',\n", " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-524c50f7-7241-4c7d-966c-a4dc1089c94f',\n", + " 'attestationName': 'studentInstituteAttest',\n", " 'closed': True},\n", - " {'id': 'bf135815-6670-41ef-b10f-826a18b25df5',\n", + " {'id': '325d7a14-900e-45d8-a928-82c92461969c',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-15T07:57:08.877+00:00',\n", + " 'attestedOn': None,\n", + " 'status': 'OPEN',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-5e3c9f68-032a-4313-9d9f-f35762341b73',\n", + " 'attestationName': 'studentInstituteAttest',\n", + " 'closed': False},\n", + " {'id': '6c8755e5-519d-4d20-a24e-09b0a818eb93',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-15T08:07:06.445+00:00',\n", + " 'attestedOn': None,\n", + " 'status': 'OPEN',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-b41147f0-3681-4288-bcfd-b532d60bb1c0',\n", + " 'attestationName': 'studentInstituteAttest',\n", + " 'closed': False},\n", + " {'id': '7dcde663-52b7-48d5-86fd-6fbcc616ab0d',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-15T08:23:35.260+00:00',\n", + " 'attestedOn': None,\n", + " 'status': 'OPEN',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-b41147f0-3681-4288-bcfd-b532d60bb1c0',\n", + " 'attestationName': 'studentInstituteAttest',\n", + " 'closed': False},\n", + " {'id': '818ca6f0-6bf3-4295-ae87-63efc01efcac',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-15T08:26:06.260+00:00',\n", + " 'attestedOn': None,\n", + " 'status': 'OPEN',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 81540432738\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-b41147f0-3681-4288-bcfd-b532d60bb1c0',\n", + " 'attestationName': 'studentInstituteAttest',\n", + " 'closed': False},\n", + " {'id': '723354f0-fc36-46ea-9830-17bbe3382572',\n", + " 'entity': 'Student',\n", + " 'entityId': '1-c16dcbec-fa9c-4268-8634-7a0e133e0811',\n", + " 'propertyURI': '',\n", + " 'createdAt': '2022-02-15T08:35:16.345+00:00',\n", + " 'attestedOn': None,\n", + " 'status': 'OPEN',\n", + " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", + " 'attestorEntity': 'Teacher',\n", + " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 97767099632\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-bf63cd2e-ffd0-4bcb-84ec-b833d6fd3a83',\n", + " 'attestationName': 'studentInstituteAttest',\n", + " 'closed': False},\n", + " {'id': '96852340-a171-43b6-b357-d8666aafac60',\n", " 'entity': 'Student',\n", - " 'entityId': '1-42190594-210d-4ebf-8904-5cb2e222aa74',\n", + " 'entityId': '1-f487ba74-2b5b-4d4b-9619-471e75aec617',\n", " 'propertyURI': '',\n", - " 'createdAt': '2022-02-06T19:18:20.597+00:00',\n", - " 'attestedOn': '2022-02-06T19:19:58.840+00:00',\n", + " 'createdAt': '2022-02-15T08:54:34.647+00:00',\n", + " 'attestedOn': '2022-02-15T08:55:45.979+00:00',\n", " 'status': 'CLOSED',\n", " 'conditions': \"(ATTESTOR#$.experience.[*].institute#.contains('Some other school'))\",\n", " 'attestorEntity': 'Teacher',\n", " 'requestorName': None,\n", + " 'propertyData': '{\"name\":\"Test 97767099632\",\"institute\":\"Some other school\"}',\n", + " 'attestationId': '1-12c772ad-6dcc-412b-b61c-318ded5a0961',\n", + " 'attestationName': 'studentInstituteAttest',\n", " 'closed': True}]" ] }, - "execution_count": 640, + "execution_count": 225, "metadata": {}, "output_type": "execute_result" } @@ -1034,11 +1308,69 @@ "claim_id = response.json()[0][\"id\"]\n", "response.json()" ] + }, + { + "cell_type": "code", + "execution_count": 226, + "id": "036e998b-5581-46f9-96ee-ca4fd5309b58", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n" + ] + }, + { + "data": { + "text/plain": [ + "{'educationDetails': [{'institute': 'Some other school',\n", + " 'osid': '1-45cecd72-ded5-4540-b3c8-861628537143'}],\n", + " 'studentInstituteAttest': [{'additionalInput': {'osid': '1-f8f46a25-8628-4e7e-94fa-2737018ea046',\n", + " 'idx': '1-f487ba74-2b5b-4d4b-9619-471e75aec617'},\n", + " 'entityName': 'Student',\n", + " '_osState': 'PUBLISHED',\n", + " 'name': 'studentInstituteAttest',\n", + " 'entityId': '1-f487ba74-2b5b-4d4b-9619-471e75aec617',\n", + " '_osAttestedData': '{\"name\":\"Test 97767099632\",\"institute\":\"Some other school\"}',\n", + " 'osid': '1-12c772ad-6dcc-412b-b61c-318ded5a0961',\n", + " '_osClaimId': '96852340-a171-43b6-b357-d8666aafac60',\n", + " 'propertyData': '{\"name\":\"Test 97767099632\",\"institute\":\"Some other school\"}'}],\n", + " 'osid': '1-f487ba74-2b5b-4d4b-9619-471e75aec617',\n", + " 'identityDetails': {'osid': '1-ea45774c-cd00-4bab-8c82-f0bf361c4990',\n", + " 'gender': 'Male',\n", + " 'fullName': 'Test 97767099632'}}" + ] + }, + "execution_count": 226, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "headers = {\n", + " 'content-type': 'application/json',\n", + " 'Authorization': 'Bearer %s'%token, \n", + "}\n", + "\n", + "response = requests.get('http://localhost:8081/api/v1/%s/%s'%(\"Student\", sid), headers=headers)\n", + "print(response.status_code)\n", + "response.json()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cabbbd90-6154-4863-b7ad-c811042e90da", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1052,7 +1384,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.9" + "version": "3.9.5" } }, "nbformat": 4,