From d52385d2ea13679e7928fd6e4054f9f7a17e3c0a Mon Sep 17 00:00:00 2001 From: Tejash Date: Tue, 15 Feb 2022 14:29:31 +0530 Subject: [PATCH 01/11] updated schemas and compose file --- .../student-claim-checkpoint.ipynb | 1060 ++++++ docker-compose.yml | 9 +- imports/realm-export.json | 2990 +++++++++++++++++ schemas/Institute.json | 34 +- schemas/Student.json | 10 +- schemas/Teacher.json | 12 +- student-claim.ipynb | 622 +++- 7 files changed, 4561 insertions(+), 176 deletions(-) create mode 100644 .ipynb_checkpoints/student-claim-checkpoint.ipynb create mode 100644 imports/realm-export.json 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..b15dc71 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,8 +46,8 @@ services: - sunbird_sso_admin_client_secret=014b8593-b82e-4f65-ae7a-b287c737fca4 - sunbird_sso_client_id=registry-frontend - claims_url=http://claim-ms:8082 - - sunbird_set_default_password=true - - sunbird_default_password=abcd@123 + - sunbird_keycloak_user_set_password=true + - sunbird_keycloak_user_password=abcd@123 - logging.level.root=DEBUG ports: - "8081:8081" @@ -60,6 +60,8 @@ services: condition: service_started keycloak: image: dockerhub/ndear-keycloak + volumes: + - ${PWD}/imports:/opt/jboss/keycloak/imports environment: - DB_VENDOR=postgres - DB_ADDR=db @@ -82,8 +84,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 environment: - connectionInfo_uri=jdbc:postgresql://db:5432/registry - connectionInfo_username=postgres diff --git a/imports/realm-export.json b/imports/realm-export.json new file mode 100644 index 0000000..65655d8 --- /dev/null +++ b/imports/realm-export.json @@ -0,0 +1,2990 @@ +{ + "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": [], + "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": [] + } + ], + "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": "**********", + "redirectUris": [ + "https://localhost:4202/*", + "https://divoc.xiv.in", + "https://divoc.xiv.in/keycloak/auth/realms/divoc/account/*", + "https://localhost:4200/*", + "https://oauth.pstmn.io/v1/callback", + "http://ndear.xiv.in/*" + ], + "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": "26526ac7-6139-40de-8a4b-84a56692a474", + "browser": "c7d2defc-aebe-463f-95f5-a18dd698285d" + }, + "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.multivalued.roles": "false", + "saml.force.post.binding": "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", + "consent.screen.text": "Additional information will help in giving better experience", + "client.offline.session.idle.timeout": "86400", + "saml.client.signature": "false", + "client.offline.session.max.lifespan": "86400", + "client.session.max.lifespan": "86400", + "client.session.idle.timeout": "86400", + "saml.assertion.signature": "false", + "id.token.as.detached.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": { + "saml.assertion.signature": "false", + "id.token.as.detached.signature": "false", + "access.token.lifespan": "86400", + "saml.multivalued.roles": "false", + "saml.force.post.binding": "false", + "saml.encrypt": "false", + "login_theme": "ndear", + "oauth2.device.authorization.grant.enabled": "false", + "saml.server.signature": "false", + "backchannel.logout.revoke.offline.tokens": "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": { + "saml.assertion.signature": "false", + "id.token.as.detached.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "oauth2.device.authorization.grant.enabled": "false", + "saml.server.signature": "false", + "backchannel.logout.revoke.offline.tokens": "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": [ + "saml-role-list-mapper", + "oidc-usermodel-attribute-mapper", + "saml-user-property-mapper", + "oidc-usermodel-property-mapper", + "oidc-address-mapper", + "saml-user-attribute-mapper", + "oidc-full-name-mapper", + "oidc-sha256-pairwise-sub-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-address-mapper", + "saml-user-property-mapper", + "oidc-sha256-pairwise-sub-mapper", + "oidc-usermodel-attribute-mapper", + "oidc-full-name-mapper", + "oidc-usermodel-property-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": "0ab74575-c2f2-4eb4-a47a-06593591f634", + "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": "2d4a7e37-27a0-4011-9e69-48c97d0ffb66", + "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": "cbc1adc7-e24e-4091-bcfa-56837ee331b3", + "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": "f3900b3d-0495-484e-87a0-d340b921ed2d", + "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": "c903ba49-d1bf-469b-b251-df18607d7cea", + "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": "f6821ccf-6173-422e-acfe-daf793a6a7f5", + "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": "db722948-38c7-44df-8855-22e63530c5b7", + "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": "82428cc8-feb0-47af-afee-8dbd49f21e78", + "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": "e6e7205e-f8ab-4b01-9653-81915269ecce", + "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": "c7d2defc-aebe-463f-95f5-a18dd698285d", + "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": "f2a2747d-ed5f-4489-bbb7-5f7a6028b306", + "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": "26526ac7-6139-40de-8a4b-84a56692a474", + "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": "4d512dcb-80a8-40ad-b68b-60d0e932d25e", + "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": "749b512f-9f43-446a-a951-72e4207bb107", + "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": "09cbc2f5-050e-4a93-b40f-7489e43d0850", + "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": "7831c6d0-f46f-489e-944c-8e3b23733345", + "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": "d8950fad-3c86-443f-a475-f06225af749e", + "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": "8a71acbd-1771-4a44-b615-12429028d86a", + "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": "13b66a32-c3d8-43f1-8ba5-287b978f3050", + "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": "d3695198-d866-46eb-a4a6-c053987a5505", + "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": "7784ee5f-3379-4f89-ac74-38b4f4880eac", + "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": "e5c57bc0-53c4-4b6a-ab76-f82acf64d118", + "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": "61def636-cc77-4ce2-af3b-07c71510e4e4", + "alias": "create unique user config", + "config": { + "require.password.update.after.registration": "false" + } + }, + { + "id": "48aa1005-d4a6-4f89-af58-a7b8effd66c5", + "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/Institute.json b/schemas/Institute.json index a85f349..91db064 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" } @@ -169,6 +185,20 @@ "conditions": "(ATTESTOR#$.[*]#.contains('board-cbse'))" } ], - "subjectJsonPath": "email" + "internalFields": [], + "inviteRoles":["anonymous"], + "enableLogin": true, + "ownershipAttributes": [ + { + "email": "/email", + "mobile": "/contactNumber", + "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..0c552a1 100644 --- a/schemas/Student.json +++ b/schemas/Student.json @@ -76,7 +76,8 @@ ], "attestationPolicies": [ { - "name": "schoolId", + "name": "studentInstituteAttest", + "properties": ["educationDetails/[]"], "additionalInput": { "enrollmentNumber": {"type": "string"} }, @@ -96,11 +97,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/schemas/Teacher.json b/schemas/Teacher.json index 9fd3daa..aeffc00 100644 --- a/schemas/Teacher.json +++ b/schemas/Teacher.json @@ -80,7 +80,7 @@ "experience" ], "attestorEntity": "Institute", - "conditions": "(ATTESTOR#$.instituteName#.contains(REQUESTER#$.institute#))" + "conditions": "(ATTESTOR#$.osid#.contains(REQUESTER#$.instituteOSID#))" }, { "property": "academicQualifications/[]", @@ -88,7 +88,7 @@ "academicQualifications" ], "attestorEntity": "Institute", - "conditions": "(ATTESTOR#$.instituteName#.contains(REQUESTER#$.institute#))" + "conditions": "(ATTESTOR#$.osid#.contains(REQUESTER#$.instituteOSID#))" } ], "internalFields": [], @@ -96,10 +96,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..8771e17 100644 --- a/student-claim.ipynb +++ b/student-claim.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 515, + "execution_count": 113, "id": "3f0dd619", "metadata": {}, "outputs": [], @@ -22,7 +22,7 @@ }, { "cell_type": "code", - "execution_count": 516, + "execution_count": 114, "id": "22c16507", "metadata": {}, "outputs": [], @@ -32,7 +32,7 @@ }, { "cell_type": "code", - "execution_count": 517, + "execution_count": 115, "id": "4c0e4ef1", "metadata": {}, "outputs": [], @@ -45,7 +45,7 @@ }, { "cell_type": "code", - "execution_count": 518, + "execution_count": 116, "id": "27da0f32", "metadata": {}, "outputs": [], @@ -58,17 +58,17 @@ }, { "cell_type": "code", - "execution_count": 519, + "execution_count": 117, "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": 117, "metadata": {}, "output_type": "execute_result" } @@ -80,7 +80,7 @@ }, { "cell_type": "code", - "execution_count": 520, + "execution_count": 118, "id": "96d0bcfe", "metadata": {}, "outputs": [ @@ -90,7 +90,7 @@ "'/api/docs/Institute.json'" ] }, - "execution_count": 520, + "execution_count": 118, "metadata": {}, "output_type": "execute_result" } @@ -102,7 +102,7 @@ }, { "cell_type": "code", - "execution_count": 521, + "execution_count": 119, "id": "180d3352", "metadata": {}, "outputs": [], @@ -113,7 +113,7 @@ }, { "cell_type": "code", - "execution_count": 522, + "execution_count": 120, "id": "9825fec2", "metadata": {}, "outputs": [ @@ -180,18 +180,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": 120, "metadata": {}, "output_type": "execute_result" } @@ -202,7 +216,7 @@ }, { "cell_type": "code", - "execution_count": 523, + "execution_count": 121, "id": "50e5149a", "metadata": {}, "outputs": [ @@ -216,7 +230,7 @@ " '/api/v1/Common/invite']" ] }, - "execution_count": 523, + "execution_count": 121, "metadata": {}, "output_type": "execute_result" } @@ -227,7 +241,7 @@ }, { "cell_type": "code", - "execution_count": 524, + "execution_count": 122, "id": "8bd262de", "metadata": {}, "outputs": [ @@ -237,7 +251,7 @@ "'/api/v1/Teacher/invite'" ] }, - "execution_count": 524, + "execution_count": 122, "metadata": {}, "output_type": "execute_result" } @@ -249,7 +263,7 @@ }, { "cell_type": "code", - "execution_count": 525, + "execution_count": 193, "id": "9ad5283a", "metadata": {}, "outputs": [], @@ -259,25 +273,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": 194, "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": 194, "metadata": {}, "output_type": "execute_result" } @@ -297,7 +311,7 @@ }, { "cell_type": "code", - "execution_count": 527, + "execution_count": 195, "id": "0fbcad28", "metadata": {}, "outputs": [ @@ -305,8 +319,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\":1644914072445,\"params\":{\"resmsgid\":\"\",\"msgid\":\"760f6382-e28e-4cb5-91e4-7e2f56f7d38c\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Teacher\":{\"osid\":\"1-32000beb-ede1-47ab-b5d2-eb15587ce264\"}}}'\n", + "{'id': 'sunbird-rc.registry.invite', 'ver': '1.0', 'ets': 1644914072445, 'params': {'resmsgid': '', 'msgid': '760f6382-e28e-4cb5-91e4-7e2f56f7d38c', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'Teacher': {'osid': '1-32000beb-ede1-47ab-b5d2-eb15587ce264'}}}\n" ] } ], @@ -326,17 +340,17 @@ }, { "cell_type": "code", - "execution_count": 528, + "execution_count": 196, "id": "e0096a4c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'1-f5115e92-9ceb-4898-a08a-44d6e9c76897'" + "'1-32000beb-ede1-47ab-b5d2-eb15587ce264'" ] }, - "execution_count": 528, + "execution_count": 196, "metadata": {}, "output_type": "execute_result" } @@ -347,17 +361,17 @@ }, { "cell_type": "code", - "execution_count": 529, + "execution_count": 197, "id": "a4ff65b9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'61532629118'" + "'97767099632'" ] }, - "execution_count": 529, + "execution_count": 197, "metadata": {}, "output_type": "execute_result" } @@ -376,7 +390,7 @@ }, { "cell_type": "code", - "execution_count": 613, + "execution_count": 213, "id": "9e5c997a", "metadata": {}, "outputs": [ @@ -384,6 +398,7 @@ "name": "stdout", "output_type": "stream", "text": [ + "{'access_token': 'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJSQ19zUTBRVUJydVozbTFuTEFUaHFMUXFKcWpNN2g5ZGV2dnR2RVF6OEZFIn0.eyJleHAiOjE2NDQ5MTU4NjAsImlhdCI6MTY0NDkxNTI2MCwianRpIjoiNGUwMmViYWEtNTFkOS00OGNiLTlhMTgtNTA3MGJlZjJlNTVjIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIxMzVhYmQ3Mi0yNGQ1LTQwOTgtYjhmYy0yODBmMWJhODAwOTciLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiJkMjdjN2FkYy04MzVhLTRhYWMtOTgzNS03MzMxOGE0NDQ0NjIiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZW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JpcmQtcmMiLCJzdWIiOiIxMzVhYmQ3Mi0yNGQ1LTQwOTgtYjhmYy0yODBmMWJhODAwOTciLCJ0eXAiOiJSZWZyZXNoIiwiYXpwIjoicmVnaXN0cnktZnJvbnRlbmQiLCJzZXNzaW9uX3N0YXRlIjoiZDI3YzdhZGMtODM1YS00YWFjLTk4MzUtNzMzMThhNDQ0NDYyIiwic2NvcGUiOiJwcm9maWxlIGVtYWlsIn0.1uXQAJmigWgZYfRT2zhexNTrCVlSr-m7FRnfT55ApS0', 'token_type': 'Bearer', 'not-before-policy': 1607576887, 'session_state': 'd27c7adc-835a-4aac-9835-73318a444462', 'scope': 'profile email'}\n", "200\n" ] } @@ -401,24 +416,24 @@ "}\n", "\n", "response = requests.post('http://keycloak:8080/auth/realms/sunbird-rc/protocol/openid-connect/token', headers=headers, data=data)\n", - "\n", + "print(response.json())\n", "print(response.status_code)\n", "token = response.json()[\"access_token\"]\n" ] }, { "cell_type": "code", - "execution_count": 614, + "execution_count": 200, "id": "5162487f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJaUk4xbE9rdkloSjEzQjdjcEVXQlBIQURER01lZUFHVmUyTkx2QlpLT29vIn0.eyJleHAiOjE2NDQxNzUzNTIsImlhdCI6MTY0NDE3NDc1MiwianRpIjoiNTg3NDAzOTItNTAyMS00OTE5LTlmNmItNjU4OGE4MzNlOTM4IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIyYWViNzcwZS00ZTE1LTQ4YzUtOTViNC1hZTRhM2FhMzc2NzUiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiJkNzRjMDk2Mi01MjM4LTRiYjEtYWVlYi1iZDAzNDhjOGE5Nj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2NzA5OTYzMiIsImVudGl0eSI6WyJUZWFjaGVyIl0sImVtYWlsIjoiOTc3NjcwOTk2MzJAZXhhbXBsZS5jb20ifQ.lBTgo1tu3hPUfPYQGKrKAs_8921HUyMNzsCNdty-JQxYKu2WgNitku95A67eL4hV1j8ySYFPOki_BmttNc_abSLWsC83gD1o_f0h48_C_wS_SxXxh6g6c6l3B6_URAiIKPwmie5z5vP0DjcxQOmfry6TNaKkaPkl7qhOpr_yLzUBKVTeyaTdo4830equYTVrdJeCa0IIbBA6phe9gQOAkWcU24fylBm9o3LZU7CYE_fsbQT7Py5LO0Tlfy76l9R2C4YXoiIKPJDsteLnC3Y0WM4myAAgHSWe0yR43mZRrKzjEZWqWOfGOVTtCrUi5QQRYs6ZUsR8hJ-EPCtyjGN-tg'" ] }, - "execution_count": 614, + "execution_count": 200, "metadata": {}, "output_type": "execute_result" } @@ -429,7 +444,7 @@ }, { "cell_type": "code", - "execution_count": 569, + "execution_count": 201, "id": "a398971a", "metadata": {}, "outputs": [ @@ -444,44 +459,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" } @@ -508,7 +523,7 @@ }, { "cell_type": "code", - "execution_count": 570, + "execution_count": 202, "id": "b31e0286", "metadata": {}, "outputs": [ @@ -516,7 +531,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 +541,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 +558,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 +578,7 @@ }, { "cell_type": "code", - "execution_count": 572, + "execution_count": 204, "id": "6bc19944", "metadata": {}, "outputs": [ @@ -571,47 +586,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 +640,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 +654,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 +701,7 @@ }, { "cell_type": "code", - "execution_count": 627, + "execution_count": 215, "id": "a486eb16", "metadata": {}, "outputs": [ @@ -674,17 +710,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 +732,7 @@ }, { "cell_type": "code", - "execution_count": 628, + "execution_count": 216, "id": "c634f6ae", "metadata": {}, "outputs": [], @@ -706,7 +742,7 @@ }, { "cell_type": "code", - "execution_count": 629, + "execution_count": 217, "id": "24a56dc8", "metadata": {}, "outputs": [ @@ -721,14 +757,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 +782,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 +811,7 @@ }, { "cell_type": "code", - "execution_count": 630, + "execution_count": 219, "id": "141a9dc9", "metadata": {}, "outputs": [ @@ -778,17 +827,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 +856,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 +867,7 @@ }, { "cell_type": "code", - "execution_count": 632, + "execution_count": 220, "id": "7647f0e1", "metadata": {}, "outputs": [ @@ -833,22 +882,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 +924,143 @@ }, { "cell_type": "code", - "execution_count": 636, - "id": "9e091faf", + "execution_count": 221, + "id": "5f221ebb-59bf-4ec2-9a33-88a4549dcae7", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJSQ19zUTBRVUJydVozbTFuTEFUaHFMUXFKcWpNN2g5ZGV2dnR2RVF6OEZFIn0.eyJleHAiOjE2NDQ5MTU4NjAsImlhdCI6MTY0NDkxNTI2MCwianRpIjoiNGUwMmViYWEtNTFkOS00OGNiLTlhMTgtNTA3MGJlZjJlNTVjIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIxMzVhYmQ3Mi0yNGQ1LTQwOTgtYjhmYy0yODBmMWJhODAwOTciLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiJkMjdjN2FkYy04MzVhLTRhYWM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+ }, + "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-42190594-210d-4ebf-8904-5cb2e222aa74',\n", + " 'entityId': '1-8333e64a-4f4e-4d98-95b3-c4753f47acba',\n", " 'propertyURI': '',\n", - " 'createdAt': '2022-02-06T19:18:20.597+00:00',\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-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 +1072,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 +1088,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 +1124,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 +1150,7 @@ }, { "cell_type": "code", - "execution_count": 640, + "execution_count": 225, "id": "a1247108", "metadata": {}, "outputs": [ @@ -994,31 +1164,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-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", - " 'attestedOn': '2022-02-06T19:19:58.840+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': '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 +1280,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 +1356,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.9" + "version": "3.9.5" } }, "nbformat": 4, From 5d14d5a5c1d12dacf7b0568c42641041db66a2de Mon Sep 17 00:00:00 2001 From: Tejash Date: Tue, 15 Feb 2022 14:35:33 +0530 Subject: [PATCH 02/11] added db volume data dir --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index b15dc71..0aefff8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,8 @@ services: retries: 4 db: image: postgres + volumes: + - db-data:/var/lib/postgresql/data ports: - "5432:5432" environment: From 7f02f2950ff28dcab652d72ac46b2bc5a31ca742 Mon Sep 17 00:00:00 2001 From: Tejash Date: Tue, 15 Feb 2022 16:38:25 +0530 Subject: [PATCH 03/11] added file storage service --- docker-compose.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 0aefff8..a6db672 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,6 +51,10 @@ services: - sunbird_keycloak_user_set_password=true - sunbird_keycloak_user_password=abcd@123 - logging.level.root=DEBUG + - filestorage_connection_url=http://file-storage:9000 + - filestorage_access_key=admin + - filestorage_secret_key=ced9862ea6 + - filestorage_bucket_key=elocker ports: - "8081:8081" volumes: @@ -100,3 +104,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 From 9301b37503384f6081a9b4cffebf3730b9190708 Mon Sep 17 00:00:00 2001 From: Tejash Date: Wed, 23 Feb 2022 18:55:09 +0530 Subject: [PATCH 04/11] updated common json --- .gitignore | 1 + docker-compose.yml | 10 +-- schemas/Common.json | 208 +++++++++++++++++++++++++++++++------------ schemas/Student.json | 4 +- student-claim.ipynb | 96 +++++++++++++------- 5 files changed, 220 insertions(+), 99 deletions(-) diff --git a/.gitignore b/.gitignore index 485dee6..d61d27a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea +minio \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index a6db672..46c4788 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: @@ -25,7 +21,7 @@ services: db: image: postgres volumes: - - db-data:/var/lib/postgresql/data + - ./db-data:/var/lib/postgresql/data ports: - "5432:5432" environment: @@ -45,7 +41,7 @@ services: - sunbird_sso_realm=sunbird-rc - sunbird_sso_url=http://keycloak:8080/auth - sunbird_sso_admin_client_id=admin-api - - sunbird_sso_admin_client_secret=014b8593-b82e-4f65-ae7a-b287c737fca4 + - sunbird_sso_admin_client_secret=daea20dd-845b-4491-ae54-f374fe1950ae - sunbird_sso_client_id=registry-frontend - claims_url=http://claim-ms:8082 - sunbird_keycloak_user_set_password=true @@ -54,7 +50,7 @@ services: - filestorage_connection_url=http://file-storage:9000 - filestorage_access_key=admin - filestorage_secret_key=ced9862ea6 - - filestorage_bucket_key=elocker + - filestorage_bucket_key=ndear ports: - "8081:8081" volumes: diff --git a/schemas/Common.json b/schemas/Common.json index ceb0ece..1c4a5e9 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 OSID" + }, + "instituteName": { + "$id": "#/properties/instituteName", "type": "string", - "title": "Institute Full Name" + "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" + ] + } + } } } } @@ -189,6 +221,13 @@ "medium": { "$id": "#/properties/program", "type": "string", + "enum": [ + "English", + "Hindi", + "Gujarati", + "Malayalam", + "Tamil" + ], "title": "Medium of Education" }, "class": { @@ -210,6 +249,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 +271,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 +296,18 @@ } } }, + "Document": { + "type": "object", + "properties": { + "fileName": { + "type": "string", + "format": "file" + } + } + }, "Address": { "type": "object", "required": [ - ], "properties": { "plot": { @@ -271,7 +328,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/Student.json b/schemas/Student.json index 0c552a1..c28e686 100644 --- a/schemas/Student.json +++ b/schemas/Student.json @@ -85,10 +85,10 @@ "name": "$.identityDetails.fullName", "institute": "$.educationDetails[0].institute" }, - "paths": ["$.educationDetails[?(@.osid == 'PROPERTY_ID')]['institute', 'program', 'graduationYear', 'marks']", "$.identityDetails['fullName']"], + "paths": ["$.educationDetails[?(@.osid == 'PROPERTY_ID')]['instituteName', 'program', 'graduationYear', 'marks']", "$.identityDetails['fullName']"], "type": "MANUAL", "attestorEntity": "Teacher", - "conditions": "(ATTESTOR#$.experience.[*].institute#.contains(REQUESTER#$.institute#))", + "conditions": "(ATTESTOR#$.experience.[*].instituteOSID#.contains(REQUESTER#$.instituteOSID#) && ATTESTOR#$.experience[?(@.instituteOSID == REQUESTER#$.instituteOSID#)]['_osState']#.contains('PUBLISHED'))", "attestorPlugin": "did:internal:ClaimPluginActor?entity=Teacher", "credentialTemplate": {} } diff --git a/student-claim.ipynb b/student-claim.ipynb index 8771e17..1d2bf01 100644 --- a/student-claim.ipynb +++ b/student-claim.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 113, + "execution_count": 26, "id": "3f0dd619", "metadata": {}, "outputs": [], @@ -22,17 +22,18 @@ }, { "cell_type": "code", - "execution_count": 114, + "execution_count": 27, "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": 115, + "execution_count": 28, "id": "4c0e4ef1", "metadata": {}, "outputs": [], @@ -45,11 +46,12 @@ }, { "cell_type": "code", - "execution_count": 116, + "execution_count": 29, "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,7 +60,7 @@ }, { "cell_type": "code", - "execution_count": 117, + "execution_count": 30, "id": "0edbbada", "metadata": {}, "outputs": [ @@ -68,7 +70,7 @@ "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": 117, + "execution_count": 30, "metadata": {}, "output_type": "execute_result" } @@ -80,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 118, + "execution_count": 31, "id": "96d0bcfe", "metadata": {}, "outputs": [ @@ -90,7 +92,7 @@ "'/api/docs/Institute.json'" ] }, - "execution_count": 118, + "execution_count": 31, "metadata": {}, "output_type": "execute_result" } @@ -102,7 +104,7 @@ }, { "cell_type": "code", - "execution_count": 119, + "execution_count": 32, "id": "180d3352", "metadata": {}, "outputs": [], @@ -113,7 +115,7 @@ }, { "cell_type": "code", - "execution_count": 120, + "execution_count": 33, "id": "9825fec2", "metadata": {}, "outputs": [ @@ -205,7 +207,7 @@ " 'title': 'Affiliation'}}}}" ] }, - "execution_count": 120, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -216,7 +218,7 @@ }, { "cell_type": "code", - "execution_count": 121, + "execution_count": 34, "id": "50e5149a", "metadata": {}, "outputs": [ @@ -230,7 +232,7 @@ " '/api/v1/Common/invite']" ] }, - "execution_count": 121, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -241,7 +243,7 @@ }, { "cell_type": "code", - "execution_count": 122, + "execution_count": 35, "id": "8bd262de", "metadata": {}, "outputs": [ @@ -251,7 +253,7 @@ "'/api/v1/Teacher/invite'" ] }, - "execution_count": 122, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -263,7 +265,7 @@ }, { "cell_type": "code", - "execution_count": 193, + "execution_count": 36, "id": "9ad5283a", "metadata": {}, "outputs": [], @@ -281,7 +283,7 @@ }, { "cell_type": "code", - "execution_count": 194, + "execution_count": 37, "id": "547ea7ab", "metadata": {}, "outputs": [ @@ -291,7 +293,7 @@ "'{\"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": 194, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -311,7 +313,7 @@ }, { "cell_type": "code", - "execution_count": 195, + "execution_count": 38, "id": "0fbcad28", "metadata": {}, "outputs": [ @@ -319,8 +321,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "b'{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1644914072445,\"params\":{\"resmsgid\":\"\",\"msgid\":\"760f6382-e28e-4cb5-91e4-7e2f56f7d38c\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Teacher\":{\"osid\":\"1-32000beb-ede1-47ab-b5d2-eb15587ce264\"}}}'\n", - "{'id': 'sunbird-rc.registry.invite', 'ver': '1.0', 'ets': 1644914072445, 'params': {'resmsgid': '', 'msgid': '760f6382-e28e-4cb5-91e4-7e2f56f7d38c', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'Teacher': {'osid': '1-32000beb-ede1-47ab-b5d2-eb15587ce264'}}}\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" ] } ], @@ -340,17 +342,17 @@ }, { "cell_type": "code", - "execution_count": 196, + "execution_count": 39, "id": "e0096a4c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'1-32000beb-ede1-47ab-b5d2-eb15587ce264'" + "'1-d416775c-731c-40bc-9e69-20ebcff327e5'" ] }, - "execution_count": 196, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -361,17 +363,17 @@ }, { "cell_type": "code", - "execution_count": 197, + "execution_count": 40, "id": "a4ff65b9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'97767099632'" + "'47266833823'" ] }, - "execution_count": 197, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } @@ -390,7 +392,7 @@ }, { "cell_type": "code", - "execution_count": 213, + "execution_count": 41, "id": "9e5c997a", "metadata": {}, "outputs": [ @@ -398,7 +400,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'access_token': 'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJSQ19zUTBRVUJydVozbTFuTEFUaHFMUXFKcWpNN2g5ZGV2dnR2RVF6OEZFIn0.eyJleHAiOjE2NDQ5MTU4NjAsImlhdCI6MTY0NDkxNTI2MCwianRpIjoiNGUwMmViYWEtNTFkOS00OGNiLTlhMTgtNTA3MGJlZjJlNTVjIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIxMzVhYmQ3Mi0yNGQ1LTQwOTgtYjhmYy0yODBmMWJhODAwOTciLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiJkMjdjN2FkYy04MzVhLTRhYWMtOTgzNS03MzMxOGE0NDQ0NjIiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jY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hYWEzOGRjNGIifQ.eyJleHAiOjE2NDQ5MTU4NjAsImlhdCI6MTY0NDkxNTI2MCwianRpIjoiMmJiMjg3OGYtYTMzMS00MzE4LWE0MjAtM2MyYjY5Y2UyZGQ4IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6Imh0dHA6Ly9rZXljbG9hazo4MDgwL2F1dGgvcmVhbG1zL3N1bmJpcmQtcmMiLCJzdWIiOiIxMzVhYmQ3Mi0yNGQ1LTQwOTgtYjhmYy0yODBmMWJhODAwOTciLCJ0eXAiOiJSZWZyZXNoIiwiYXpwIjoicmVnaXN0cnktZnJvbnRlbmQiLCJzZXNzaW9uX3N0YXRlIjoiZDI3YzdhZGMtODM1YS00YWFjLTk4MzUtNzMzMThhNDQ0NDYyIiwic2NvcGUiOiJwcm9maWxlIGVtYWlsIn0.1uXQAJmigWgZYfRT2zhexNTrCVlSr-m7FRnfT55ApS0', 'token_type': 'Bearer', 'not-before-policy': 1607576887, 'session_state': 'd27c7adc-835a-4aac-9835-73318a444462', 'scope': 'profile email'}\n", + "{'access_token': 'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJVVG9zZ2JYUFZHdmk2a19tVnVEa1oxTTZHeGNtYnBDZW9lTHJBUjJKcC04In0.eyJleHAiOjE2NDUwODU2NDIsImlhdCI6MTY0NTA4NTA0MiwianRpIjoiNzE0ZDA2NDItNTg5My00MDY5LWJmY2MtMDE0NTRmZWM2M2JjIiwiaXNzIjoiaHR0cDovL25kZWFyLnhpdi5pbi9hdXRoL3JlYWxtcy9zdW5iaXJkLXJjIiwiYXVkIjoiYWNjb3VudCIsInN1YiI6IjFjMTQxZWI0LWQwMTctNDFkNS05ODEwLTgxNmE1ZjZkZGVkZSIsInR5cCI6IkJlYXJlciIsImF6cCI6InJlZ2lzdHJ5LWZyb250ZW5kIiwic2Vzc2lvbl9zdGF0ZSI6Im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VjBK2JZTvu6PQ', '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" ] } @@ -415,7 +417,7 @@ " '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", + "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" @@ -423,17 +425,17 @@ }, { "cell_type": "code", - "execution_count": 200, + "execution_count": 42, "id": "5162487f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'ey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sImh0dHBzOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwczovL25kZWFyLnhpdi5pbiIsImh0dHA6Ly9sb2NhbGhvc3Q6NDIwMCIsImh0dHA6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vMjAuMTk4LjY0LjEyOCJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiIsImRlZmF1bHQtcm9sZXMtbmRlYXIiXX0sInJlc291cmNlX2FjY2VzcyI6eyJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6InByb2ZpbGUgZW1haWwiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsInByZWZlcnJlZF91c2VybmFtZSI6IjQ3MjY2ODMzODIzIiwiZW50aXR5IjpbIlRlYWNoZXIiXSwiZW1haWwiOiI0NzI2NjgzMzgyM0BleGFtcGxlLmNvbSJ9.k5GzJYBw1uSLu8Ul2F8zn2QxfxrcfLfU54gqUXTPfECqXznLMZseIsNEvPSPdMa-vW387s6bN3L-5iKSreziQZ31VBf63D5DDX1lcglzNkaSo22R1KUIo86AchEMNbLOJEgFCx0xlE1AhE79-mNFUbrHMl2NXG4feIXbXQRthPu623Yx9Bp9-fM2vtNSShtL23pJjVlrHk6D2cXG1wIGgFfcwGlI7ywNNcwsE9-cuEEPlUj5rQt4AGvB6-1vFAM4GHV55TkwO6wy4twtjoC5RqsrYXt-oetBPqHFoXXbDIs1w8pGrJJA4q_r-2Fk_2uWujD2G1iInVjBK2JZTvu6PQ'" ] }, - "execution_count": 200, + "execution_count": 42, "metadata": {}, "output_type": "execute_result" } @@ -442,6 +444,24 @@ "token\n" ] }, + { + "cell_type": "code", + "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, @@ -513,6 +533,14 @@ "response.status_code, response.json()" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "7218f63f", + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "id": "e164092c", From 159de596bc95a707f53b1dde7b087ce1786b7490 Mon Sep 17 00:00:00 2001 From: Tejash Date: Tue, 15 Mar 2022 18:55:08 +0530 Subject: [PATCH 05/11] updated schema json files --- .gitignore | 4 +- docker-compose.yml | 3 +- edu-attestation-flows.ipynb | 1117 +++++++++++++++++++++++++++++++++++ schemas/.gitignore | 0 schemas/Common.json | 5 + schemas/Institute.json | 15 +- schemas/Student.json | 10 +- schemas/Teacher.json | 26 +- student-claim.ipynb | 12 +- 9 files changed, 1158 insertions(+), 34 deletions(-) create mode 100644 edu-attestation-flows.ipynb create mode 100644 schemas/.gitignore diff --git a/.gitignore b/.gitignore index d61d27a..90da14d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .idea -minio \ No newline at end of file +minio +db-data +.ipynb_checkpoints \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 46c4788..af855e1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,7 +41,7 @@ services: - sunbird_sso_realm=sunbird-rc - sunbird_sso_url=http://keycloak:8080/auth - sunbird_sso_admin_client_id=admin-api - - sunbird_sso_admin_client_secret=daea20dd-845b-4491-ae54-f374fe1950ae + - sunbird_sso_admin_client_secret=d112548e-09b8-411d-a1e0-b5870247affa - sunbird_sso_client_id=registry-frontend - claims_url=http://claim-ms:8082 - sunbird_keycloak_user_set_password=true @@ -73,6 +73,7 @@ services: - DB_PASSWORD=postgres - KEYCLOAK_USER=admin - KEYCLOAK_PASSWORD=admin + - KEYCLOAK_IMPORT=/opt/jboss/keycloak/imports/realm-export.json healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:9990/ || exit 1"] diff --git a/edu-attestation-flows.ipynb b/edu-attestation-flows.ipynb new file mode 100644 index 0000000..a015a4f --- /dev/null +++ b/edu-attestation-flows.ipynb @@ -0,0 +1,1117 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "id": "dc3d2384", + "metadata": {}, + "outputs": [], + "source": [ + "import requests\n", + "import random\n", + "import json" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "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": 14, + "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": 15, + "id": "380429d2", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647339119860,\"params\":{\"resmsgid\":\"\",\"msgid\":\"8724eccf-98ce-4b08-9511-50827da10e27\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Institute\":{\"osid\":\"1-c86017c8-1638-4ea2-a1eb-cc02371211f1\"}}}\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": 16, + "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@1234',\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": 17, + "id": "2635238e", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtRTZ0WlFxSWctWHhGaVJPR21ERXZOb2ctR2Y4RklkNkNTaEJqMVQ2Qkc0In0.eyJleHAiOjE2NDczMzk3MjIsImlhdCI6MTY0NzMzOTEyMiwianRpIjoiNzVhMDViOTEtNTgyMy00NDg3LWFjZTQtZmYzYTBjOWY1MTQ4IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI4OWZkNTFhOC1lMDU3LTQ5NzgtYTY4ZC1mYjZmNGVlZjE4NGQiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiI5MjE0YTI1OS1jMTUyLTRkMDktOTA1Mi1jMDcwOTY5NGJjOGQiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJhZG1pbjM2QG1haWxpbmF0b3IuY29tIiwiZW50aXR5IjpbIkluc3RpdHV0ZSJdLCJlbWFpbCI6ImFkbWluMzZAbWFpbGluYXRvci5jb20ifQ.A9W4Cj6aoEIZj5t3cXCMRdw3Ab3ExR2uaf5udkmtLg9j7iv_ndlbeQGx1KWvF2BsCVvii2H5DDvbgPLPUWdsm7iCt__GPVEq8ZP0WiOzMkeEDyb2-LCSl54QQg9MqkurL18GbtRwQ4d6rpmAVzKOwyBC83asbeeuv57eDADKPkZ9cBpnVd_m-dWzdYgtdqmb_YniWO233PnaFRpsjP0fn-WOFJXsZapioKuUXZ-2jRzsNvDCXVcf-TeZeU95z8UGD3wndLpi8-u0xC4gS9LY9979gWPimElHEidGSHKHEhalX1LAVeckMpw68KSGT5u76cmlLFa0mvNGQu--vm2cHA\n" + ] + } + ], + "source": [ + "token = getToken(instituteUserId)\n", + "print(token)" + ] + }, + { + "cell_type": "markdown", + "id": "e03f92ca", + "metadata": {}, + "source": [ + "# get institute details" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "6dd13699", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[{\"osUpdatedAt\":\"2022-03-15T10:12:00.539847Z\",\"osCreatedAt\":\"2022-03-15T10:12:00.539847Z\",\"osUpdatedBy\":\"\",\"contactNumber\":\"!23\",\"osCreatedBy\":\"\",\"osid\":\"1-c86017c8-1638-4ea2-a1eb-cc02371211f1\",\"osOwner\":[\"89fd51a8-e057-4978-a68d-fb6f4eef184d\"],\"email\":\"admin36@mailinator.com\",\"instituteName\":\"te\"}]\n", + "1-c86017c8-1638-4ea2-a1eb-cc02371211f1\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": 19, + "id": "e2d1cfe8", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "{'id': 'sunbird-rc.registry.update', 'ver': '1.0', 'ets': 1647339132237, 'params': {'resmsgid': '', 'msgid': '9199f4e7-6626-467c-b2ba-e1f9546d0666', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK'}\n", + "1-248f58ab-77a2-4faf-afff-d32d4ff322f2\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": 20, + "id": "31c1a78a", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n", + "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647339133313, 'params': {'resmsgid': '', 'msgid': 'f0fef9d7-86c8-43c6-9e7c-f78591157e2b', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-3c44ecbf-ae0c-45a2-a54f-8f4673424762'}}\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": 21, + "id": "730e0879", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "CLOSED\n", + "CLOSED\n", + "CLOSED\n", + "CLOSED\n", + "CLOSED\n", + "CLOSED\n", + "CLOSED\n", + "CLOSED\n", + "CLOSED\n", + "CLOSED\n", + "CLOSED\n", + "CLOSED\n", + "CLOSED\n", + "OPEN\n", + "de2a0593-e24e-4f2a-a519-386b848d20a9\n", + "\n", + "{'resmsgid': '', 'msgid': 'bb33666f-e379-460c-8720-b7b7fb7735ec', '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": 22, + "id": "63b8aa77", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[{\"osUpdatedAt\":\"2022-03-15T10:12:15.508669Z\",\"osCreatedAt\":\"2022-03-15T10:12:00.539847Z\",\"osUpdatedBy\":\"\",\"affiliation\":[{\"osUpdatedAt\":\"2022-03-15T10:12:15.508669Z\",\"grantYear\":\"2000\",\"osUpdatedBy\":\"\",\"classes\":[\"Class XII\"],\"affiliationNumber\":\"123\",\"expiryYear\":\"3001\",\"medium\":\"English\",\"osid\":\"1-248f58ab-77a2-4faf-afff-d32d4ff322f2\",\"board\":\"cbse\"}],\"contactNumber\":\"!23\",\"osCreatedBy\":\"\",\"instituteAffiliation\":[{\"osUpdatedAt\":\"2022-03-15T10:12:15.508669Z\",\"osUpdatedBy\":\"\",\"_osState\":\"PUBLISHED\",\"entityId\":\"1-c86017c8-1638-4ea2-a1eb-cc02371211f1\",\"osid\":\"1-3c44ecbf-ae0c-45a2-a54f-8f4673424762\",\"propertiesOSID\":{\"osid\":\"1-1d0f5d50-5411-4cb4-bb29-0eb603b91d23\",\"osUpdatedAt\":\"2022-03-15T10:12:13.480929Z\",\"affiliation\":[\"1-248f58ab-77a2-4faf-afff-d32d4ff322f2\"],\"osUpdatedBy\":\"89fd51a8-e057-4978-a68d-fb6f4eef184d\"},\"propertyData\":\"{\\\"affiliation\\\":[{\\\"osUpdatedAt\\\":\\\"2022-03-15T10:12:12.461819Z\\\",\\\"grantYear\\\":\\\"2000\\\",\\\"osUpdatedBy\\\":\\\"89fd51a8-e057-4978-a68d-fb6f4eef184d\\\",\\\"classes\\\":[\\\"Class XII\\\"],\\\"affiliationNumber\\\":\\\"123\\\",\\\"expiryYear\\\":\\\"3001\\\",\\\"medium\\\":\\\"English\\\",\\\"osid\\\":\\\"1-248f58ab-77a2-4faf-afff-d32d4ff322f2\\\",\\\"board\\\":\\\"cbse\\\"}],\\\"instituteName\\\":\\\"te\\\"}\",\"entityName\":\"Institute\",\"name\":\"instituteAffiliation\",\"_osAttestedData\":\"{\\\"affiliation\\\":[{\\\"osUpdatedAt\\\":\\\"2022-03-15T10:12:12.461819Z\\\",\\\"grantYear\\\":\\\"2000\\\",\\\"osUpdatedBy\\\":\\\"89fd51a8-e057-4978-a68d-fb6f4eef184d\\\",\\\"classes\\\":[\\\"Class XII\\\"],\\\"affiliationNumber\\\":\\\"123\\\",\\\"expiryYear\\\":\\\"3001\\\",\\\"medium\\\":\\\"English\\\",\\\"osid\\\":\\\"1-248f58ab-77a2-4faf-afff-d32d4ff322f2\\\",\\\"board\\\":\\\"cbse\\\"}],\\\"instituteName\\\":\\\"te\\\"}\",\"_osClaimId\":\"de2a0593-e24e-4f2a-a519-386b848d20a9\"}],\"osid\":\"1-c86017c8-1638-4ea2-a1eb-cc02371211f1\",\"osOwner\":[\"89fd51a8-e057-4978-a68d-fb6f4eef184d\"],\"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": 107, + "id": "c9c84d59", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647346991285,\"params\":{\"resmsgid\":\"\",\"msgid\":\"a75d0236-cf17-498b-a41b-6ee3810c6ad5\",\"err\":\"\",\"status\":\"UNSUCCESSFUL\",\"errmsg\":\"Username already invited / registered for Institute\"},\"responseCode\":\"OK\"}\n" + ] + }, + { + "ename": "AssertionError", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m/var/folders/1c/_2dh0xbx1k9fzwx2pwfhgxrr0000gn/T/ipykernel_31904/3842529591.py\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 14\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 15\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresponse\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtext\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 16\u001b[0;31m \u001b[0;32massert\u001b[0m \u001b[0mresponse\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstatus_code\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m200\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 17\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 18\u001b[0m instituteRequestBody = {\n", + "\u001b[0;31mAssertionError\u001b[0m: " + ] + } + ], + "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", + "\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" + ] + }, + { + "cell_type": "code", + "execution_count": 108, + "id": "d3156938", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647346998867,\"params\":{\"resmsgid\":\"\",\"msgid\":\"f8a9fb4f-83f4-4cc5-94bf-6fa1ad2f6006\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Teacher\":{\"osid\":\"1-eff29030-00a3-48cf-877f-a13244ed1fc2\"}}}\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\": \"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\n", + " \"instituteName\": \"ABC\"\n", + " }\n", + " ],\n", + " \"experience\": [\n", + " {\n", + " \"instituteOSID\": \"1-a140c49c-3575-471c-9e6c-e079fe920349\",\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": 109, + "id": "d9bf7bc7", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtRTZ0WlFxSWctWHhGaVJPR21ERXZOb2ctR2Y4RklkNkNTaEJqMVQ2Qkc0In0.eyJleHAiOjE2NDczNDc2MDAsImlhdCI6MTY0NzM0NzAwMCwianRpIjoiNmM1ZjgxZGQtMTljOS00OWQ2LTk2OWUtMjA3OTc4Mjk2MDNlIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI0ZmJlODAwNS0xNjdkLTQyOTYtODdjMS0wNTNmN2ViN2I5ZTciLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiIzNWU0NjM0NS1iZTUzLTQzNTUtODlmZi1kNTNmYWEzNDI3MDQiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0NyIsImVudGl0eSI6WyJUZWFjaGVyIl0sImVtYWlsIjoidDdAZy5jb20ifQ.pyfe0fNmDLhme2EyV4k8BTXCk7CL16KSABMj-zQcI_5vYtxBHMMQeIjqIh2TFClwp77ibTFEMV9K3J-bQcjzskHh7InG0nSQtqjf-b37cUagWrcDHp2zEisRXV785LBt_zmalDIJAZIzDPGoqruwig4-eFUvSy-rQRduYrqpA9KxxjijIcc67sQB4DisAHkhORobGH2jF3V-LgD8AOhj-hCkI-BFbg99XZNQ_Odb3qJtdg9-3kJdeERqGrSOiaZ5Y287qW8G5Z5aFVELaxR78tS30ploFIhVBmiREO3dSE-96hL7xoX2mh4FwPX8QP8-Yaz3Vsp9E40kfLqbZoaq_w\n" + ] + } + ], + "source": [ + "teacherToken = getToken(teacherUserId)\n", + "print(teacherToken)" + ] + }, + { + "cell_type": "code", + "execution_count": 110, + "id": "aeabd00a", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[{\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-ad81ff95-eb57-4b90-998c-5306a3251b7d\",\"instituteName\":\"ABC\"}],\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"contactDetails\":{\"osid\":\"1-ac11307d-18eb-413c-9670-18a45a7da924\",\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"mobile\":\"t7\",\"osCreatedBy\":\"\",\"email\":\"t7@g.com\"},\"osCreatedBy\":\"\",\"experience\":[{\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"osid\":\"1-0e225961-c800-4096-afc4-bdedbb9cbdda\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}],\"osid\":\"1-eff29030-00a3-48cf-877f-a13244ed1fc2\",\"osOwner\":[\"4fbe8005-167d-4296-87c1-053f7eb7b9e7\"],\"identityDetails\":{\"osid\":\"1-e9d59f1c-b4d1-4f68-9cd6-c9ae83347a4a\",\"identityHolder\":{\"osid\":\"1-90bfecd1-85b4-4605-ab6d-55e31c4245a9\",\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"AADHAAR\":\"123412323\"},\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"gender\":\"Male\",\"osUpdatedBy\":\"\",\"dob\":\"1995-10-28\",\"osCreatedBy\":\"\",\"fullName\":\"teacher1\"}}]\n", + "1-0e225961-c800-4096-afc4-bdedbb9cbdda\n", + "1-ad81ff95-eb57-4b90-998c-5306a3251b7d\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": 111, + "id": "5befaa8f", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n", + "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647347006133, 'params': {'resmsgid': '', 'msgid': '4ee5a6e3-da2e-4731-b86d-0d2d0c2a4f61', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-be25e98c-a731-4c47-803b-32734442a389'}}\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": 112, + "id": "5a219b6b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtRTZ0WlFxSWctWHhGaVJPR21ERXZOb2ctR2Y4RklkNkNTaEJqMVQ2Qkc0In0.eyJleHAiOjE2NDczNDc2MDcsImlhdCI6MTY0NzM0NzAwNywianRpIjoiZGQ0MzdlYjItZTM5Mi00ZTM0LTkzNTYtYjEzM2QyNzI4NmQ4IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJhNDM3ZDQwMi1lNWFiLTQ3M2QtYWZjZi04MDZhMDBjNjY1MzIiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiI4ODUyMzQzZC0yMTg2LTQ0ODEtYWRiMS04NGFjMTU5ZTY5NjAiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LX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VyPEwbl7SYQT0w4a9CTVYaFPkxzoHAh3XUaICNEHy27Qlnd03miju9tacy7XtK5-M_I2B1zNE5tQ\n" + ] + } + ], + "source": [ + "# get institute token\n", + "institute1Token = getToken(institute1)\n", + "print(institute1Token)\n", + "institute2Token = getToken(institute2)\n", + "print(institute2Token)" + ] + }, + { + "cell_type": "code", + "execution_count": 113, + "id": "e07d0934", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "[{'id': '8950419f-ef1a-4ebe-9ee5-6d77a4d0b2b3', 'entity': 'Teacher', 'entityId': '1-73d6607f-8158-42c6-8702-e9aca997e29d', 'propertyURI': '', 'createdAt': '2022-03-15T11:38:24.123+00:00', 'attestedOn': '2022-03-15T11:43:18.891+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.osid#.contains('1-a140c49c-3575-471c-9e6c-e079fe920349'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"experience\":[{\"osUpdatedAt\":\"2022-03-15T11:37:41.053052Z\",\"osCreatedAt\":\"2022-03-15T11:37:41.053052Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"osid\":\"1-3223d019-865d-433f-8e1c-7e72b66ff62d\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}]}', 'attestationId': '1-0d91ad9d-82ce-4702-8362-e7a31bf761de', 'attestationName': 'teacherExperience', 'closed': True}, {'id': '1060c8ae-9428-4f75-89b7-2da3fcc0ee62', 'entity': 'Teacher', 'entityId': '1-eff29030-00a3-48cf-877f-a13244ed1fc2', 'propertyURI': '', 'createdAt': '2022-03-15T12:23:26.640+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.osid#.contains('1-a140c49c-3575-471c-9e6c-e079fe920349'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"experience\":[{\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"osid\":\"1-0e225961-c800-4096-afc4-bdedbb9cbdda\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}]}', 'attestationId': '1-be25e98c-a731-4c47-803b-32734442a389', 'attestationName': 'teacherExperience', 'closed': False}]\n", + "CLOSED\n", + "OPEN\n", + "1060c8ae-9428-4f75-89b7-2da3fcc0ee62\n", + "\n", + "{'resmsgid': '', 'msgid': '7f806382-b532-47b1-b80f-97783ccfcb10', '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": 114, + "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": 115, + "id": "610427a1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n", + "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647347020325, 'params': {'resmsgid': '', 'msgid': '78400fec-8639-40f3-8389-3f9cf5b22a49', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-884812fd-e8e9-4cda-b414-1f7dfce4d285'}}\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": 116, + "id": "2f551799", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtRTZ0WlFxSWctWHhGaVJPR21ERXZOb2ctR2Y4RklkNkNTaEJqMVQ2Qkc0In0.eyJleHAiOjE2NDczNDc2MjQsImlhdCI6MTY0NzM0NzAyNCwianRpIjoiMzQ5Mzk5YWItZjkxNi00YWNjLWIyZmUtOGQyOWI5M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PJSJ9ezYKS0r59l80sJNc3AdFCxqGzCOX0ZqmifWbl2WDIygHf0L0I3TpqI3ebEowlG1k82lDS-d6DcvrxOBbtbxRg-e2YdIBGfODqfsiWywX3c4oq64R8AoNqB-Kq_el5FBHro1U-hZtpMksxahqjMG5FvLiS-RZK7qctSHhqDEBQFpZTXaIBEwNGvKwwFBX8EJKPIPnTzQeDTRBA9rvkWA2Q8NAyAhT7mNqZml4lrPO2n7sG9XWxyhnjSYD41sTqqcMA\n", + "\n", + "[{'id': '66837410-de73-4170-8641-8e795b6d71a1', 'entity': 'Teacher', 'entityId': '1-73d6607f-8158-42c6-8702-e9aca997e29d', 'propertyURI': '', 'createdAt': '2022-03-15T11:45:51.402+00:00', 'attestedOn': '2022-03-15T11:46:05.985+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.osid#.contains('1-0e343abd-c710-45a3-a240-e5d8f30ae2d2'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T11:43:23.385636Z\",\"osCreatedAt\":\"2022-03-15T11:37:41.053052Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-9dd172c4-d053-4ec4-8b96-58b4badbf4ba\",\"instituteName\":\"ABC\"}]}', 'attestationId': '1-0c86bf64-1f77-4e2d-aa40-7033dc9c9153', 'attestationName': 'teacherAcademicsQualification', 'closed': True}, {'id': '77aa7b9a-ca0b-4b6a-9e9b-8b8186293a7e', 'entity': 'Teacher', 'entityId': '1-73d6607f-8158-42c6-8702-e9aca997e29d', 'propertyURI': '', 'createdAt': '2022-03-15T12:18:16.948+00:00', 'attestedOn': '2022-03-15T12:18:17.214+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.osid#.contains('1-0e343abd-c710-45a3-a240-e5d8f30ae2d2'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T11:46:12.952025Z\",\"osCreatedAt\":\"2022-03-15T11:37:41.053052Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-9dd172c4-d053-4ec4-8b96-58b4badbf4ba\",\"instituteName\":\"ABC\"}]}', 'attestationId': '1-34a9d265-c4ca-4501-88bf-6650ad93ab14', 'attestationName': 'teacherAcademicsQualification', 'closed': True}, {'id': '064848e3-d1ef-4f15-87d7-e1aec9997399', 'entity': 'Teacher', 'entityId': '1-73d6607f-8158-42c6-8702-e9aca997e29d', 'propertyURI': '', 'createdAt': '2022-03-15T12:20:17.479+00:00', 'attestedOn': '2022-03-15T12:20:22.357+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.osid#.contains('1-0e343abd-c710-45a3-a240-e5d8f30ae2d2'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T12:18:17.492222Z\",\"osCreatedAt\":\"2022-03-15T11:37:41.053052Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-9dd172c4-d053-4ec4-8b96-58b4badbf4ba\",\"instituteName\":\"ABC\"}]}', 'attestationId': '1-f3dacf9e-1e83-4e3b-ba11-70942d4402fe', 'attestationName': 'teacherAcademicsQualification', 'closed': True}, {'id': '3e8c5a86-8ed2-46fb-bc6a-0b8b5ae55307', 'entity': 'Teacher', 'entityId': '1-eff29030-00a3-48cf-877f-a13244ed1fc2', 'propertyURI': '', 'createdAt': '2022-03-15T12:23:40.904+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.osid#.contains('1-0e343abd-c710-45a3-a240-e5d8f30ae2d2'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T12:23:29.170474Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-ad81ff95-eb57-4b90-998c-5306a3251b7d\",\"instituteName\":\"ABC\"}]}', 'attestationId': '1-884812fd-e8e9-4cda-b414-1f7dfce4d285', 'attestationName': 'teacherAcademicsQualification', 'closed': False}]\n", + "CLOSED\n", + "CLOSED\n", + "CLOSED\n", + "OPEN\n", + "3e8c5a86-8ed2-46fb-bc6a-0b8b5ae55307\n", + "\n", + "{'resmsgid': '', 'msgid': 'a1cbfadd-d89b-460c-9ee1-231f6c463c96', '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": 117, + "id": "1d5abf7e", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'osUpdatedAt': '2022-03-15T12:23:44.788292Z', 'osUpdatedBy': '', '_osState': 'PUBLISHED', 'entityId': '1-eff29030-00a3-48cf-877f-a13244ed1fc2', 'osid': '1-884812fd-e8e9-4cda-b414-1f7dfce4d285', 'propertiesOSID': {'osid': '1-7c8b2cfd-a567-4716-90b7-2493fe648a8c', 'osUpdatedAt': '2022-03-15T12:23:40.550652Z', 'academicQualifications': ['1-ad81ff95-eb57-4b90-998c-5306a3251b7d'], 'osUpdatedBy': '4fbe8005-167d-4296-87c1-053f7eb7b9e7'}, 'propertyData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T12:23:29.170474Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-ad81ff95-eb57-4b90-998c-5306a3251b7d\",\"instituteName\":\"ABC\"}]}', 'entityName': 'Teacher', 'name': 'teacherAcademicsQualification', '_osAttestedData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T12:23:29.170474Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-ad81ff95-eb57-4b90-998c-5306a3251b7d\",\"instituteName\":\"ABC\"}]}', '_osClaimId': '3e8c5a86-8ed2-46fb-bc6a-0b8b5ae55307'}\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": 150, + "id": "ec61edde", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647350487384,\"params\":{\"resmsgid\":\"\",\"msgid\":\"7bb40e51-f057-4662-baa1-1c2a521d0b75\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Student\":{\"osid\":\"1-d77f3eba-16ba-4aff-bde5-5eda1cda32db\"}}}\n" + ] + } + ], + "source": [ + "# create teacher\n", + "studentUserId = \"s4\"\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\": \"1-a140c49c-3575-471c-9e6c-e079fe920349\",\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": 151, + "id": "3c4d8483", + "metadata": {}, + "outputs": [ + { + "name": "stdout", +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WQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzNCIsImVudGl0eSI6WyJTdHVkZW50Il0sImVtYWlsIjoiczRAZy5jb20ifQ.q8sexNBDdSZgU3ZBtwEWKMos2WCKskMj42SSmGlYRjmhqk6268IzF_1T38O3q4dsiBubqnl1zly0f81ZVHePSionam2uMo44ljeAOVFQcxM2xiAJM_sNfUgy0XCPyRgNh9NrE7PBZzLJuSNlRJkV54WLBsdExzlIXtz1hDvXxPjZkRJhGSJTcVpddiDr9U83rrSjgjgOcb5QX31DwTNOXeZM4EwDgAX14ej7MPKSCTnCYQo-guNw2WOAmSk9kFIXzeKAgWApIbI9cp_SRlbQ2jtCGA85SzaI0xewpS5N0xDClQK5gFwuvMxlZFKlxsqm36m_2W5kiCxgCN-zuNjiAA\n" + ] + } + ], + "source": [ + "studentToken = getToken(studentUserId)\n", + "print(studentToken)" + ] + }, + { + "cell_type": "code", + "execution_count": 152, + "id": "fa0768fa", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[{\"educationDetails\":[{\"osid\":\"1-914fdd90-0cf1-477b-ae5e-f1c9a1545667\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}],\"contactDetails\":{\"osid\":\"1-f3768c65-c6bd-4d22-9440-f328b47ce8ef\",\"mobile\":\"s4\",\"email\":\"s4@g.com\"},\"osid\":\"1-d77f3eba-16ba-4aff-bde5-5eda1cda32db\",\"osOwner\":[\"7b3b8633-d48a-4b9d-8fbb-ab96d7e4d19e\"],\"identityDetails\":{\"osid\":\"1-6985aa68-0785-4b6d-be0d-5cfa0210d7c6\",\"identityHolder\":{\"osid\":\"1-a3695ffe-2170-4510-956c-ba1f643c61bf\",\"AADHAAR\":\"123412323\"},\"gender\":\"Male\",\"dob\":\"1995-10-28\",\"fullName\":\"student1\"}}]\n", + "1-914fdd90-0cf1-477b-ae5e-f1c9a1545667\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": 153, + "id": "103655ed", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n", + "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647350493478, 'params': {'resmsgid': '', 'msgid': '7a27f91f-741e-40a8-b50e-c6aec1310466', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-b8095c70-b406-471a-b22d-8356e71c686c'}}\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": 154, + "id": "8e71173c", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtRTZ0WlFxSW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1ZGVudCJdLCJlbWFpbCI6InQ3QGcuY29tIn0.tHMeKzFn7rRjloday-nc2nkI7BxCrzjI4SLAt0tCNy0tl6UI2u0kAlIidhTzIL_S5Avkwi_fkC6J98l_4cwI7LNPSPpLk1Ds8Z4vFmTqW0ww2fa9_eaOmEPV7H1E8iU3QkAFq2CkfVBmpWDzaQ2o0zkxctQKcK9It_qxuzrTjAFc2peyr_BG9Hi72GKC70I20a7ZqX4K5X6VpQrytp1DkxGx8s-v8042D9FBVwld-8m_ARGzkwiUdHdS8gSHxwueucAoSK9r0HYuGo5PbIU757uRoco9E1o9mmQRxW0hBdtccm90ougQTJwJ2vehjHg_PvI0VUrpDb5Fix4j_9w1AQ\n", + "\n", + "[{'id': 'c3d65257-0e52-4a9d-a19b-164a449c9d97', 'entity': 'Student', 'entityId': '1-5a873d39-f2dc-435a-8882-2c0621531780', 'propertyURI': '', 'createdAt': '2022-03-15T13:16:52.062+00:00', 'attestedOn': '2022-03-15T13:17:13.339+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.experience.[*].instituteOSID#.contains('1-a140c49c-3575-471c-9e6c-e079fe920349'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'propertyData': '{\"name\":\"student1\",\"educationDetails\":[{\"osid\":\"1-f739247d-4b1a-4672-8f11-227ef0d50039\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}]}', 'attestationId': '1-63857c03-5a23-4321-8df1-9ee8e6447465', 'attestationName': 'studentInstituteAttest', 'closed': True}, {'id': '9aed418a-b45a-4c3f-840e-9da4ebddf613', 'entity': 'Student', 'entityId': '1-d77f3eba-16ba-4aff-bde5-5eda1cda32db', 'propertyURI': '', 'createdAt': '2022-03-15T13:21:33.877+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.experience.[*].instituteOSID#.contains('1-a140c49c-3575-471c-9e6c-e079fe920349'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'propertyData': '{\"name\":\"student1\",\"educationDetails\":[{\"osid\":\"1-914fdd90-0cf1-477b-ae5e-f1c9a1545667\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}]}', 'attestationId': '1-b8095c70-b406-471a-b22d-8356e71c686c', 'attestationName': 'studentInstituteAttest', 'closed': False}]\n", + "CLOSED\n", + "OPEN\n", + "9aed418a-b45a-4c3f-840e-9da4ebddf613\n", + "\n", + "{'resmsgid': '', 'msgid': '2af07e8b-8d60-400a-889c-4183722f9a1e', '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": 155, + "id": "35071076", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'entityName': 'Student', '_osState': 'PUBLISHED', 'name': 'studentInstituteAttest', 'entityId': '1-d77f3eba-16ba-4aff-bde5-5eda1cda32db', 'osid': '1-b8095c70-b406-471a-b22d-8356e71c686c', '_osAttestedData': '{\"name\":\"student1\",\"educationDetails\":[{\"osid\":\"1-914fdd90-0cf1-477b-ae5e-f1c9a1545667\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}]}', 'propertiesOSID': {'osid': '1-709482b4-2f91-454a-ae22-d5ccd73fe7e1', 'educationDetails': ['1-914fdd90-0cf1-477b-ae5e-f1c9a1545667']}, '_osClaimId': '9aed418a-b45a-4c3f-840e-9da4ebddf613', 'propertyData': '{\"name\":\"student1\",\"educationDetails\":[{\"osid\":\"1-914fdd90-0cf1-477b-ae5e-f1c9a1545667\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"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/schemas/.gitignore b/schemas/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/schemas/Common.json b/schemas/Common.json index 1c4a5e9..5a87ade 100644 --- a/schemas/Common.json +++ b/schemas/Common.json @@ -213,6 +213,11 @@ "type": "string", "title": "Institute Name" }, + "instituteOSID": { + "$id": "#/properties/instituteOSID", + "type": "string", + "title": "Institute Osid" + }, "board": { "$id": "#/properties/board", "type": "string", diff --git a/schemas/Institute.json b/schemas/Institute.json index 91db064..eeefaf8 100644 --- a/schemas/Institute.json +++ b/schemas/Institute.json @@ -176,13 +176,14 @@ ], "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" + } } ], "internalFields": [], diff --git a/schemas/Student.json b/schemas/Student.json index c28e686..3b70c78 100644 --- a/schemas/Student.json +++ b/schemas/Student.json @@ -77,20 +77,16 @@ "attestationPolicies": [ { "name": "studentInstituteAttest", - "properties": ["educationDetails/[]"], "additionalInput": { "enrollmentNumber": {"type": "string"} }, "attestationProperties": { "name": "$.identityDetails.fullName", - "institute": "$.educationDetails[0].institute" + "educationDetails": "$.educationDetails" }, - "paths": ["$.educationDetails[?(@.osid == 'PROPERTY_ID')]['instituteName', 'program', 'graduationYear', 'marks']", "$.identityDetails['fullName']"], "type": "MANUAL", - "attestorEntity": "Teacher", - "conditions": "(ATTESTOR#$.experience.[*].instituteOSID#.contains(REQUESTER#$.instituteOSID#) && ATTESTOR#$.experience[?(@.instituteOSID == REQUESTER#$.instituteOSID#)]['_osState']#.contains('PUBLISHED'))", - "attestorPlugin": "did:internal:ClaimPluginActor?entity=Teacher", - "credentialTemplate": {} + "conditions": "(ATTESTOR#$.experience.[*].instituteOSID#.contains(REQUESTER#$.educationDetails.*.instituteOSID#))", + "attestorPlugin": "did:internal:ClaimPluginActor?entity=Teacher" } ], "inviteRoles":["anonymous"], diff --git a/schemas/Teacher.json b/schemas/Teacher.json index aeffc00..6f0a3b9 100644 --- a/schemas/Teacher.json +++ b/schemas/Teacher.json @@ -75,20 +75,22 @@ ], "attestationPolicies": [ { - "property": "experience/[]", - "paths": [ - "experience" - ], - "attestorEntity": "Institute", - "conditions": "(ATTESTOR#$.osid#.contains(REQUESTER#$.instituteOSID#))" + "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#$.osid#.contains(REQUESTER#$.instituteOSID#))" + "name": "teacherAcademicsQualification", + "conditions": "(ATTESTOR#$.osid#.contains(REQUESTER#$.academicQualifications.*.instituteOSID#))", + "type": "MANUAL", + "attestorPlugin": "did:internal:ClaimPluginActor?entity=Institute", + "attestationProperties": { + "academicQualifications": "$.academicQualifications" + } } ], "internalFields": [], diff --git a/student-claim.ipynb b/student-claim.ipynb index 1d2bf01..6afd7ce 100644 --- a/student-claim.ipynb +++ b/student-claim.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 26, + "execution_count": 1, "id": "3f0dd619", "metadata": {}, "outputs": [], @@ -22,7 +22,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 2, "id": "22c16507", "metadata": {}, "outputs": [], @@ -33,7 +33,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 3, "id": "4c0e4ef1", "metadata": {}, "outputs": [], @@ -46,7 +46,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 4, "id": "27da0f32", "metadata": {}, "outputs": [], @@ -60,7 +60,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 5, "id": "0edbbada", "metadata": {}, "outputs": [ @@ -70,7 +70,7 @@ "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": 30, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } From 97371a7b29f722bba1560dc5be903907bbf75630 Mon Sep 17 00:00:00 2001 From: Tejash Date: Wed, 16 Mar 2022 10:35:16 +0530 Subject: [PATCH 06/11] - updated realm with default users and client secret - fixed api notebook --- docker-compose.yml | 6 +- edu-attestation-flows.ipynb | 182 ++++++++++++++++-------------------- imports/realm-export.json | 105 ++++++++++++--------- 3 files changed, 143 insertions(+), 150 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index af855e1..42f0933 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres registry: - image: dockerhub/sunbird-rc-core:latest + image: dockerhub/sunbird-rc-core:v0.0.5 environment: - authentication_enabled=true - signature_enabled=false @@ -46,11 +46,11 @@ services: - claims_url=http://claim-ms:8082 - sunbird_keycloak_user_set_password=true - sunbird_keycloak_user_password=abcd@123 - - logging.level.root=DEBUG - 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: @@ -87,7 +87,7 @@ services: db: condition: service_started 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 diff --git a/edu-attestation-flows.ipynb b/edu-attestation-flows.ipynb index a015a4f..e475a8b 100644 --- a/edu-attestation-flows.ipynb +++ b/edu-attestation-flows.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": 34, "id": "dc3d2384", "metadata": {}, "outputs": [], @@ -14,7 +14,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 35, "id": "f3912238", "metadata": {}, "outputs": [], @@ -33,7 +33,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 36, "id": "1a79ff08", "metadata": {}, "outputs": [], @@ -48,7 +48,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 37, "id": "380429d2", "metadata": {}, "outputs": [ @@ -56,7 +56,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647339119860,\"params\":{\"resmsgid\":\"\",\"msgid\":\"8724eccf-98ce-4b08-9511-50827da10e27\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Institute\":{\"osid\":\"1-c86017c8-1638-4ea2-a1eb-cc02371211f1\"}}}\n" + "{\"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" ] } ], @@ -81,7 +81,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 38, "id": "afe497bd", "metadata": {}, "outputs": [], @@ -94,7 +94,7 @@ " data = {\n", " 'client_id': 'registry-frontend',\n", " 'username': userId,\n", - " 'password': 'abcd@1234',\n", + " 'password': 'abcd@123',\n", " 'grant_type': 'password'\n", " }\n", "\n", @@ -107,7 +107,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 39, "id": "2635238e", "metadata": {}, "outputs": [ @@ -115,7 +115,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtRTZ0WlFxSWctWHhGaVJPR21ERXZOb2ctR2Y4RklkNkNTaEJqMVQ2Qkc0In0.eyJleHAiOjE2NDczMzk3MjIsImlhdCI6MTY0NzMzOTEyMiwianRpIjoiNzVhMDViOTEtNTgyMy00NDg3LWFjZTQtZmYzYTBjOWY1MTQ4IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyI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JjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJhZG1pbjM2QG1haWxpbmF0b3IuY29tIiwiZW50aXR5IjpbIkluc3RpdHV0ZSJdLCJlbWFpbCI6ImFkbWluMzZAbWFpbGluYXRvci5jb20ifQ.ifHzE2Z2he3mwqlfJPibukmCEkf2M-kNqohoHFA-miF27WKwuJg8RDwXGHsD7cdvtjVaPLFo-da35QHllkpnuNA1cFAy5D7nzAP5PAShcZjXO8zkDEL307RlzWxVIOB53w8OEGBbfaxIB6bOdfHZkeMkoGUiUu6XnL8AwF8carGQW3zDiR_-jY2OWkHzRAjk-lHYVl6WnXcZs1AaiuoOPAB81CJRQa6XuUaD1GE3lyIpqN7OlgAAl4ad1w6HlAn-MaBj7iBDnErYcYm6yzuaubiYnarQ8EJ7rgdt6LfB1uKabjqG2rbLt_9AtqwiOEM7zmfm-V_-uaf9Ft5L80aDcw\n" ] } ], @@ -134,7 +134,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 40, "id": "6dd13699", "metadata": {}, "outputs": [ @@ -142,8 +142,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "[{\"osUpdatedAt\":\"2022-03-15T10:12:00.539847Z\",\"osCreatedAt\":\"2022-03-15T10:12:00.539847Z\",\"osUpdatedBy\":\"\",\"contactNumber\":\"!23\",\"osCreatedBy\":\"\",\"osid\":\"1-c86017c8-1638-4ea2-a1eb-cc02371211f1\",\"osOwner\":[\"89fd51a8-e057-4978-a68d-fb6f4eef184d\"],\"email\":\"admin36@mailinator.com\",\"instituteName\":\"te\"}]\n", - "1-c86017c8-1638-4ea2-a1eb-cc02371211f1\n" + "[{\"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" ] } ], @@ -172,7 +172,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 41, "id": "e2d1cfe8", "metadata": {}, "outputs": [ @@ -181,8 +181,8 @@ "output_type": "stream", "text": [ "\n", - "{'id': 'sunbird-rc.registry.update', 'ver': '1.0', 'ets': 1647339132237, 'params': {'resmsgid': '', 'msgid': '9199f4e7-6626-467c-b2ba-e1f9546d0666', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK'}\n", - "1-248f58ab-77a2-4faf-afff-d32d4ff322f2\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" ] } ], @@ -228,7 +228,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 42, "id": "31c1a78a", "metadata": {}, "outputs": [ @@ -237,7 +237,7 @@ "output_type": "stream", "text": [ "200\n", - "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647339133313, 'params': {'resmsgid': '', 'msgid': 'f0fef9d7-86c8-43c6-9e7c-f78591157e2b', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-3c44ecbf-ae0c-45a2-a54f-8f4673424762'}}\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" ] } ], @@ -278,7 +278,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 43, "id": "730e0879", "metadata": {}, "outputs": [ @@ -287,23 +287,10 @@ "output_type": "stream", "text": [ "\n", - "CLOSED\n", - "CLOSED\n", - "CLOSED\n", - "CLOSED\n", - "CLOSED\n", - "CLOSED\n", - "CLOSED\n", - "CLOSED\n", - "CLOSED\n", - "CLOSED\n", - "CLOSED\n", - "CLOSED\n", - "CLOSED\n", "OPEN\n", - "de2a0593-e24e-4f2a-a519-386b848d20a9\n", + "abf0e852-50cc-4caa-b973-db0dc4e2ebef\n", "\n", - "{'resmsgid': '', 'msgid': 'bb33666f-e379-460c-8720-b7b7fb7735ec', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}\n" + "{'resmsgid': '', 'msgid': '8d535783-74bb-4f36-92b7-6175a2743bb4', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}\n" ] } ], @@ -362,7 +349,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 44, "id": "63b8aa77", "metadata": {}, "outputs": [ @@ -370,7 +357,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "[{\"osUpdatedAt\":\"2022-03-15T10:12:15.508669Z\",\"osCreatedAt\":\"2022-03-15T10:12:00.539847Z\",\"osUpdatedBy\":\"\",\"affiliation\":[{\"osUpdatedAt\":\"2022-03-15T10:12:15.508669Z\",\"grantYear\":\"2000\",\"osUpdatedBy\":\"\",\"classes\":[\"Class XII\"],\"affiliationNumber\":\"123\",\"expiryYear\":\"3001\",\"medium\":\"English\",\"osid\":\"1-248f58ab-77a2-4faf-afff-d32d4ff322f2\",\"board\":\"cbse\"}],\"contactNumber\":\"!23\",\"osCreatedBy\":\"\",\"instituteAffiliation\":[{\"osUpdatedAt\":\"2022-03-15T10:12:15.508669Z\",\"osUpdatedBy\":\"\",\"_osState\":\"PUBLISHED\",\"entityId\":\"1-c86017c8-1638-4ea2-a1eb-cc02371211f1\",\"osid\":\"1-3c44ecbf-ae0c-45a2-a54f-8f4673424762\",\"propertiesOSID\":{\"osid\":\"1-1d0f5d50-5411-4cb4-bb29-0eb603b91d23\",\"osUpdatedAt\":\"2022-03-15T10:12:13.480929Z\",\"affiliation\":[\"1-248f58ab-77a2-4faf-afff-d32d4ff322f2\"],\"osUpdatedBy\":\"89fd51a8-e057-4978-a68d-fb6f4eef184d\"},\"propertyData\":\"{\\\"affiliation\\\":[{\\\"osUpdatedAt\\\":\\\"2022-03-15T10:12:12.461819Z\\\",\\\"grantYear\\\":\\\"2000\\\",\\\"osUpdatedBy\\\":\\\"89fd51a8-e057-4978-a68d-fb6f4eef184d\\\",\\\"classes\\\":[\\\"Class XII\\\"],\\\"affiliationNumber\\\":\\\"123\\\",\\\"expiryYear\\\":\\\"3001\\\",\\\"medium\\\":\\\"English\\\",\\\"osid\\\":\\\"1-248f58ab-77a2-4faf-afff-d32d4ff322f2\\\",\\\"board\\\":\\\"cbse\\\"}],\\\"instituteName\\\":\\\"te\\\"}\",\"entityName\":\"Institute\",\"name\":\"instituteAffiliation\",\"_osAttestedData\":\"{\\\"affiliation\\\":[{\\\"osUpdatedAt\\\":\\\"2022-03-15T10:12:12.461819Z\\\",\\\"grantYear\\\":\\\"2000\\\",\\\"osUpdatedBy\\\":\\\"89fd51a8-e057-4978-a68d-fb6f4eef184d\\\",\\\"classes\\\":[\\\"Class XII\\\"],\\\"affiliationNumber\\\":\\\"123\\\",\\\"expiryYear\\\":\\\"3001\\\",\\\"medium\\\":\\\"English\\\",\\\"osid\\\":\\\"1-248f58ab-77a2-4faf-afff-d32d4ff322f2\\\",\\\"board\\\":\\\"cbse\\\"}],\\\"instituteName\\\":\\\"te\\\"}\",\"_osClaimId\":\"de2a0593-e24e-4f2a-a519-386b848d20a9\"}],\"osid\":\"1-c86017c8-1638-4ea2-a1eb-cc02371211f1\",\"osOwner\":[\"89fd51a8-e057-4978-a68d-fb6f4eef184d\"],\"email\":\"admin36@mailinator.com\",\"instituteName\":\"te\"}]\n" + "[{\"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" ] } ], @@ -399,7 +386,7 @@ }, { "cell_type": "code", - "execution_count": 107, + "execution_count": 45, "id": "c9c84d59", "metadata": {}, "outputs": [ @@ -407,18 +394,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647346991285,\"params\":{\"resmsgid\":\"\",\"msgid\":\"a75d0236-cf17-498b-a41b-6ee3810c6ad5\",\"err\":\"\",\"status\":\"UNSUCCESSFUL\",\"errmsg\":\"Username already invited / registered for Institute\"},\"responseCode\":\"OK\"}\n" - ] - }, - { - "ename": "AssertionError", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m/var/folders/1c/_2dh0xbx1k9fzwx2pwfhgxrr0000gn/T/ipykernel_31904/3842529591.py\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 14\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 15\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresponse\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtext\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 16\u001b[0;31m \u001b[0;32massert\u001b[0m \u001b[0mresponse\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstatus_code\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m200\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 17\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 18\u001b[0m instituteRequestBody = {\n", - "\u001b[0;31mAssertionError\u001b[0m: " + "{\"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" ] } ], @@ -439,7 +416,7 @@ "\n", "print(response.text)\n", "assert response.status_code == 200\n", - "\n", + "institute1Osid = response.json()[\"result\"][\"Institute\"][\"osid\"]\n", "instituteRequestBody = {\n", " \"instituteName\": \"XYZ\",\n", " \"email\": institute2,\n", @@ -452,12 +429,13 @@ "response = requests.request(\"POST\", baseUrl + \"Institute/invite\", headers=headers, json=instituteRequestBody)\n", "\n", "print(response.text)\n", - "assert response.status_code == 200" + "assert response.status_code == 200\n", + "institute2Osid = response.json()[\"result\"][\"Institute\"][\"osid\"]" ] }, { "cell_type": "code", - "execution_count": 108, + "execution_count": 46, "id": "d3156938", "metadata": {}, "outputs": [ @@ -465,7 +443,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647346998867,\"params\":{\"resmsgid\":\"\",\"msgid\":\"f8a9fb4f-83f4-4cc5-94bf-6fa1ad2f6006\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Teacher\":{\"osid\":\"1-eff29030-00a3-48cf-877f-a13244ed1fc2\"}}}\n" + "{\"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" ] } ], @@ -487,13 +465,13 @@ " },\n", " \"academicQualifications\": [\n", " {\n", - " \"instituteOSID\": \"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\n", + " \"instituteOSID\": institute1Osid,\n", " \"instituteName\": \"ABC\"\n", " }\n", " ],\n", " \"experience\": [\n", " {\n", - " \"instituteOSID\": \"1-a140c49c-3575-471c-9e6c-e079fe920349\",\n", + " \"instituteOSID\": institute2Osid,\n", " \"instituteName\": \"XYZ\"\n", " }\n", " ]\n", @@ -511,7 +489,7 @@ }, { "cell_type": "code", - "execution_count": 109, + "execution_count": 47, "id": "d9bf7bc7", "metadata": {}, "outputs": [ @@ -519,7 +497,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtRTZ0WlFxSWctWHhGaVJPR21ERXZOb2ctR2Y4RklkNkNTaEJqMVQ2Qkc0In0.eyJleHAiOjE2NDczNDc2MDAsImlhdCI6MTY0NzM0NzAwMCwianRpIjoiNmM1ZjgxZGQtMTljOS00OWQ2LTk2OWUtMjA3OTc4Mjk2MDNlIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI0ZmJlODAwNS0xNjdkLTQyOTYtODdjMS0wNTNmN2ViN2I5ZTciLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiIzNWU0NjM0NS1iZTUzLTQzNTUtODlmZi1kNTNmYWEzNDI3MDQiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb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mMyZGRjZTciLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0NyIsImVudGl0eSI6WyJUZWFjaGVyIl0sImVtYWlsIjoidDdAZy5jb20ifQ.Q88oGgCi3Q-nrxpshJVuOB0E-j7ZNk5FvUsmQzfIKeo10de4O7f7XX3fBIjve-Cp_9wpzlrmsFOecFJYMsF19Ms6B-s50A6oVHjcWzrmuaQhamMx0t6QgT7S7ojVMNEVjhRVfCSMCKis0zNSs7-KQ8ixAyX9BkjMA3A8ZX-VFXPQvEoBkHh-er9gqoTZwn1XNdyJZhb2kp0XLDVD-id_70M1saB1F5YUmZYDVsvllwghjKwihvRtzJmBWIeKPJ4tJZ4XmwdUuaZltwPxgEDc95cjm0bCIceOEZF1IrDOdIwV0ayzx_eukNsIdI-c7KqSWkatx__GFntF51xKfxmASA\n" ] } ], @@ -530,7 +508,7 @@ }, { "cell_type": "code", - "execution_count": 110, + "execution_count": 48, "id": "aeabd00a", "metadata": {}, "outputs": [ @@ -538,9 +516,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "[{\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-ad81ff95-eb57-4b90-998c-5306a3251b7d\",\"instituteName\":\"ABC\"}],\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"contactDetails\":{\"osid\":\"1-ac11307d-18eb-413c-9670-18a45a7da924\",\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"mobile\":\"t7\",\"osCreatedBy\":\"\",\"email\":\"t7@g.com\"},\"osCreatedBy\":\"\",\"experience\":[{\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"osid\":\"1-0e225961-c800-4096-afc4-bdedbb9cbdda\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}],\"osid\":\"1-eff29030-00a3-48cf-877f-a13244ed1fc2\",\"osOwner\":[\"4fbe8005-167d-4296-87c1-053f7eb7b9e7\"],\"identityDetails\":{\"osid\":\"1-e9d59f1c-b4d1-4f68-9cd6-c9ae83347a4a\",\"identityHolder\":{\"osid\":\"1-90bfecd1-85b4-4605-ab6d-55e31c4245a9\",\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"AADHAAR\":\"123412323\"},\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"gender\":\"Male\",\"osUpdatedBy\":\"\",\"dob\":\"1995-10-28\",\"osCreatedBy\":\"\",\"fullName\":\"teacher1\"}}]\n", - "1-0e225961-c800-4096-afc4-bdedbb9cbdda\n", - "1-ad81ff95-eb57-4b90-998c-5306a3251b7d\n" + "[{\"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" ] } ], @@ -580,7 +558,7 @@ }, { "cell_type": "code", - "execution_count": 111, + "execution_count": 49, "id": "5befaa8f", "metadata": {}, "outputs": [ @@ -589,7 +567,7 @@ "output_type": "stream", "text": [ "200\n", - "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647347006133, 'params': {'resmsgid': '', 'msgid': '4ee5a6e3-da2e-4731-b86d-0d2d0c2a4f61', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-be25e98c-a731-4c47-803b-32734442a389'}}\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" ] } ], @@ -618,7 +596,7 @@ }, { "cell_type": "code", - "execution_count": 112, + "execution_count": 50, "id": "5a219b6b", "metadata": {}, "outputs": [ @@ -626,8 +604,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtRTZ0WlFxSWctWHhGaVJPR21ER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dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ4eXoxQG1haWxpbmF0b3IuY29tIiwiZW50aXR5IjpbIkluc3RpdHV0ZSJdLCJlbWFpbCI6Inh5ejFAbWFpbGluYXRvci5jb20ifQ.UEl3c9Ua64oxfOqcsNnuOqmHX3SPK23NFffr83cuy-YYHk6uL7nM_y4LdxyIbkGGPCSvjjvJrEunT7nv7niz8EsPYLDzNrjM565OMBx4yBr4VvlwwpycLGr7xKAf3rkS2eDDPZP3FFFQhK1sGUZpTd-nhpd5-DlFtGbZwO3EGHVDuAmTFkgalwsbtmHEFDzodKmvqsaK1HfyXm7MrX8Ga6W1mgLVI4Xt78tAJLNApTTBPcVp70dE5iD2VD9kkjBiIzcUOcuxGO_XcZo1g299TziICC1vQIritRTu2LX4-0ZPLPfMe4UppDpO0Euf-l-oa0W_fCnSRqXA18S5JhzJOA\n" ] } ], @@ -641,7 +619,7 @@ }, { "cell_type": "code", - "execution_count": 113, + "execution_count": 51, "id": "e07d0934", "metadata": {}, "outputs": [ @@ -650,12 +628,11 @@ "output_type": "stream", "text": [ "\n", - "[{'id': '8950419f-ef1a-4ebe-9ee5-6d77a4d0b2b3', 'entity': 'Teacher', 'entityId': '1-73d6607f-8158-42c6-8702-e9aca997e29d', 'propertyURI': '', 'createdAt': '2022-03-15T11:38:24.123+00:00', 'attestedOn': '2022-03-15T11:43:18.891+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.osid#.contains('1-a140c49c-3575-471c-9e6c-e079fe920349'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"experience\":[{\"osUpdatedAt\":\"2022-03-15T11:37:41.053052Z\",\"osCreatedAt\":\"2022-03-15T11:37:41.053052Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"osid\":\"1-3223d019-865d-433f-8e1c-7e72b66ff62d\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}]}', 'attestationId': '1-0d91ad9d-82ce-4702-8362-e7a31bf761de', 'attestationName': 'teacherExperience', 'closed': True}, {'id': '1060c8ae-9428-4f75-89b7-2da3fcc0ee62', 'entity': 'Teacher', 'entityId': '1-eff29030-00a3-48cf-877f-a13244ed1fc2', 'propertyURI': '', 'createdAt': '2022-03-15T12:23:26.640+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.osid#.contains('1-a140c49c-3575-471c-9e6c-e079fe920349'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"experience\":[{\"osUpdatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"osid\":\"1-0e225961-c800-4096-afc4-bdedbb9cbdda\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}]}', 'attestationId': '1-be25e98c-a731-4c47-803b-32734442a389', 'attestationName': 'teacherExperience', 'closed': False}]\n", - "CLOSED\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", - "1060c8ae-9428-4f75-89b7-2da3fcc0ee62\n", + "010e75d5-43f8-4efe-aaa5-f3d4e8850610\n", "\n", - "{'resmsgid': '', 'msgid': '7f806382-b532-47b1-b80f-97783ccfcb10', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}\n" + "{'resmsgid': '', 'msgid': '77c298ac-0bf5-456e-82e8-8457862e6030', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}\n" ] } ], @@ -692,7 +669,7 @@ }, { "cell_type": "code", - "execution_count": 114, + "execution_count": 52, "id": "3988dd39", "metadata": {}, "outputs": [], @@ -715,7 +692,7 @@ }, { "cell_type": "code", - "execution_count": 115, + "execution_count": 53, "id": "610427a1", "metadata": {}, "outputs": [ @@ -724,7 +701,7 @@ "output_type": "stream", "text": [ "200\n", - "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647347020325, 'params': {'resmsgid': '', 'msgid': '78400fec-8639-40f3-8389-3f9cf5b22a49', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-884812fd-e8e9-4cda-b414-1f7dfce4d285'}}\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" ] } ], @@ -754,7 +731,7 @@ }, { "cell_type": "code", - "execution_count": 116, + "execution_count": 54, "id": "2f551799", "metadata": {}, "outputs": [ @@ -762,16 +739,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtRTZ0WlFxSWctWHhGaVJPR21ERXZOb2ctR2Y4RklkNkNTaEJqMVQ2Qkc0In0.eyJleHAiOjE2NDczNDc2MjQsImlhdCI6MTY0NzM0NzAyNCwianRpIjoiMzQ5Mzk5YWItZjkxNi00YWNjLWIyZmUtOGQyOWI5MGZkOWY2IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJhNDM3ZDQwMi1lNWFiLTQ3M2QtYWZjZi04MDZhMDBjNjY1MzIiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiI0ZWM1Y2NkMC02NDQxLTRjYzctYmZiOS05MTE2YjE2ZjlkMzYiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iLCJkZWZhdWx0LXJvbGVzLW5kZWFyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2Ut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n", - "[{'id': '66837410-de73-4170-8641-8e795b6d71a1', 'entity': 'Teacher', 'entityId': '1-73d6607f-8158-42c6-8702-e9aca997e29d', 'propertyURI': '', 'createdAt': '2022-03-15T11:45:51.402+00:00', 'attestedOn': '2022-03-15T11:46:05.985+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.osid#.contains('1-0e343abd-c710-45a3-a240-e5d8f30ae2d2'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T11:43:23.385636Z\",\"osCreatedAt\":\"2022-03-15T11:37:41.053052Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-9dd172c4-d053-4ec4-8b96-58b4badbf4ba\",\"instituteName\":\"ABC\"}]}', 'attestationId': '1-0c86bf64-1f77-4e2d-aa40-7033dc9c9153', 'attestationName': 'teacherAcademicsQualification', 'closed': True}, {'id': '77aa7b9a-ca0b-4b6a-9e9b-8b8186293a7e', 'entity': 'Teacher', 'entityId': '1-73d6607f-8158-42c6-8702-e9aca997e29d', 'propertyURI': '', 'createdAt': '2022-03-15T12:18:16.948+00:00', 'attestedOn': '2022-03-15T12:18:17.214+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.osid#.contains('1-0e343abd-c710-45a3-a240-e5d8f30ae2d2'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T11:46:12.952025Z\",\"osCreatedAt\":\"2022-03-15T11:37:41.053052Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-9dd172c4-d053-4ec4-8b96-58b4badbf4ba\",\"instituteName\":\"ABC\"}]}', 'attestationId': '1-34a9d265-c4ca-4501-88bf-6650ad93ab14', 'attestationName': 'teacherAcademicsQualification', 'closed': True}, {'id': '064848e3-d1ef-4f15-87d7-e1aec9997399', 'entity': 'Teacher', 'entityId': '1-73d6607f-8158-42c6-8702-e9aca997e29d', 'propertyURI': '', 'createdAt': '2022-03-15T12:20:17.479+00:00', 'attestedOn': '2022-03-15T12:20:22.357+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.osid#.contains('1-0e343abd-c710-45a3-a240-e5d8f30ae2d2'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T12:18:17.492222Z\",\"osCreatedAt\":\"2022-03-15T11:37:41.053052Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-9dd172c4-d053-4ec4-8b96-58b4badbf4ba\",\"instituteName\":\"ABC\"}]}', 'attestationId': '1-f3dacf9e-1e83-4e3b-ba11-70942d4402fe', 'attestationName': 'teacherAcademicsQualification', 'closed': True}, {'id': '3e8c5a86-8ed2-46fb-bc6a-0b8b5ae55307', 'entity': 'Teacher', 'entityId': '1-eff29030-00a3-48cf-877f-a13244ed1fc2', 'propertyURI': '', 'createdAt': '2022-03-15T12:23:40.904+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.osid#.contains('1-0e343abd-c710-45a3-a240-e5d8f30ae2d2'))\", 'attestorEntity': 'Institute', 'requestorName': None, 'propertyData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T12:23:29.170474Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-ad81ff95-eb57-4b90-998c-5306a3251b7d\",\"instituteName\":\"ABC\"}]}', 'attestationId': '1-884812fd-e8e9-4cda-b414-1f7dfce4d285', 'attestationName': 'teacherAcademicsQualification', 'closed': False}]\n", - "CLOSED\n", - "CLOSED\n", - "CLOSED\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", - "3e8c5a86-8ed2-46fb-bc6a-0b8b5ae55307\n", + "a2d1a775-2ab5-4a8a-af7b-ca52017d4f79\n", "\n", - "{'resmsgid': '', 'msgid': 'a1cbfadd-d89b-460c-9ee1-231f6c463c96', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}\n" + "{'resmsgid': '', 'msgid': '17dd8c4d-1935-4cee-8295-db9c85a3d902', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}\n" ] } ], @@ -813,7 +787,7 @@ }, { "cell_type": "code", - "execution_count": 117, + "execution_count": 55, "id": "1d5abf7e", "metadata": {}, "outputs": [ @@ -821,7 +795,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'osUpdatedAt': '2022-03-15T12:23:44.788292Z', 'osUpdatedBy': '', '_osState': 'PUBLISHED', 'entityId': '1-eff29030-00a3-48cf-877f-a13244ed1fc2', 'osid': '1-884812fd-e8e9-4cda-b414-1f7dfce4d285', 'propertiesOSID': {'osid': '1-7c8b2cfd-a567-4716-90b7-2493fe648a8c', 'osUpdatedAt': '2022-03-15T12:23:40.550652Z', 'academicQualifications': ['1-ad81ff95-eb57-4b90-998c-5306a3251b7d'], 'osUpdatedBy': '4fbe8005-167d-4296-87c1-053f7eb7b9e7'}, 'propertyData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T12:23:29.170474Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-ad81ff95-eb57-4b90-998c-5306a3251b7d\",\"instituteName\":\"ABC\"}]}', 'entityName': 'Teacher', 'name': 'teacherAcademicsQualification', '_osAttestedData': '{\"academicQualifications\":[{\"osUpdatedAt\":\"2022-03-15T12:23:29.170474Z\",\"osCreatedAt\":\"2022-03-15T12:23:18.989017Z\",\"osUpdatedBy\":\"\",\"osCreatedBy\":\"\",\"instituteOSID\":\"1-0e343abd-c710-45a3-a240-e5d8f30ae2d2\",\"osid\":\"1-ad81ff95-eb57-4b90-998c-5306a3251b7d\",\"instituteName\":\"ABC\"}]}', '_osClaimId': '3e8c5a86-8ed2-46fb-bc6a-0b8b5ae55307'}\n" + "{'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" ] } ], @@ -854,7 +828,7 @@ }, { "cell_type": "code", - "execution_count": 150, + "execution_count": 56, "id": "ec61edde", "metadata": {}, "outputs": [ @@ -862,7 +836,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647350487384,\"params\":{\"resmsgid\":\"\",\"msgid\":\"7bb40e51-f057-4662-baa1-1c2a521d0b75\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Student\":{\"osid\":\"1-d77f3eba-16ba-4aff-bde5-5eda1cda32db\"}}}\n" + "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647406979002,\"params\":{\"resmsgid\":\"\",\"msgid\":\"856d972d-9e20-452b-ab40-ab57b2a095a7\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Student\":{\"osid\":\"1-45824dc9-805d-4b8d-9c45-31d7df111ecd\"}}}\n" ] } ], @@ -884,7 +858,7 @@ " },\n", " \"educationDetails\": [\n", " {\n", - " \"instituteOSID\": \"1-a140c49c-3575-471c-9e6c-e079fe920349\",\n", + " \"instituteOSID\": institute2Osid,\n", " \"instituteName\": \"XYZ\"\n", " }\n", " ]\n", @@ -902,7 +876,7 @@ }, { "cell_type": "code", - "execution_count": 151, + "execution_count": 57, "id": "3c4d8483", "metadata": {}, "outputs": [ @@ -910,7 +884,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtRTZ0WlFxSWctWHhGaVJPR21ERXZOb2ctR2Y4RklkNkNTaEJqMVQ2Qkc0In0.eyJleHAiOjE2NDczNTEwODgsImlhdCI6MTY0NzM1MDQ4OCwianRpIjoiNzM4YTdlMzktZTk1Yy00ZjQ0LWIxODYtMDg1ODJhNTljOWZjIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI3YjNiODYzMy1kNDhhLTRiOWQtOGZiYi1hYjk2ZDdlNGQxOWUiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiIxYjA0YTU5MC1mMGE3LTQ0MmEtODdlNS00N2ZmZTg4ZWUwZTIiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fYWNjZXNzIjp7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yO_1Fac-H2tWK2qF2WTouwqaUxC-muCld_ZWeoxYRdsBP287dDuCxl_UR0m-awJFZuwIyic6QYw\n" ] } ], @@ -921,7 +895,7 @@ }, { "cell_type": "code", - "execution_count": 152, + "execution_count": 58, "id": "fa0768fa", "metadata": {}, "outputs": [ @@ -929,8 +903,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "[{\"educationDetails\":[{\"osid\":\"1-914fdd90-0cf1-477b-ae5e-f1c9a1545667\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}],\"contactDetails\":{\"osid\":\"1-f3768c65-c6bd-4d22-9440-f328b47ce8ef\",\"mobile\":\"s4\",\"email\":\"s4@g.com\"},\"osid\":\"1-d77f3eba-16ba-4aff-bde5-5eda1cda32db\",\"osOwner\":[\"7b3b8633-d48a-4b9d-8fbb-ab96d7e4d19e\"],\"identityDetails\":{\"osid\":\"1-6985aa68-0785-4b6d-be0d-5cfa0210d7c6\",\"identityHolder\":{\"osid\":\"1-a3695ffe-2170-4510-956c-ba1f643c61bf\",\"AADHAAR\":\"123412323\"},\"gender\":\"Male\",\"dob\":\"1995-10-28\",\"fullName\":\"student1\"}}]\n", - "1-914fdd90-0cf1-477b-ae5e-f1c9a1545667\n" + "[{\"educationDetails\":[{\"osid\":\"1-fb160cbb-ed22-40e6-96ab-74200520262c\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}],\"contactDetails\":{\"osid\":\"1-38758ed7-9290-462d-b659-b2d22576613c\",\"mobile\":\"s4\",\"email\":\"s4@g.com\"},\"osid\":\"1-45824dc9-805d-4b8d-9c45-31d7df111ecd\",\"identityDetails\":{\"osid\":\"1-e098bc91-984d-4afb-9dfd-fae98335a5c7\",\"identityHolder\":{\"osid\":\"1-c2caed92-de38-47e2-b016-fdaa0fe36856\",\"AADHAAR\":\"123412323\"},\"gender\":\"Male\",\"dob\":\"1995-10-28\",\"fullName\":\"student1\"},\"osOwner\":[\"d22c5e82-0af7-4f23-84cd-4b487d5728f6\"]}]\n", + "1-fb160cbb-ed22-40e6-96ab-74200520262c\n" ] } ], @@ -959,7 +933,7 @@ }, { "cell_type": "code", - "execution_count": 153, + "execution_count": 59, "id": "103655ed", "metadata": {}, "outputs": [ @@ -968,7 +942,7 @@ "output_type": "stream", "text": [ "200\n", - "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647350493478, 'params': {'resmsgid': '', 'msgid': '7a27f91f-741e-40a8-b50e-c6aec1310466', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-b8095c70-b406-471a-b22d-8356e71c686c'}}\n" + "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647406983591, 'params': {'resmsgid': '', 'msgid': '58008a31-87c9-425f-9886-1a47516b4365', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-da2da28a-1c12-48ff-bef9-70f5685aadcc'}}\n" ] } ], @@ -997,7 +971,7 @@ }, { "cell_type": "code", - "execution_count": 154, + "execution_count": 60, "id": "8e71173c", "metadata": {}, "outputs": [ @@ -1005,14 +979,20 @@ "name": "stdout", "output_type": "stream", "text": [ - "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtRTZ0WlFxSWctWHhGaVJPR21ERXZOb2ctR2Y4RklkNkNTaEJqMVQ2Qkc0In0.eyJleHAiOjE2NDczNTEwOTYsImlhdCI6MTY0NzM1MDQ5NiwianRpIjoiYTBlZjQxMDItMTNkYy00ZTZkLThiNTAtNzNiOTJjYmYzYmY0IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI0ZmJlODAwNS0xNjdkLTQyOTYtODdjMS0wNTNmN2ViN2I5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WxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0NyIsImVudGl0eSI6WyJUZWFjaGVyIl0sImVtYWlsIjoidDdAZy5jb20ifQ.BAtmr-mq0eJQisrORrMK27AHM7Sdi5gzqSZBZRkVkUvRuHkjfzz2JDkKtHOzk-qZMKkYzXJofvtqEc91KlYDms2rBYd0QzP5d01hNIOKw1jvi3YNfPc84jEI-zMZLbPcvnVk4dwJVN4olPWQOXM6sillVnJjQSk-ivuxjO4JbkwYWTiw6STk1DlLw1eZ5spP8pxAn29pvL-kK4dpHFO3CATexmUn2uoHQ2al4FShfK4VwxWp4Zda08R6maYxq6hd53dSaQjAogzm-6AHa6crCDjriJ9OSF3UAEAJ7lal-ftJz1Cmo4iWMPoMb9NFL6mdwchUCcHNYNuPD2osJoanAA\n", "\n", - "[{'id': 'c3d65257-0e52-4a9d-a19b-164a449c9d97', 'entity': 'Student', 'entityId': '1-5a873d39-f2dc-435a-8882-2c0621531780', 'propertyURI': '', 'createdAt': '2022-03-15T13:16:52.062+00:00', 'attestedOn': '2022-03-15T13:17:13.339+00:00', 'status': 'CLOSED', 'conditions': \"(ATTESTOR#$.experience.[*].instituteOSID#.contains('1-a140c49c-3575-471c-9e6c-e079fe920349'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'propertyData': '{\"name\":\"student1\",\"educationDetails\":[{\"osid\":\"1-f739247d-4b1a-4672-8f11-227ef0d50039\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}]}', 'attestationId': '1-63857c03-5a23-4321-8df1-9ee8e6447465', 'attestationName': 'studentInstituteAttest', 'closed': True}, {'id': '9aed418a-b45a-4c3f-840e-9da4ebddf613', 'entity': 'Student', 'entityId': '1-d77f3eba-16ba-4aff-bde5-5eda1cda32db', 'propertyURI': '', 'createdAt': '2022-03-15T13:21:33.877+00:00', 'attestedOn': None, 'status': 'OPEN', 'conditions': \"(ATTESTOR#$.experience.[*].instituteOSID#.contains('1-a140c49c-3575-471c-9e6c-e079fe920349'))\", 'attestorEntity': 'Teacher', 'requestorName': None, 'propertyData': '{\"name\":\"student1\",\"educationDetails\":[{\"osid\":\"1-914fdd90-0cf1-477b-ae5e-f1c9a1545667\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}]}', 'attestationId': '1-b8095c70-b406-471a-b22d-8356e71c686c', 'attestationName': 'studentInstituteAttest', 'closed': False}]\n", - "CLOSED\n", - "OPEN\n", - "9aed418a-b45a-4c3f-840e-9da4ebddf613\n", - "\n", - "{'resmsgid': '', 'msgid': '2af07e8b-8d60-400a-889c-4183722f9a1e', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}\n" + "[]\n" + ] + }, + { + "ename": "AssertionError", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m/var/folders/1c/_2dh0xbx1k9fzwx2pwfhgxrr0000gn/T/ipykernel_6682/536857491.py\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 30\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mattestResp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjson\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 31\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 32\u001b[0;31m \u001b[0;32massert\u001b[0m \u001b[0mattestingClaimId\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mAssertionError\u001b[0m: " ] } ], diff --git a/imports/realm-export.json b/imports/realm-export.json index 65655d8..d3e85ff 100644 --- a/imports/realm-export.json +++ b/imports/realm-export.json @@ -465,7 +465,9 @@ "name": "board-cbse", "path": "/board-cbse", "attributes": {}, - "realmRoles": [], + "realmRoles": [ + "board-cbse" + ], "clientRoles": {}, "subGroups": [] }, @@ -640,6 +642,17 @@ ], "notBefore": 0, "groups": [] + }, + { + "username": "cbse-admin", + "enabled": true, + "credentials": [ + { + "type": "password", + "value": "abcd@123" + } + ], + "groups": ["board-cbse"] } ], "scopeMappings": [ @@ -766,14 +779,14 @@ "enabled": true, "alwaysDisplayInConsole": false, "clientAuthenticatorType": "client-secret", - "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/*", - "https://oauth.pstmn.io/v1/callback", - "http://ndear.xiv.in/*" + "http://ndear.xiv.in/*", + "https://oauth.pstmn.io/v1/callback" ], "webOrigins": [ "https://localhost:4202/*", @@ -815,8 +828,8 @@ "saml.onetimeuse.condition": "false" }, "authenticationFlowBindingOverrides": { - "direct_grant": "26526ac7-6139-40de-8a4b-84a56692a474", - "browser": "c7d2defc-aebe-463f-95f5-a18dd698285d" + "direct_grant": "575f3da5-2c05-40cf-a859-609507918ca3", + "browser": "9c46c7d1-2884-4e1b-ae42-cd9a81f2f867" }, "fullScopeAllowed": true, "nodeReRegistrationTimeout": -1, @@ -1153,8 +1166,8 @@ "protocol": "openid-connect", "attributes": { "access.token.lifespan": "86400", - "saml.multivalued.roles": "false", "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", @@ -1162,14 +1175,14 @@ "oidc.ciba.grant.enabled": "false", "backchannel.logout.session.required": "true", "client_credentials.use_refresh_token": "false", - "consent.screen.text": "Additional information will help in giving better experience", "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", - "saml.assertion.signature": "false", "id.token.as.detached.signature": "false", + "saml.assertion.signature": "false", "saml.encrypt": "false", "login_theme": "ndear", "saml.server.signature": "false", @@ -1300,16 +1313,16 @@ "frontchannelLogout": false, "protocol": "openid-connect", "attributes": { - "saml.assertion.signature": "false", "id.token.as.detached.signature": "false", + "saml.assertion.signature": "false", "access.token.lifespan": "86400", - "saml.multivalued.roles": "false", "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", "saml.encrypt": "false", "login_theme": "ndear", "oauth2.device.authorization.grant.enabled": "false", - "saml.server.signature": "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", @@ -1445,14 +1458,14 @@ "frontchannelLogout": false, "protocol": "openid-connect", "attributes": { - "saml.assertion.signature": "false", "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", - "saml.server.signature": "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", @@ -2089,14 +2102,14 @@ "subComponents": {}, "config": { "allowed-protocol-mapper-types": [ + "oidc-address-mapper", + "oidc-sha256-pairwise-sub-mapper", + "oidc-usermodel-property-mapper", "saml-role-list-mapper", - "oidc-usermodel-attribute-mapper", + "oidc-full-name-mapper", "saml-user-property-mapper", - "oidc-usermodel-property-mapper", - "oidc-address-mapper", "saml-user-attribute-mapper", - "oidc-full-name-mapper", - "oidc-sha256-pairwise-sub-mapper" + "oidc-usermodel-attribute-mapper" ] } }, @@ -2167,12 +2180,12 @@ "subComponents": {}, "config": { "allowed-protocol-mapper-types": [ - "oidc-address-mapper", - "saml-user-property-mapper", - "oidc-sha256-pairwise-sub-mapper", "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" ] @@ -2232,7 +2245,7 @@ ], "authenticationFlows": [ { - "id": "0ab74575-c2f2-4eb4-a47a-06593591f634", + "id": "c33707ed-80f7-4b0d-bb65-bd51c832724f", "alias": "Account verification options", "description": "Method with which to verity the existing account", "providerId": "basic-flow", @@ -2258,7 +2271,7 @@ ] }, { - "id": "2d4a7e37-27a0-4011-9e69-48c97d0ffb66", + "id": "56466478-2ece-4d15-be94-45db9b927223", "alias": "Authentication Options", "description": "Authentication options.", "providerId": "basic-flow", @@ -2292,7 +2305,7 @@ ] }, { - "id": "cbc1adc7-e24e-4091-bcfa-56837ee331b3", + "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", @@ -2318,7 +2331,7 @@ ] }, { - "id": "f3900b3d-0495-484e-87a0-d340b921ed2d", + "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", @@ -2344,7 +2357,7 @@ ] }, { - "id": "c903ba49-d1bf-469b-b251-df18607d7cea", + "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", @@ -2370,7 +2383,7 @@ ] }, { - "id": "f6821ccf-6173-422e-acfe-daf793a6a7f5", + "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", @@ -2396,7 +2409,7 @@ ] }, { - "id": "db722948-38c7-44df-8855-22e63530c5b7", + "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", @@ -2422,7 +2435,7 @@ ] }, { - "id": "82428cc8-feb0-47af-afee-8dbd49f21e78", + "id": "48af41a5-8fe2-472a-ab43-f66d891a1d27", "alias": "User creation or linking", "description": "Flow for the existing/non-existing user alternatives", "providerId": "basic-flow", @@ -2449,7 +2462,7 @@ ] }, { - "id": "e6e7205e-f8ab-4b01-9653-81915269ecce", + "id": "3d091355-f493-474f-b6d6-4421f37ee90b", "alias": "Verify Existing Account by Re-authentication", "description": "Reauthentication of existing account", "providerId": "basic-flow", @@ -2475,7 +2488,7 @@ ] }, { - "id": "c7d2defc-aebe-463f-95f5-a18dd698285d", + "id": "9c46c7d1-2884-4e1b-ae42-cd9a81f2f867", "alias": "browser", "description": "browser based authentication", "providerId": "basic-flow", @@ -2517,7 +2530,7 @@ ] }, { - "id": "f2a2747d-ed5f-4489-bbb7-5f7a6028b306", + "id": "61387790-a480-417d-b84d-3acb5d465400", "alias": "clients", "description": "Base authentication for clients", "providerId": "client-flow", @@ -2559,7 +2572,7 @@ ] }, { - "id": "26526ac7-6139-40de-8a4b-84a56692a474", + "id": "575f3da5-2c05-40cf-a859-609507918ca3", "alias": "direct grant", "description": "OpenID Connect Resource Owner Grant", "providerId": "basic-flow", @@ -2593,7 +2606,7 @@ ] }, { - "id": "4d512dcb-80a8-40ad-b68b-60d0e932d25e", + "id": "416588ed-32ad-49eb-8848-ec69d84d8e8e", "alias": "docker auth", "description": "Used by Docker clients to authenticate against the IDP", "providerId": "basic-flow", @@ -2611,7 +2624,7 @@ ] }, { - "id": "749b512f-9f43-446a-a951-72e4207bb107", + "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", @@ -2638,7 +2651,7 @@ ] }, { - "id": "09cbc2f5-050e-4a93-b40f-7489e43d0850", + "id": "3d4ca5bd-8fea-41b8-a72a-9ad22b4ce44d", "alias": "forms", "description": "Username, password, otp and other auth forms.", "providerId": "basic-flow", @@ -2664,7 +2677,7 @@ ] }, { - "id": "7831c6d0-f46f-489e-944c-8e3b23733345", + "id": "79023637-6c0f-44bd-a636-e02e7e043fd2", "alias": "http challenge", "description": "An authentication flow based on challenge-response HTTP Authentication Schemes", "providerId": "basic-flow", @@ -2690,7 +2703,7 @@ ] }, { - "id": "d8950fad-3c86-443f-a475-f06225af749e", + "id": "e0932a41-41a2-49d1-ab1d-d804cf0318d2", "alias": "mobile login", "description": "browser based authentication", "providerId": "basic-flow", @@ -2740,7 +2753,7 @@ ] }, { - "id": "8a71acbd-1771-4a44-b615-12429028d86a", + "id": "d747f766-f314-40b8-ad79-7ff9b45ee8de", "alias": "mobile login forms", "description": "Username, password, otp and other auth forms.", "providerId": "basic-flow", @@ -2758,7 +2771,7 @@ ] }, { - "id": "13b66a32-c3d8-43f1-8ba5-287b978f3050", + "id": "839f3012-68ff-467c-8d8e-3121182d54ff", "alias": "registration", "description": "registration flow", "providerId": "basic-flow", @@ -2777,7 +2790,7 @@ ] }, { - "id": "d3695198-d866-46eb-a4a6-c053987a5505", + "id": "5ad88eca-a962-4d73-82c7-5452db1c19fa", "alias": "registration form", "description": "registration form", "providerId": "form-flow", @@ -2819,7 +2832,7 @@ ] }, { - "id": "7784ee5f-3379-4f89-ac74-38b4f4880eac", + "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", @@ -2861,7 +2874,7 @@ ] }, { - "id": "e5c57bc0-53c4-4b6a-ab76-f82acf64d118", + "id": "c3f7d38d-23bf-41f4-b1d3-fc80c9c0cc7b", "alias": "saml ecp", "description": "SAML ECP Profile Authentication Flow", "providerId": "basic-flow", @@ -2881,14 +2894,14 @@ ], "authenticatorConfig": [ { - "id": "61def636-cc77-4ce2-af3b-07c71510e4e4", + "id": "536b60b8-0432-4afb-96bf-45b3ff9b8269", "alias": "create unique user config", "config": { "require.password.update.after.registration": "false" } }, { - "id": "48aa1005-d4a6-4f89-af58-a7b8effd66c5", + "id": "1426074c-5c56-49f2-928f-d464b94e4d01", "alias": "review profile config", "config": { "update.profile.on.first.login": "missing" From ef20d1fedac3535f418d407483951a0153b0ae1d Mon Sep 17 00:00:00 2001 From: Tejash Date: Wed, 16 Mar 2022 10:37:52 +0530 Subject: [PATCH 07/11] - fixed api notebook --- edu-attestation-flows.ipynb | 45 ++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/edu-attestation-flows.ipynb b/edu-attestation-flows.ipynb index e475a8b..27f5b56 100644 --- a/edu-attestation-flows.ipynb +++ b/edu-attestation-flows.ipynb @@ -828,7 +828,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 61, "id": "ec61edde", "metadata": {}, "outputs": [ @@ -836,13 +836,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "{\"id\":\"sunbird-rc.registry.invite\",\"ver\":\"1.0\",\"ets\":1647406979002,\"params\":{\"resmsgid\":\"\",\"msgid\":\"856d972d-9e20-452b-ab40-ab57b2a095a7\",\"err\":\"\",\"status\":\"SUCCESSFUL\",\"errmsg\":\"\"},\"responseCode\":\"OK\",\"result\":{\"Student\":{\"osid\":\"1-45824dc9-805d-4b8d-9c45-31d7df111ecd\"}}}\n" + "{\"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 = \"s4\"\n", + "studentUserId = \"s5\"\n", "studentRequestBody = {\n", " \"identityDetails\": {\n", " \"fullName\": \"student1\",\n", @@ -876,7 +876,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 62, "id": "3c4d8483", "metadata": {}, "outputs": [ @@ -884,7 +884,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGRVZ0dExTTDdYMU9pOE5BcmcxU25tN1lRZWVSODc4N3dwTDdwdzJJeE9NIn0.eyJleHAiOjE2NDc0MDc1ODEsImlhdCI6MTY0NzQwNjk4MSwianRpIjoiYWExYTFlZjgtZTQ2Mi00M2JkLWI5NDEtMDE5YTM0YTQwYTBmIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJkMjJjNWU4Mi0wYWY3LTRmMjMtODRjZC00YjQ4N2Q1NzI4ZjYiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJyZWdpc3RyeS1mcm9udGVuZCIsInNlc3Npb25fc3RhdGUiOiI2YTcxYTgwNS1kZjU2LTQwYzEtYTI3Mi04MjcxM2Y4ZTVkMTUiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwOi8vbG9jYWxob3N0OjQyMDIiLCJodHRwczovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cHM6Ly9uZGVhci54aXYuaW4iLCJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJodHRwOi8vbmRlYXIueGl2LmluIiwiaHR0cDovLzIwLjE5OC42NC4xMjgiXSwicmVhbG1fY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Xl0loyNfMqOIY8XjRjwDsNWqGrrPP8RqbMPWXTE3akk54YH8Wo6TXrKbS_pmopCIBpI7nZIg\n" ] } ], @@ -895,7 +895,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 63, "id": "fa0768fa", "metadata": {}, "outputs": [ @@ -903,8 +903,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "[{\"educationDetails\":[{\"osid\":\"1-fb160cbb-ed22-40e6-96ab-74200520262c\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}],\"contactDetails\":{\"osid\":\"1-38758ed7-9290-462d-b659-b2d22576613c\",\"mobile\":\"s4\",\"email\":\"s4@g.com\"},\"osid\":\"1-45824dc9-805d-4b8d-9c45-31d7df111ecd\",\"identityDetails\":{\"osid\":\"1-e098bc91-984d-4afb-9dfd-fae98335a5c7\",\"identityHolder\":{\"osid\":\"1-c2caed92-de38-47e2-b016-fdaa0fe36856\",\"AADHAAR\":\"123412323\"},\"gender\":\"Male\",\"dob\":\"1995-10-28\",\"fullName\":\"student1\"},\"osOwner\":[\"d22c5e82-0af7-4f23-84cd-4b487d5728f6\"]}]\n", - "1-fb160cbb-ed22-40e6-96ab-74200520262c\n" + "[{\"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" ] } ], @@ -933,7 +933,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 64, "id": "103655ed", "metadata": {}, "outputs": [ @@ -942,7 +942,7 @@ "output_type": "stream", "text": [ "200\n", - "{'id': 'sunbird-rc.registry.send', 'ver': '1.0', 'ets': 1647406983591, 'params': {'resmsgid': '', 'msgid': '58008a31-87c9-425f-9886-1a47516b4365', 'err': '', 'status': 'SUCCESSFUL', 'errmsg': ''}, 'responseCode': 'OK', 'result': {'attestationOSID': '1-da2da28a-1c12-48ff-bef9-70f5685aadcc'}}\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" ] } ], @@ -971,7 +971,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 65, "id": "8e71173c", "metadata": {}, "outputs": [ @@ -979,20 +979,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGRVZ0dExTTDdYMU9pOE5BcmcxU25tN1lRZWVSODc4N3dwTDdwdzJJeE9NIn0.eyJleHAiOjE2NDc0MDc1ODYsImlhdCI6MTY0NzQwNjk4NiwianRpIjoiZDQwODdlNmUtOThiYi00YjU5LThiZTQtMjI4MjExOGJhZTFlIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrOjgwODAvYXV0aC9yZWFsbXMvc3VuYmlyZC1yYyIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJkOTczZWVjOC0wM2FmLTRkNmUtODVhZC02ZDI3ZWY0ODYxOTkiLCJ0eXAiOiJC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lsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0NyIsImVudGl0eSI6WyJUZWFjaGVyIl0sImVtYWlsIjoidDdAZy5jb20ifQ.oAcuUQrEbxdz4gqE2mSp-9v77xWzAu5EvtY9fZCswjY3KHZi-deQVLdkB977gWqOGxpedT-rHH-rQRojeZubh4tsR5gjuqyH3xXxyIj1Buw26f3mYSrD3aszaBaEkR0pdsg2XNCsBQZjn_3XV3_GzBicRlVa5PMbFmLv95lkePMNLHJJEW8O1xLHa93Ll07VIgSoOpORZuOrY9ectZVDuhG2moe7h1h2spcSkmVAUpR2is_Kf3XicblXFyOUj9VuUzvL-gUPob3izt2iaafDrNKHf8n0qiuGEthi7xHKwbtHT9u3x7hKQNLSSMNipRT0lO99HK5zpdvesdUYw4YotA\n", "\n", - "[]\n" - ] - }, - { - "ename": "AssertionError", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m/var/folders/1c/_2dh0xbx1k9fzwx2pwfhgxrr0000gn/T/ipykernel_6682/536857491.py\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 30\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mattestResp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjson\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 31\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 32\u001b[0;31m \u001b[0;32massert\u001b[0m \u001b[0mattestingClaimId\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[0;31mAssertionError\u001b[0m: " + "[{'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" ] } ], @@ -1033,7 +1026,7 @@ }, { "cell_type": "code", - "execution_count": 155, + "execution_count": 66, "id": "35071076", "metadata": {}, "outputs": [ @@ -1041,7 +1034,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'entityName': 'Student', '_osState': 'PUBLISHED', 'name': 'studentInstituteAttest', 'entityId': '1-d77f3eba-16ba-4aff-bde5-5eda1cda32db', 'osid': '1-b8095c70-b406-471a-b22d-8356e71c686c', '_osAttestedData': '{\"name\":\"student1\",\"educationDetails\":[{\"osid\":\"1-914fdd90-0cf1-477b-ae5e-f1c9a1545667\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}]}', 'propertiesOSID': {'osid': '1-709482b4-2f91-454a-ae22-d5ccd73fe7e1', 'educationDetails': ['1-914fdd90-0cf1-477b-ae5e-f1c9a1545667']}, '_osClaimId': '9aed418a-b45a-4c3f-840e-9da4ebddf613', 'propertyData': '{\"name\":\"student1\",\"educationDetails\":[{\"osid\":\"1-914fdd90-0cf1-477b-ae5e-f1c9a1545667\",\"instituteOSID\":\"1-a140c49c-3575-471c-9e6c-e079fe920349\",\"instituteName\":\"XYZ\"}]}'}\n" + "{'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" ] } ], From 24eb6b5f8f686cc0f9de2ae9e9d18a8a9c7f2916 Mon Sep 17 00:00:00 2001 From: Tejash Date: Tue, 22 Mar 2022 12:05:43 +0530 Subject: [PATCH 08/11] updated institute ownership attributes --- schemas/Institute.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/Institute.json b/schemas/Institute.json index eeefaf8..b561681 100644 --- a/schemas/Institute.json +++ b/schemas/Institute.json @@ -192,7 +192,7 @@ "ownershipAttributes": [ { "email": "/email", - "mobile": "/contactNumber", + "mobile": "/email", "userId": "/email" }, { From 0d1f291de51af938583eed16a25972b17714e0f6 Mon Sep 17 00:00:00 2001 From: Tejash Date: Tue, 22 Mar 2022 12:32:29 +0530 Subject: [PATCH 09/11] updated keycloak cofigs --- docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 42f0933..1f66551 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,7 +39,7 @@ services: - elastic_search_connection_url=es:9200 - search_provider=dev.sunbirdrc.registry.service.ElasticSearchService - sunbird_sso_realm=sunbird-rc - - sunbird_sso_url=http://keycloak:8080/auth + - sunbird_sso_url=https://ndear.xiv.in/auth - sunbird_sso_admin_client_id=admin-api - sunbird_sso_admin_client_secret=d112548e-09b8-411d-a1e0-b5870247affa - sunbird_sso_client_id=registry-frontend @@ -74,6 +74,7 @@ services: - 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"] From edfd12d3b574c0a42d7db03bdd62382579265c56 Mon Sep 17 00:00:00 2001 From: Tejash Date: Tue, 22 Mar 2022 16:14:40 +0530 Subject: [PATCH 10/11] updated cbse admin attributes --- imports/realm-export.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/imports/realm-export.json b/imports/realm-export.json index d3e85ff..7aed1cf 100644 --- a/imports/realm-export.json +++ b/imports/realm-export.json @@ -652,7 +652,18 @@ "value": "abcd@123" } ], - "groups": ["board-cbse"] + "groups": ["board-cbse"], + "attributes": { + "email_id": [ + "cbse-admin" + ], + "mobile_number": [ + "cbse-admin" + ], + "entity": [ + "board-cbse" + ] + } } ], "scopeMappings": [ From 475c7959b46ae27f77cf6f2c0320f44872c2814b Mon Sep 17 00:00:00 2001 From: Tejash Date: Tue, 7 Jun 2022 17:20:16 +0530 Subject: [PATCH 11/11] updated configs --- docker-compose.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1f66551..9eb71af 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres registry: - image: dockerhub/sunbird-rc-core:v0.0.5 + image: dockerhub/sunbird-rc-core:pre-v0.0.8-7 environment: - authentication_enabled=true - signature_enabled=false @@ -37,9 +37,9 @@ 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=https://ndear.xiv.in/auth + - sunbird_sso_url=https://demo-education-registry.xiv.in/auth - sunbird_sso_admin_client_id=admin-api - sunbird_sso_admin_client_secret=d112548e-09b8-411d-a1e0-b5870247affa - sunbird_sso_client_id=registry-frontend @@ -61,10 +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