diff --git a/SOL023/CertificateManagement-API/ApiVersion.robot b/SOL023/CertificateManagement-API/ApiVersion.robot new file mode 100644 index 0000000000000000000000000000000000000000..19d80eb20bd77c980cdf0afd5ce40cef9cf126fb --- /dev/null +++ b/SOL023/CertificateManagement-API/ApiVersion.robot @@ -0,0 +1,214 @@ +*** Settings *** +Resource environment/variables.txt +Resource CertificateManagementKeywords.robot +Library REST +... ${CM_SCHEMA}://${CM_HOST}:${CM_PORT} +... ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +POST API Version - Method not implemented + [Documentation] Test ID: 13.3.1.1.1 + ... Test title: POST API version - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 [5] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + POST API Version + Check HTTP Response Status Code Is 405 + +GET API Version + [Documentation] Test ID: 13.3.1.1.2 + ... Test title: GET API Version + ... Test objective: The objective is to test that GET method successfully return ApiVersionInformation + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 [5] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET API Version + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is ApiVersionInformation + +PUT API Version - Method not implemented + [Documentation] Test ID: 13.3.1.1.3 + ... Test title: PUT API Version - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 [5] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + PUT API Version + Check HTTP Response Status Code Is 405 + +PATCH API Version - Method not implemented + [Documentation] Test ID: 13.3.1.1.4 + ... Test title: PATCH API Version - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 [5] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + PATCH API Version + Check HTTP Response Status Code Is 405 + +DELETE API Version - Method not implemented + [Documentation] Test ID: 13.3.1.1.5 + ... Test title: DELETE API Version - Method not implemented + ... Test objective: The objective is to test that DELETE method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 [5] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + DELETE API Version + Check HTTP Response Status Code Is 405 + +POST API Version with apiMajorVerion - Method not implemented + [Documentation] Test ID: 13.3.1.1.6 + ... Test title: POST API version with apiMajorVerion - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 [5] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + POST API Version + Check HTTP Response Status Code Is 405 + +GET API Version with apiMajorVerion + [Documentation] Test ID: 13.3.1.1.7 + ... Test title: GET API Version with apiMajorVerion + ... Test objective: The objective is to test that GET method successfully return ApiVersionInformation + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 [5] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET API Version + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is ApiVersionInformation + +PUT API Version with apiMajorVerion - Method not implemented + [Documentation] Test ID: 13.3.1.1.8 + ... Test title: PUT API Version with apiMajorVerion - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 [5] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + PUT API Version + Check HTTP Response Status Code Is 405 + +PATCH API Version with apiMajorVerion - Method not implemented + [Documentation] Test ID: 13.3.1.1.9 + ... Test title: PATCH API Version with apiMajorVerion - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 [5] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + PATCH API Version + Check HTTP Response Status Code Is 405 + +DELETE API Version with apiMajorVerion - Method not implemented + [Documentation] Test ID: 13.3.1.1.10 + ... Test title: DELETE API Version with apiMajorVerion - Method not implemented + ... Test objective: The objective is to test that DELETE method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 [5] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + DELETE API Version + Check HTTP Response Status Code Is 405 + +*** Keywords *** +POST API Version + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Post ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET API Version + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT API Version + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH API Version + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE API Version + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +POST API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal As Strings ${response['status']} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate SEPARATOR= ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK \ No newline at end of file diff --git a/SOL023/CertificateManagement-API/CertificateManagementKeywords.robot b/SOL023/CertificateManagement-API/CertificateManagementKeywords.robot new file mode 100644 index 0000000000000000000000000000000000000000..d032828f0ad124e1985c72ef13cd096c9d932786 --- /dev/null +++ b/SOL023/CertificateManagement-API/CertificateManagementKeywords.robot @@ -0,0 +1,316 @@ + +*** Settings *** +Resource environment/variables.txt +Library MockServerLibrary +Library REST ${CM_SCHEMA}://${CM_HOST}:${CM_PORT} ssl_verify=falseLibrary +Library BuiltIn +Library JSONLibrary +Library Collections +Library JSONSchemaLibrary schemas/ +Library String +Library Process +Library OperatingSystem +Library jwt + + +*** Keywords *** + +POST Create a new subject + Log Create subject by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/subjects + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + ${template} = Get File jsons/RegistrationRequest.json + ${body}= Format String ${template} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subjects ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +POST Create a new subject - Unauthorized + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${template} = Get File jsons/RegistrationRequest.json + ${body}= Format String ${template} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subjects ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +POST Create a new subject - Conflict + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + ${template} = Get File jsons/RegistrationRequest.json + ${body}= Format String ${template} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subjects ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +POST Create a new subject with permitted authorization scope + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${scope_value}= Create Dictionary scopeValue=${SUBJECTS_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + ${template} = Get File jsons/RegistrationRequest.json + ${body}= Format String ${template} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subjects ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +POST Create a new subject with not permitted authorization scope + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${scope_value}= Create Dictionary scopeValue=${NEG_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + ${template} = Get File jsons/RegistrationRequest.json + ${body}= Format String ${template} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subjects ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +Get Subjects + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/subjects + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +PUT Subjects + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${apiRoot}/${apiName}/${apiMajorVersion}/subjects + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +PATCH Subjects + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${apiRoot}/${apiName}/${apiMajorVersion}/subjects + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +DELETE Subjects + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiMajorVersion}/subjects + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +GET Subjects with bad attribute + Log Query information about Subjects with bad attribute. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/subjects?attribute_not_exist=some_value + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +GET Subjects with all_fields attribute selector + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/subjects?all_fields + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +GET Subjects with exclude_default attribute selector + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/subjects?exclude_default + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +GET Subjects with fields attribute selector + Log Query information about Subjects using fields attribute selector + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/subjects?fields=${requested_fields} + ${output}= Output response + Set Suite Variable ${response} ${output} +GET Subjects with exclude_fields attribute selector + Log Query information about Subjects using exclude_fields attribute selector + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/subjects?exclude_fields=${requested_fields} + ${output}= Output response + Set Suite Variable ${response} ${output} +Check HTTP Response Header Contain Link to next page + ${linkURL}= Get Value From Json ${response['headers']} $..Link + Should Not Be Empty ${linkURL} + Log Check that Link header contains rel set to next + Should Contain ${linkURL} rel="next" + Log Check that Link header contains URI to next page between <> + ${linkHeaderUri}= Get Regexp Matches ${linkURL} (?<=\<)(.*?)(?=\>) + ${length}= Get Length ${linkHeaderUri} + Should Be Equal As Integers ${length} 0 + Set Global Variable ${nextPageUri} ${linkHeaderUri[0]} +Get Subjects with nextpage_opaque_marker parameter + Log Get next page of Subjects + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${nextPageUri} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +POST Individual Subject + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subjects/{subjectId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +PUT Individual Subject + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subjects/{subjectId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +PATCH Individual Subject + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subjects/{subjectId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +DELETE Individual Subject + log Trying to delete an individual Subject + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiMajorVersion}/subjects/{subjectId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +DELETE Individual Subject - Conflict + log Trying to delete an individual Subject which is used by another resource + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiMajorVersion}/subjects/${subjectId_in_use} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +DELETE Individual Subject - Unauthorized + log Trying to delete an individual Subject without authorization + Delete ${apiRoot}/${apiName}/${apiMajorVersion}/subjects/${subjectId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +DELETE Individual Subject - Not Found + log Trying to delete an individual Subject that does not exist + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiMajorVersion}/subjects/${notExistantsubjectId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +GET Individual Subject with permitted authorization scope + Log Trying to get information about an Individual Subject with permitted authorization scope. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${scope_value}= Create Dictionary scopeValue=${SUBJECTS_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/subjects/${subjectId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +GET Individual Subject with not permitted authorization scope + Log Trying to get information about an Individual Subject with not permitted authorization scope. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${scope_value}= Create Dictionary scopeValue=${NEG_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/subjects/${subjectId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +GET Individual Subject - Unauthorized + Log Trying to get information about an Individual Subject without authorization. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/subjects/${subjectId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +GET Individual Subject - Not Found + Log Trying to get information about an Individual Subject that does not exist. + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiMajorVersion}/subjects/${notExistantsubjectId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +Validate Fields Selector Transformation + [Arguments] ${requested_fields} + ${selectable_fields}= Create List subjectId certType + ${requested_set}= Evaluate set(${requested_fields}) + ${absent_fields}= Evaluate list(set(${selectable_fields}) - ${requested_set}) + ${body}= Set Variable ${response['body']} + ${body_length}= Get Length ${body} + + # Early return if body is empty + Return From Keyword If ${body_length} == 0 + + # Validate each item + FOR ${item} IN @{body} + Validate Single Item ${item} ${requested_fields} ${absent_fields} + END + + Log Fields selector transformation validated for requested: ${requested_fields} + +Validate Single Item + [Arguments] ${item} ${requested_fields} ${absent_fields} + Check Fields Present ${item} ${requested_fields} + Check Fields Absent ${item} ${absent_fields} + +Check Fields Present + [Arguments] ${item} ${fields} + ${count}= Get Length ${fields} + Return From Keyword If ${count} == 0 + FOR ${field} IN @{fields} + Dictionary Should Contain Key ${item} ${field} + END + +Check Fields Absent + [Arguments] ${item} ${fields} + ${count}= Get Length ${fields} + Return From Keyword If ${count} == 0 + FOR ${field} IN @{fields} + Dictionary Should Not Contain Key ${item} ${field} + END +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal As Strings ${response['status']} ${expected_status} + Log Status code validated +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Run Keyword If '${input}' == 'ProblemDetails' Should Contain ${response['headers']['Content-Type']} application/problem+json + ... ELSE Should Contain ${response['headers']['Content-Type']} application/json + ${schema} = Catenate SEPARATOR= ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK +Check HTTP Response Header Contains + [Arguments] ${CONTENT_TYPE} + Should Contain ${response['headers']} ${CONTENT_TYPE} + Log Header is present +Check Postcondition Resource Returned in Location Header Is Available + Log Going to check postcondition + GET ${response['headers']['Location']} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + Validate Json schemas/SubjectInstance.schema.json ${result} + Log Validated SubjectInstance schema +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} \ No newline at end of file diff --git a/SOL023/CertificateManagement-API/IndividualSubject.robot b/SOL023/CertificateManagement-API/IndividualSubject.robot new file mode 100644 index 0000000000000000000000000000000000000000..d108e4fde0d7e34378cda56919648aba29274677 --- /dev/null +++ b/SOL023/CertificateManagement-API/IndividualSubject.robot @@ -0,0 +1,140 @@ +*** Settings *** +Resource environment/variables.txt +Resource CertificateManagementKeywords.robot +Library REST +... ${CM_SCHEMA}://${CM_HOST}:${CM_PORT} +... ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +POST Individual Subject - Method not implemented + [Documentation] Test ID: 13.3.1.3.1 + ... Test title: POST Individual Subject - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented + ... Pre-conditions: none + ... Reference: Clause 5.6.3.4.3.1 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + POST Individual Subject + Check HTTP Response Status Code Is 405 +GET Information about an Individual Subject + [Documentation] Test ID: 13.3.1.3.2 + ... Test title: GET Information about an Individual Subject + ... Test objective: The objective is to retrieve Information about Individual Subject with permitted authorization scope + ... Pre-conditions: none + ... Reference: Clause 5.6.3.4.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET Individual Subject with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is SubjectInstance +GET Information about an Individual Subject with not permitted authorization scope + [Documentation] Test ID: 13.3.1.3.3 + ... Test title: GET Information about an Individual Subject with not permitted authorization scope + ... Test objective: The objective is to retrieve Information about Individual Subject with not permitted authorization scope + ... Pre-conditions: none + ... Reference: Clause 5.6.3.4.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET Individual Subject with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails +GET Information about an Individual Subject - Unauthorized + [Documentation] Test ID: 13.3.1.3.4 + ... Test title: GET Information about an Individual Subject - Unauthorized + ... Test objective: The objective is to retrieve Information about Individual Subject without authorization + ... Pre-conditions: none + ... Reference: Clause 5.6.3.4.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET Individual Subject - Unauthorized + Check HTTP Response Status Code Is 401 + Check HTTP Response Body Json Schema Is ProblemDetails +GET Information about an Individual Subject - Not Found + [Documentation] Test ID: 13.3.1.3.5 + ... Test title: GET Information about an Individual Subject - Not Found + ... Test objective: The objective is to test the retrieval of information about an "Individual Subject" resource fails when the resource is not present. + ... Pre-conditions: none + ... Reference: Clause 5.6.3.4.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET Individual Subject - Not Found + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails +PUT Individual Subject - Method not implemented + [Documentation] Test ID: 13.3.1.3.6 + ... Test title: PUT Individual Subject - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented + ... Pre-conditions: none + ... Reference: Clause 5.6.3.4.3.3 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + PUT Individual Subject + Check HTTP Response Status Code Is 405 +PATCH Individual Subject - Method not implemented + [Documentation] Test ID: 13.3.1.3.7 + ... Test title: PATCH Individual Subject - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented + ... Pre-conditions: none + ... Reference: Clause 5.6.3.4.3.4 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + PATCH Individual Subject + Check HTTP Response Status Code Is 405 +DELETE Individual Subject + [Documentation] Test ID: 13.3.1.3.8 + ... Test title: DELETE Individual Subject + ... Test objective: The objective is to delete an individual Subject + ... Pre-conditions: none + ... Reference: Clause 5.6.3.4.3.5 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: Subject deleted + DELETE Individual Subject + Check HTTP Response Status Code Is 204 +DELETE Individual Subject - Conflict + [Documentation] Test ID: 13.3.1.3.9 + ... Test title: DELETE Individual Subject - Conflict + ... Test objective: The objective is to delete an individual Subject resource that is currently in use by another resource, and to verify that the appropriate error response is returned. + ... Pre-conditions: none + ... Reference: Clause 5.6.3.4.3.5 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: Subject deleted + DELETE Individual Subject - Conflict + Check HTTP Response Status Code Is 409 + Check HTTP Response Body Json Schema Is ProblemDetails +DELETE Individual Subject - Unauthorized + [Documentation] Test ID: 13.3.1.3.10 + ... Test title: DELETE Individual Subject - Unauthorized + ... Test objective: The objective is to delete an individual Subject resource without authorization, and to verify that the appropriate error response is returned. + ... Pre-conditions: none + ... Reference: Clause 5.6.3.4.3.5 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: Subject deleted + DELETE Individual Subject - Unauthorized + Check HTTP Response Status Code Is 401 + Check HTTP Response Body Json Schema Is ProblemDetails +DELETE Individual Subject - Not Found + [Documentation] Test ID: 13.3.1.3.11 + ... Test title: DELETE Individual Subject - Not Found + ... Test objective: The objective is to delete an individual Subject resource that does not exist, and to verify that the appropriate error response is returned. + ... Pre-conditions: none + ... Reference: Clause 5.6.3.4.3.5 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: Subject deleted + DELETE Individual Subject - Not Found + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails + diff --git a/SOL023/CertificateManagement-API/Subject.robot b/SOL023/CertificateManagement-API/Subject.robot new file mode 100644 index 0000000000000000000000000000000000000000..d4f597371afdf225a58fde940aad44f0e2c5a490 --- /dev/null +++ b/SOL023/CertificateManagement-API/Subject.robot @@ -0,0 +1,215 @@ +*** Settings *** +Resource environment/variables.txt +Resource CertificateManagementKeywords.robot +Library REST +... ${CM_SCHEMA}://${CM_HOST}:${CM_PORT} +... ssl_verify=false +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ + +*** Test Cases *** +POST Create a new Subject + [Documentation] Test ID: 13.3.1.2.1 + ... Test title: POST Create a new subject + ... Test objective: The objective is to create a new subject resource + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.1 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-conditions: A new subject resource is created + POST Create a new subject + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is SubjectInstance + Check HTTP Response Header Contains Location + Check Postcondition Resource Returned in Location Header Is Available +POST Create a new subject with permitted authorization scope + [Documentation] Test ID: 13.3.1.2.2 + ... Test title: POST Create a new subject with permitted authorization scope + ... Test objective: The objective is to create a new subject resource with permitted authorization scope + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.1 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: A new subject resource is created + POST Create a new subject with permitted authorization scope + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is SubjectInstance + Check HTTP Response Header Contains Location + Check Postcondition Resource Returned in Location Header Is Available +POST Create a new subject with not permitted authorization scope + [Documentation] Test ID: 13.3.1.2.3 + ... Test title: POST Create a new subject with not permitted authorization scope + ... Test objective: The objective is to create a new subject resource with not permitted authorization scope + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.1 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + POST Create a new subject with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails +POST Create a new Subject - Unauthorized + [Documentation] Test ID: 13.3.1.2.4 + ... Test title: POST Create a new subject - Unauthorized + ... Test objective: The objective is to create a new subject resource without authorization + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.1 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-conditions: none + POST Create a new subject - Unauthorized + Check HTTP Response Status Code Is 401 + Check HTTP Response Body Json Schema Is ProblemDetails +POST Create a new Subject - Conflict + [Documentation] Test ID: 13.3.1.2.5 + ... Test title: POST Create a new subject - Conflict + ... Test objective: The objective is to test that the operation cannot be executed due to a conflict with the state of the resource. + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.1 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-conditions: none + POST Create a new subject - Conflict + Check HTTP Response Status Code Is 409 + Check HTTP Response Body Json Schema Is ProblemDetails +GET information about Subjects + [Documentation] Test ID: 13.3.1.2.6 + ... Test title: GET information about Subjects + ... Test objective: The objective is to Fetch information about Subjects + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET Subjects + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is SubjectInstances +GET information about Subjects Bad Request Invalid attribute-based filtering parameters + [Documentation] Test ID: 13.3.1.2.7 + ... Test title: GET information about Subjects Bad Request Invalid attribute-based filtering parameters + ... Test objective: The objective is to get information about Subjects with Invalid attribute-based filtering parameters + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET Subjects with bad attribute + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails +GET information about Subjects with all_fields attribute selector + [Documentation] Test ID: 13.3.1.2.8 + ... Test title: GET information about Subjects with "all_fields" attribute selector + ... Test objective: The objective is to query information about Subjects + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET Subjects with all_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is SubjectInstances +GET information about Subjects with exclude_default attribute selector + [Documentation] Test ID: 13.3.1.2.9 + ... Test title: GET information about Subjects with "exclude_default" attribute selector + ... Test objective: The objective is to query information about Subjects + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET Subjects with exclude_default attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is SubjectInstances +GET information about Subjects with fields attribute selector + [Documentation] Test ID: 13.3.1.2.10 + ... Test title: GET information about Subjects with "fields" attribute selector + ... Test objective: The objective is to query information about Subjects + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET Subjects with fields attribute selector + Check HTTP Response Status Code Is 200 + Validate Fields Selector Transformation ${requested_fields} +GET information about Subjects with exclude_fields attribute selector + [Documentation] Test ID: 13.3.1.2.11 + ... Test title: GET information about Subjects with "exclude_fields" attribute selector + ... Test objective: The objective is to query information about Subjects + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET Subjects with exclude_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is SubjectInstances +GET information about Subjects to get Paged Response + [Documentation] Test ID: 13.3.1.2.12 + ... Test title: GET information about Subjects to get Paged Response + ... Test objective: The objective is to query information about Subjects to get Paged Response + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: The CMF supports response paging for the Subjects resources + ... Post-Conditions: none + GET Subjects + Check HTTP Response Status Code Is 200 + Check HTTP Response Header Contain Link to next page +GET information about Subjects as a Paged Response with nextpage_opauque_marker parameter + [Documentation] Test ID: 13.3.1.2.12a + ... Test title: GET information about Subjects as a Paged Response with nextpage_opauque_marker parameter + ... Test objective: The objective is to query information about Subjects as a Paged Response and retrieve the next page using the nextpage_opaque_marker parameter + ... Pre-conditions: A request for retrieving Subjects as a paged response has been successfully issued (Test ID 13.3.1.2.11) + ... Reference: Clause 5.6.3.3.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: The CMF supports response paging for the Subjects resources + ... Post-Conditions: none + Get Subjects with nextpage_opaque_marker parameter + Check HTTP Response Status Code Is 200 +GET information about Subjects - Bad Request Response too big + [Documentation] Test ID: 13.3.1.2.13 + ... Test title: GET information about Subjects - Bad Request Response too big + ... Test objective: The objective is to test that GET method fail retrieving information about Subjects because Response is too big. + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3.2 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + GET Subjects + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails +PUT Subjects - Method not implemented + [Documentation] Test ID: 13.3.1.2.14 + ... Test title: PUT Subjects - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.3 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + PUT Subjects + Check HTTP Response Status Code Is 405 +PATCH Subjects - Method not implemented + [Documentation] Test ID: 13.3.1.2.15 + ... Test title: PATCH Subjects - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.4 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + PATCH Subjects + Check HTTP Response Status Code Is 405 +DELETE Subjects - Method not implemented + [Documentation] Test ID: 13.3.1.2.16 + ... Test title: DELETE Subjects - Method not implemented + ... Test objective: The objective is to test that DELETE method is not implemented + ... Pre-conditions: none + ... Reference: Clause 5.6.3.3.5 - ETSI GS NFV-SOL 023 [13] v5.3.1 + ... Config ID: config_prod_CMF + ... Applicability: none + ... Post-Conditions: none + DELETE Subjects + Check HTTP Response Status Code Is 405 diff --git a/SOL023/CertificateManagement-API/environment/variables.txt b/SOL023/CertificateManagement-API/environment/variables.txt new file mode 100644 index 0000000000000000000000000000000000000000..e8bce01639ab706d77a1e7195ea7a0ca61efb393 --- /dev/null +++ b/SOL023/CertificateManagement-API/environment/variables.txt @@ -0,0 +1,24 @@ +*** Variables *** +${CM_SCHEMA} https +${CM_HOST} localhost +${CM_PORT} 8080 +${apiRoot} / +${apiName} nfv-cert +${apiMajorVersion} v1 + +${ACCEPT} application/json +${ACCEPT_JSON} application/json +${CONTENT_TYPE} application/json +${CONTENT_TYPE_PATCH} application/merge-patch+json +${AUTHORIZATION_HEADER} Authorization +${AUTHORIZATION_TOKEN} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 +${AUTH_USAGE} 1 +${OAUTH_Encryption_ALGORITHM} HS256 +${API_VERSION} 1.0.0 +${response}= httpresponse +${SUBJECTS_SCOPE} cert:v1:subject +${NEG_SCOPE} cert:v1:invalid +${requested_fields} subjectId +${subjectId} SubjectId +${subject_Id_In_Use} subject_Id_In_Use +${notExistantsubjectId} notExistantsubjectId \ No newline at end of file diff --git a/SOL023/CertificateManagement-API/jsons/RegistrationRequest.json b/SOL023/CertificateManagement-API/jsons/RegistrationRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..bcabb1c5d66d6ad564a3db280257d73932601c2c --- /dev/null +++ b/SOL023/CertificateManagement-API/jsons/RegistrationRequest.json @@ -0,0 +1,10 @@ +{{ + "certType": "VNFCI certificate", + "subjectId": { + "subjectId": "vnfci-1234", + "certificateData": { + "subjectAlternateName": "vnfci-1234.example.com" + } + }, + "typeOfVnfcCertHandling": "delegation_mode" +}} \ No newline at end of file diff --git a/SOL023/CertificateManagement-API/schemas/ProblemDetails.schema.json b/SOL023/CertificateManagement-API/schemas/ProblemDetails.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..8c390ac417f7cbb7c4b71081a3ba2d5b5bbe1888 --- /dev/null +++ b/SOL023/CertificateManagement-API/schemas/ProblemDetails.schema.json @@ -0,0 +1,32 @@ +{ + "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 is reproduced in this structure. Compared to the general framework defined in IETF RFC 7807, the \"status\" and \"details\" attributes are mandated to be included, to ensure that the response contains additional textual information about an error. IETF RFC 7807 foresees extensibility of the \"ProblemDetails\" type. It is possible that particular RESTful NFV-MANO API, or particular implementations, specify extensions to define additional attributes that provide more information about the error.\n", + "type": "object", + "required": [ + "status", + "detail" + ], + "properties": { + "type": { + "description": "A URI reference according to IETF RFC 3986 that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", + "type": "string", + "format": "URI" + }, + "title": { + "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided.\n", + "type": "string" + }, + "status": { + "description": "The HTTP status code for this occurrence of the problem.\n", + "type": "integer" + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem.\n", + "type": "string" + }, + "instance": { + "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", + "type": "string", + "format": "URI" + } + } +} diff --git a/SOL023/CertificateManagement-API/schemas/SubjectInstance.schema.json b/SOL023/CertificateManagement-API/schemas/SubjectInstance.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..78b429dcec8bb7d420982261aa15f61fb79550f7 --- /dev/null +++ b/SOL023/CertificateManagement-API/schemas/SubjectInstance.schema.json @@ -0,0 +1,113 @@ +{ + "description": "This type represents a subject instance.\nNOTE 1: \tRegistration of target certificates of type 'MANO certificate' is not covered in this version of the present document.\nNOTE 2:\tAt least one overriding attributes shall be present, otherwise shall be absent.\n", + "type": "object", + "required": [ + "id", + "certType", + "subjectId", + "typeOfVnfcCertHandling", + "_links" + ], + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "certType": { + "description": "Indicate the type of target certificate. The possible values are (see note 1):\n -\tMANO_certificate\n -\tVNFCI_certificate\n -\tVNF_OAM_certificate\n", + "type": "string", + "enum": [ + "MANO_certificate", + "VNFCI_certificate", + "VNF_OAM_certificate" + ] + }, + "subjectId": { + "description": "Data about subjects and their certificates that need to be registered. This attribute shall be present only if certType is VNFCI certificate or VNF OAM certificate.\n", + "type": "object", + "required": [ + "subjectId", + "certificateData" + ], + "properties": { + "subjectId": { + "description": "The value of the Identifier of the certificate target VNFCI as subject ID if this operation is used for the VNFCI certificate or VNF OAM certificate.\n", + "type": "string" + }, + "certificateData": { + "description": "Data related to certificates for the target VNFCI.\n", + "type": "object", + "required": [ + "subjectAlternateName" + ], + "properties": { + "subjectName": { + "description": "This type provides input information related to subject of certificate.\nNOTE:\tAt least one overriding attributes shall be present, otherwise shall be absent.\n", + "type": "object", + "properties": { + "commonName": { + "description": "Information of certification target subject FQDN. Can be set empty when this certificate is used for encrypted communication using IP address. See note.\n", + "type": "string" + }, + "organization": { + "description": "Information of certification target subject Organization. See note.\n", + "type": "string" + }, + "country": { + "description": "Information of certification target subject Country. See note.\n", + "type": "string" + }, + "state": { + "description": "Information of certification target subject State. See note.\n", + "type": "string" + }, + "locality": { + "description": "Information of certification target subject Locality. See note.\n", + "type": "string" + }, + "emailAddress": { + "description": "Information of certification contact email address. See note.\n", + "type": "string" + } + } + }, + "subjectAlternateName": { + "description": "Subject alternate names of VNFCI certificates.\n", + "type": "string" + } + } + } + } + }, + "typeOfVnfcCertHandling": { + "description": "This parameter shall be present only if certType is VNFCI certificate or VNF OAM certificate. It indicates the mode of certificate management for the target entity. The possible values are:\n -\tdirect_mode\n -\tdelegation_mode\nSee note 2.\n", + "type": "string", + "enum": [ + "direct_mode", + "delegation_mode" + ] + }, + "_links": { + "description": "Links to resources related to this resource.\n", + "type": "object", + "required": [ + "self" + ], + "properties": { + "self": { + "description": "This type represents a link to a resource using an absolute URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + } + } + } + } +} diff --git a/SOL023/CertificateManagement-API/schemas/SubjectInstances.schema.json b/SOL023/CertificateManagement-API/schemas/SubjectInstances.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..81f3d47d33d070c43b919c1d02aaa7abfd2f934a --- /dev/null +++ b/SOL023/CertificateManagement-API/schemas/SubjectInstances.schema.json @@ -0,0 +1,116 @@ +{ + "type": "array", + "items": { + "description": "This type represents a subject instance.\nNOTE 1: \tRegistration of target certificates of type 'MANO certificate' is not covered in this version of the present document.\nNOTE 2:\tAt least one overriding attributes shall be present, otherwise shall be absent.\n", + "type": "object", + "required": [ + "id", + "certType", + "subjectId", + "typeOfVnfcCertHandling", + "_links" + ], + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "certType": { + "description": "Indicate the type of target certificate. The possible values are (see note 1):\n -\tMANO_certificate\n -\tVNFCI_certificate\n -\tVNF_OAM_certificate\n", + "type": "string", + "enum": [ + "MANO_certificate", + "VNFCI_certificate", + "VNF_OAM_certificate" + ] + }, + "subjectId": { + "description": "Data about subjects and their certificates that need to be registered. This attribute shall be present only if certType is VNFCI certificate or VNF OAM certificate.\n", + "type": "object", + "required": [ + "subjectId", + "certificateData" + ], + "properties": { + "subjectId": { + "description": "The value of the Identifier of the certificate target VNFCI as subject ID if this operation is used for the VNFCI certificate or VNF OAM certificate.\n", + "type": "string" + }, + "certificateData": { + "description": "Data related to certificates for the target VNFCI.\n", + "type": "object", + "required": [ + "subjectAlternateName" + ], + "properties": { + "subjectName": { + "description": "This type provides input information related to subject of certificate.\nNOTE:\tAt least one overriding attributes shall be present, otherwise shall be absent.\n", + "type": "object", + "properties": { + "commonName": { + "description": "Information of certification target subject FQDN. Can be set empty when this certificate is used for encrypted communication using IP address. See note.\n", + "type": "string" + }, + "organization": { + "description": "Information of certification target subject Organization. See note.\n", + "type": "string" + }, + "country": { + "description": "Information of certification target subject Country. See note.\n", + "type": "string" + }, + "state": { + "description": "Information of certification target subject State. See note.\n", + "type": "string" + }, + "locality": { + "description": "Information of certification target subject Locality. See note.\n", + "type": "string" + }, + "emailAddress": { + "description": "Information of certification contact email address. See note.\n", + "type": "string" + } + } + }, + "subjectAlternateName": { + "description": "Subject alternate names of VNFCI certificates.\n", + "type": "string" + } + } + } + } + }, + "typeOfVnfcCertHandling": { + "description": "This parameter shall be present only if certType is VNFCI certificate or VNF OAM certificate. It indicates the mode of certificate management for the target entity. The possible values are:\n -\tdirect_mode\n -\tdelegation_mode\nSee note 2.\n", + "type": "string", + "enum": [ + "direct_mode", + "delegation_mode" + ] + }, + "_links": { + "description": "Links to resources related to this resource.\n", + "type": "object", + "required": [ + "self" + ], + "properties": { + "self": { + "description": "This type represents a link to a resource using an absolute URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + } + } + } + } + } + }