|
| 1 | +{ |
| 2 | + "openapi": "3.0.3", |
| 3 | + "info": { |
| 4 | + "title": "Instelling Attributes API", |
| 5 | + "version": "1.0.0", |
| 6 | + "description": "API voor het opvragen van attributen op basis van een eduID.\nAuthenticatie gebeurt via HTTP Basic Authentication.\n**Let op:** deze API mag uitsluitend via een beveiligde HTTPS-verbinding worden aangeroepen." |
| 7 | + }, |
| 8 | + "servers": [ |
| 9 | + { |
| 10 | + "url": "https://instelling.tld/api", |
| 11 | + "description": "Productieomgeving (alleen HTTPS toegestaan)" |
| 12 | + } |
| 13 | + ], |
| 14 | + "paths": { |
| 15 | + "/attributes/{eduid}": { |
| 16 | + "get": { |
| 17 | + "summary": "Haal attributen op voor een gebruiker", |
| 18 | + "description": "Retourneert de attributen die gekoppeld zijn aan het opgegeven eduID.\nAlle velden in de response zijn optioneel.\nVereist HTTP Basic Authentication en HTTPS.", |
| 19 | + "parameters": [ |
| 20 | + { |
| 21 | + "name": "eduid", |
| 22 | + "in": "path", |
| 23 | + "required": true, |
| 24 | + "description": "Het eduID van de gebruiker (UUID-formaat).", |
| 25 | + "schema": { |
| 26 | + "type": "string", |
| 27 | + "format": "uuid", |
| 28 | + "example": "0000-1111-2222-3333" |
| 29 | + } |
| 30 | + } |
| 31 | + ], |
| 32 | + "security": [ |
| 33 | + { |
| 34 | + "basicAuth": [] |
| 35 | + } |
| 36 | + ], |
| 37 | + "responses": { |
| 38 | + "200": { |
| 39 | + "description": "Succesvolle respons met attributen (alle velden optioneel).", |
| 40 | + "content": { |
| 41 | + "application/json": { |
| 42 | + "schema": { |
| 43 | + "$ref": "#/components/schemas/UserAttributes" |
| 44 | + } |
| 45 | + } |
| 46 | + } |
| 47 | + }, |
| 48 | + "400": { |
| 49 | + "description": "Ongeldige request, bijvoorbeeld verkeerd UUID-formaat.", |
| 50 | + "content": { |
| 51 | + "application/json": { |
| 52 | + "schema": { |
| 53 | + "$ref": "#/components/schemas/ErrorResponse" |
| 54 | + }, |
| 55 | + "example": { |
| 56 | + "error": "Invalid eduID format" |
| 57 | + } |
| 58 | + } |
| 59 | + } |
| 60 | + }, |
| 61 | + "404": { |
| 62 | + "description": "Gebruiker niet gevonden voor het opgegeven eduID.", |
| 63 | + "content": { |
| 64 | + "application/json": { |
| 65 | + "schema": { |
| 66 | + "$ref": "#/components/schemas/ErrorResponse" |
| 67 | + }, |
| 68 | + "example": { |
| 69 | + "error": "User not found" |
| 70 | + } |
| 71 | + } |
| 72 | + } |
| 73 | + }, |
| 74 | + "401": { |
| 75 | + "description": "Authenticatie vereist of ongeldig.", |
| 76 | + "content": { |
| 77 | + "application/json": { |
| 78 | + "schema": { |
| 79 | + "$ref": "#/components/schemas/ErrorResponse" |
| 80 | + }, |
| 81 | + "example": { |
| 82 | + "error": "Unauthorized" |
| 83 | + } |
| 84 | + } |
| 85 | + } |
| 86 | + }, |
| 87 | + "500": { |
| 88 | + "description": "Interne serverfout.", |
| 89 | + "content": { |
| 90 | + "application/json": { |
| 91 | + "schema": { |
| 92 | + "$ref": "#/components/schemas/ErrorResponse" |
| 93 | + }, |
| 94 | + "example": { |
| 95 | + "error": "Internal server error" |
| 96 | + } |
| 97 | + } |
| 98 | + } |
| 99 | + } |
| 100 | + } |
| 101 | + } |
| 102 | + } |
| 103 | + }, |
| 104 | + "components": { |
| 105 | + "securitySchemes": { |
| 106 | + "basicAuth": { |
| 107 | + "type": "http", |
| 108 | + "scheme": "basic" |
| 109 | + } |
| 110 | + }, |
| 111 | + "schemas": { |
| 112 | + "AttributeArray": { |
| 113 | + "type": "array", |
| 114 | + "items": { |
| 115 | + "type": "string" |
| 116 | + } |
| 117 | + }, |
| 118 | + "UserAttributes": { |
| 119 | + "type": "object", |
| 120 | + "description": "Bevat alle mogelijke attributen van een gebruiker. Alle velden zijn optioneel; afwezigheid betekent dat het attribuut niet bekend is.", |
| 121 | + "properties": { |
| 122 | + "given_name": { |
| 123 | + "$ref": "#/components/schemas/AttributeArray", |
| 124 | + "example": ["John"] |
| 125 | + }, |
| 126 | + "family_name": { |
| 127 | + "$ref": "#/components/schemas/AttributeArray", |
| 128 | + "example": ["Doe"] |
| 129 | + }, |
| 130 | + "name": { |
| 131 | + "$ref": "#/components/schemas/AttributeArray", |
| 132 | + "example": ["Prof.dr. John Doe"] |
| 133 | + }, |
| 134 | + "email": { |
| 135 | + "$ref": "#/components/schemas/AttributeArray", |
| 136 | + |
| 137 | + }, |
| 138 | + "ou": { |
| 139 | + "$ref": "#/components/schemas/AttributeArray", |
| 140 | + "example": ["Faculty of Science"] |
| 141 | + }, |
| 142 | + "schac_home_organization": { |
| 143 | + "$ref": "#/components/schemas/AttributeArray", |
| 144 | + "example": ["university.nl"] |
| 145 | + }, |
| 146 | + "eduperson_scoped_affiliation": { |
| 147 | + "$ref": "#/components/schemas/AttributeArray", |
| 148 | + |
| 149 | + }, |
| 150 | + "uids": { |
| 151 | + "$ref": "#/components/schemas/AttributeArray", |
| 152 | + "example": ["jdoe123"] |
| 153 | + }, |
| 154 | + "schac_personal_unique_code": { |
| 155 | + "$ref": "#/components/schemas/AttributeArray", |
| 156 | + "example": ["S12345678"] |
| 157 | + }, |
| 158 | + "eduperson_principal_name": { |
| 159 | + "$ref": "#/components/schemas/AttributeArray", |
| 160 | + |
| 161 | + }, |
| 162 | + "eduperson_entitlement": { |
| 163 | + "$ref": "#/components/schemas/AttributeArray", |
| 164 | + "example": ["urn:x-surfnet:surf.nl:surfdrive:quota:100"] |
| 165 | + }, |
| 166 | + "edumember_is_member_of": { |
| 167 | + "$ref": "#/components/schemas/AttributeArray", |
| 168 | + "example": ["research-group"] |
| 169 | + }, |
| 170 | + "eckid": { |
| 171 | + "$ref": "#/components/schemas/AttributeArray", |
| 172 | + "example": ["eck123456"] |
| 173 | + } |
| 174 | + } |
| 175 | + }, |
| 176 | + "ErrorResponse": { |
| 177 | + "type": "object", |
| 178 | + "properties": { |
| 179 | + "error": { |
| 180 | + "type": "string", |
| 181 | + "description": "Beschrijving van de foutmelding" |
| 182 | + } |
| 183 | + }, |
| 184 | + "required": ["error"] |
| 185 | + } |
| 186 | + } |
| 187 | + }, |
| 188 | + "security": [ |
| 189 | + { |
| 190 | + "basicAuth": [] |
| 191 | + } |
| 192 | + ] |
| 193 | +} |
0 commit comments