diff --git a/client/actions/configuration.js b/client/actions/configuration.js index a174e298..4cfff61d 100644 --- a/client/actions/configuration.js +++ b/client/actions/configuration.js @@ -174,17 +174,3 @@ export function removeConfigurationResourceServer() { } }; } - -/* - * Load explorer configuration. - */ -export function fetchConfigurationExplorer() { - return { - type: constants.FETCH_CONFIGURATION_EXPLORER, - payload: { - promise: axios.get('/swagger.json', { - responseType: 'json' - }) - } - }; -} diff --git a/client/components/API/APISettings.jsx b/client/components/API/APISettings.jsx index 837b7576..c162ed39 100644 --- a/client/components/API/APISettings.jsx +++ b/client/components/API/APISettings.jsx @@ -5,6 +5,8 @@ import { Error, LoadingPanel, SectionHeader } from 'auth0-extension-ui'; import APIAccessTab from './APIAccessTab'; import APIExplorerTab from './APIExplorerTab'; +import apiExplorer from './apiExplorer.json'; + export default class RuleSettings extends Component { static propTypes = { configuration: PropTypes.object.isRequired, @@ -16,8 +18,13 @@ export default class RuleSettings extends Component { } render() { - const { loading, error, resourceserver, explorer } = this.props.configuration.toJS(); - const initialValues = { token_lifetime: 86400, ...(resourceserver || { }) }; + const { loading, error, resourceserver } = + this.props.configuration.toJS(); + const initialValues = { token_lifetime: 86400, ...(resourceserver || {}) }; + + // no longer generated from hapi-swagger, now static json + const explorer = apiExplorer; + return (
- + diff --git a/client/components/API/apiExplorer.json b/client/components/API/apiExplorer.json new file mode 100644 index 00000000..ead37981 --- /dev/null +++ b/client/components/API/apiExplorer.json @@ -0,0 +1,1268 @@ +{ + "basePath": "/", + "swagger": "2.0", + "host": "", + "schemes": ["https"], + "info": { + "title": "API documentation", + "version": "0.0.1" + }, + "tags": [], + "paths": { + "/api/permissions": { + "get": { + "summary": "Get all permissions in the system.", + "operationId": "getApiPermissions", + "parameters": [ + { + "type": "string", + "default": "", + "maxLength": 1000, + "name": "q", + "in": "query" + }, + { + "type": "string", + "default": "", + "maxLength": 1000, + "name": "field", + "in": "query" + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "post": { + "summary": "Create a new permission.", + "operationId": "postApiPermissions", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model2" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/users/{id}/roles": { + "get": { + "summary": "Get the roles for a user.", + "operationId": "getApiUsersIdRoles", + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "patch": { + "summary": "Add a single user to roles.", + "operationId": "patchApiUsersIdRoles", + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model10" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "delete": { + "summary": "Remove a single user from roles.", + "operationId": "deleteApiUsersIdRoles", + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model16" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/users/{id}/groups/calculate": { + "get": { + "summary": "Calculate the group memberships for a user (including nested groups).", + "operationId": "getApiUsersIdGroupsCalculate", + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/groups/{id}/nested": { + "get": { + "summary": "Get the nested groups for a group.", + "operationId": "getApiGroupsIdNested", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "patch": { + "summary": "Add one or more nested groups in a group.", + "operationId": "patchApiGroupsIdNested", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model6" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "delete": { + "summary": "Delete one or more nested groups from a group.", + "operationId": "deleteApiGroupsIdNested", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model14" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/groups/{id}/members": { + "get": { + "summary": "Get the members for a group.", + "operationId": "getApiGroupsIdMembers", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 25, + "minimum": 1, + "maximum": 25, + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "default": 0, + "minimum": 0, + "name": "page", + "in": "query" + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "patch": { + "summary": "Add one or more members in a group.", + "operationId": "patchApiGroupsIdMembers", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model5" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "delete": { + "summary": "Delete one or more members from a group.", + "operationId": "deleteApiGroupsIdMembers", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model15" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/groups/{id}/roles": { + "get": { + "summary": "Get the roles for a group.", + "operationId": "getApiGroupsIdRoles", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "patch": { + "summary": "Add one or more roles to a group.", + "operationId": "patchApiGroupsIdRoles", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model7" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "delete": { + "summary": "Delete one or more roles from a group.", + "operationId": "deleteApiGroupsIdRoles", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model13" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/users/{id}/groups": { + "get": { + "summary": "Get the groups for a user. Add \"?expand\" to also load all roles and permissions for these groups.", + "operationId": "getApiUsersIdGroups", + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "patch": { + "summary": "Add a single user to groups.", + "operationId": "patchApiUsersIdGroups", + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model11" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/users/{userId}/policy/{clientId}": { + "post": { + "summary": "Execute the authorization policy for a user in the context of a client. This will return the user's groups but also roles and permissions that apply to the current client.", + "operationId": "postApiUsersUseridPolicyClientid", + "parameters": [ + { + "type": "string", + "name": "userId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "clientId", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model4" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/permissions/{id}": { + "get": { + "summary": "Get a single permission based on its unique identifier.", + "operationId": "getApiPermissionsId", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "delete": { + "summary": "Delete a permission.", + "operationId": "deleteApiPermissionsId", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "put": { + "summary": "Update a permission.", + "operationId": "putApiPermissionsId", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model2" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/groups/{id}/mappings": { + "get": { + "summary": "Get the mappings for a group.", + "operationId": "getApiGroupsIdMappings", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "patch": { + "summary": "Create one or more mappings in a group.", + "operationId": "patchApiGroupsIdMappings", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model9" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "delete": { + "summary": "Delete one or more group mappings from a group.", + "operationId": "deleteApiGroupsIdMappings", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model12" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/users/{id}/roles/calculate": { + "get": { + "summary": "Calculate the roles assigned to the user (including through group memberships).", + "operationId": "getApiUsersIdRolesCalculate", + "parameters": [ + { + "type": "string", + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/groups": { + "get": { + "summary": "Get all groups in the system.", + "operationId": "getApiGroups", + "parameters": [ + { + "type": "string", + "default": "", + "maxLength": 1000, + "name": "q", + "in": "query" + }, + { + "type": "string", + "default": "", + "maxLength": 1000, + "name": "field", + "in": "query" + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "post": { + "summary": "Create a new group.", + "operationId": "postApiGroups", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model1" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/roles": { + "get": { + "summary": "Get all roles in the system.", + "operationId": "getApiRoles", + "parameters": [ + { + "type": "string", + "default": "", + "maxLength": 1000, + "name": "q", + "in": "query" + }, + { + "type": "string", + "default": "", + "maxLength": 1000, + "name": "field", + "in": "query" + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "post": { + "summary": "Create a new role.", + "operationId": "postApiRoles", + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model3" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/groups/{id}/roles/nested": { + "get": { + "summary": "Get the nested roles for a group.", + "operationId": "getApiGroupsIdRolesNested", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/roles/{id}": { + "get": { + "summary": "Get a single role based on its unique identifier.", + "operationId": "getApiRolesId", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "delete": { + "summary": "Delete a role.", + "operationId": "deleteApiRolesId", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "put": { + "summary": "Update a role.", + "operationId": "putApiRolesId", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model3" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/groups/{id}/members/nested": { + "get": { + "summary": "Get the nested members for a group.", + "operationId": "getApiGroupsIdMembersNested", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "type": "integer", + "default": 25, + "minimum": 1, + "maximum": 25, + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "default": 0, + "minimum": 0, + "name": "page", + "in": "query" + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + }, + "/api/groups/{id}": { + "get": { + "summary": "Get a single group based on its unique identifier. Add \"?expand\" to also load all roles and permissions for this group.", + "operationId": "getApiGroupsId", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "type": "boolean", + "name": "expand", + "in": "query" + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "delete": { + "summary": "Delete a group.", + "operationId": "deleteApiGroupsId", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + }, + "put": { + "summary": "Update a group.", + "operationId": "putApiGroupsId", + "parameters": [ + { + "type": "string", + "x-format": { + "guid": true + }, + "name": "id", + "in": "path", + "required": true + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/Model1" + } + } + ], + "tags": ["api"], + "responses": { + "default": { + "schema": { + "type": "string" + }, + "description": "Successful" + } + } + } + } + }, + "definitions": { + "permissions": { + "type": "array", + "items": { + "type": "string", + "x-format": { + "guid": true + } + } + }, + "Model1": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + } + }, + "required": ["name", "description"] + }, + "Model10": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "Model2": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "applicationType": { + "$ref": "#/definitions/applicationType" + }, + "applicationId": { + "type": "string", + "minLength": 1, + "maxLength": 500 + } + }, + "required": ["name", "description", "applicationType", "applicationId"] + }, + "Model11": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "applicationType": { + "type": "string", + "enum": ["client", "resource_server"] + }, + "Model3": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "description": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "applicationType": { + "$ref": "#/definitions/applicationType" + }, + "applicationId": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "permissions": { + "$ref": "#/definitions/permissions" + } + }, + "required": ["name", "description", "applicationType", "applicationId"] + }, + "Model12": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "x-format": { + "guid": true + } + } + }, + "Model4": { + "type": "object", + "properties": { + "connectionName": { + "type": "string" + }, + "groups": { + "$ref": "#/definitions/groups" + } + }, + "required": ["connectionName"] + }, + "Model13": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "x-format": { + "guid": true + } + } + }, + "Model5": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "Model14": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "x-format": { + "guid": true + } + } + }, + "Model6": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "x-format": { + "guid": true + } + } + }, + "Model15": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "Model7": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "x-format": { + "guid": true + } + } + }, + "Model16": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "x-format": { + "guid": true + } + } + }, + "Model8": { + "type": "object", + "properties": { + "groupName": { + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "connectionName": { + "type": "string", + "minLength": 1, + "maxLength": 50 + } + }, + "required": ["groupName", "connectionName"] + }, + "Model9": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/Model8" + } + }, + "groups": { + "type": "array", + "items": { + "type": "string" + } + } + } +} diff --git a/client/constants.js b/client/constants.js index 6314bd9f..e29bff4e 100644 --- a/client/constants.js +++ b/client/constants.js @@ -86,16 +86,6 @@ export const REMOVE_CONFIGURATION_RESOURCESERVER_PENDING = 'REMOVE_CONFIGURATION export const REMOVE_CONFIGURATION_RESOURCESERVER_REJECTED = 'REMOVE_CONFIGURATION_RESOURCESERVER_REJECTED'; export const REMOVE_CONFIGURATION_RESOURCESERVER_FULFILLED = 'REMOVE_CONFIGURATION_RESOURCESERVER_FULFILLED'; -/* - * Configuration Explorer. - */ - - // Fetch. -export const FETCH_CONFIGURATION_EXPLORER = 'FETCH_CONFIGURATION_EXPLORER'; -export const FETCH_CONFIGURATION_EXPLORER_PENDING = 'FETCH_CONFIGURATION_EXPLORER_PENDING'; -export const FETCH_CONFIGURATION_EXPLORER_REJECTED = 'FETCH_CONFIGURATION_EXPLORER_REJECTED'; -export const FETCH_CONFIGURATION_EXPLORER_FULFILLED = 'FETCH_CONFIGURATION_EXPLORER_FULFILLED'; - /* * Groups. */ diff --git a/client/containers/API.jsx b/client/containers/API.jsx index 07863e5d..0d22735d 100644 --- a/client/containers/API.jsx +++ b/client/containers/API.jsx @@ -15,13 +15,11 @@ export default connectContainer(class API extends Component { static propTypes = { configuration: PropTypes.object.isRequired, fetchConfigurationResourceServer: PropTypes.func.isRequired, - saveConfigurationResourceServer: PropTypes.func.isRequired, - fetchConfigurationExplorer: PropTypes.func.isRequired + saveConfigurationResourceServer: PropTypes.func.isRequired } componentWillMount() { this.props.fetchConfigurationResourceServer(); - this.props.fetchConfigurationExplorer(); } render() { diff --git a/client/reducers/configuration.js b/client/reducers/configuration.js index b0f210c1..784e5073 100644 --- a/client/reducers/configuration.js +++ b/client/reducers/configuration.js @@ -119,21 +119,5 @@ export const configuration = createReducer(fromJS(initialState), { [constants.SET_CONFIGURATION_TAB]: (state, action) => state.merge({ activeTab: action.meta.activeTab - }), - [constants.FETCH_CONFIGURATION_EXPLORER_PENDING]: (state) => - state.merge({ - error: null, - loading: true, - explorer: { } - }), - [constants.FETCH_CONFIGURATION_EXPLORER_REJECTED]: (state, action) => - state.merge({ - loading: false, - error: `An error occurred while loading the api explorer configuration: ${action.errorMessage}` - }), - [constants.FETCH_CONFIGURATION_EXPLORER_FULFILLED]: (state, action) => - state.merge({ - loading: false, - explorer: fromJS(action.payload.data) }) }); diff --git a/package-lock.json b/package-lock.json index 6a8e00be..4d9acd16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,6 @@ "blipp": "^4.0.2", "ejs": "^3.1.9", "hapi-auth-jwt2": "10.5.1", - "hapi-swagger": "17.2.1", "joi": "17.12.2", "jose": "4.15.5", "jsonwebtoken": "^9.0.1", @@ -9644,95 +9643,6 @@ "node": ">=6.0.0" } }, - "node_modules/@apidevtools/json-schema-ref-parser": { - "version": "11.2.0", - "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.2.0.tgz", - "integrity": "sha512-hvP76NqZbVnqv1EvhE8MFB4Pb0p9PxOZBC39hMH1sM3M4g488xMCuYG+Em0A55KAO0wcL8TPbEoT94/8LrzA0Q==", - "license": "MIT", - "dependencies": { - "@jsdevtools/ono": "^7.1.3", - "@types/json-schema": "^7.0.15", - "@types/lodash.clonedeep": "^4.5.9", - "js-yaml": "^4.1.0", - "lodash.clonedeep": "^4.5.0" - }, - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://github.com/sponsors/philsturgeon" - } - }, - "node_modules/@apidevtools/json-schema-ref-parser/node_modules/argparse": { - "version": "2.0.1", - "license": "Python-2.0" - }, - "node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml": { - "version": "4.1.0", - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/@apidevtools/openapi-schemas": { - "version": "2.1.0", - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/@apidevtools/swagger-methods": { - "version": "3.0.2", - "license": "MIT" - }, - "node_modules/@apidevtools/swagger-parser": { - "version": "10.0.3", - "license": "MIT", - "dependencies": { - "@apidevtools/json-schema-ref-parser": "^9.0.6", - "@apidevtools/openapi-schemas": "^2.0.4", - "@apidevtools/swagger-methods": "^3.0.2", - "@jsdevtools/ono": "^7.1.3", - "call-me-maybe": "^1.0.1", - "z-schema": "^5.0.1" - }, - "peerDependencies": { - "openapi-types": ">=7" - } - }, - "node_modules/@apidevtools/swagger-parser/node_modules/@apidevtools/json-schema-ref-parser": { - "version": "9.1.2", - "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.1.2.tgz", - "integrity": "sha512-r1w81DpR+KyRWd3f+rk6TNqMgedmAxZP5v5KWlXQWlgMUUtyEJch0DKEci1SorPMiSeM8XPl7MZ3miJ60JIpQg==", - "license": "MIT", - "dependencies": { - "@jsdevtools/ono": "^7.1.3", - "@types/json-schema": "^7.0.6", - "call-me-maybe": "^1.0.1", - "js-yaml": "^4.1.0" - } - }, - "node_modules/@apidevtools/swagger-parser/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "license": "Python-2.0" - }, - "node_modules/@apidevtools/swagger-parser/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/@babel/code-frame": { "version": "7.25.7", "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/@babel/code-frame/-/code-frame-7.25.7.tgz", @@ -12405,10 +12315,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@jsdevtools/ono": { - "version": "7.1.3", - "license": "MIT" - }, "node_modules/@leichtgewicht/ip-codec": { "version": "2.0.4", "dev": true, @@ -12616,6 +12522,7 @@ }, "node_modules/@types/json-schema": { "version": "7.0.15", + "dev": true, "license": "MIT" }, "node_modules/@types/jsonwebtoken": { @@ -12625,17 +12532,6 @@ "@types/node": "*" } }, - "node_modules/@types/lodash": { - "version": "4.14.202", - "license": "MIT" - }, - "node_modules/@types/lodash.clonedeep": { - "version": "4.5.9", - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, "node_modules/@types/mime": { "version": "1.3.5", "license": "MIT" @@ -16127,10 +16023,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/call-me-maybe": { - "version": "1.0.2", - "license": "MIT" - }, "node_modules/caller-path": { "version": "0.1.0", "dev": true, @@ -20418,32 +20310,6 @@ "dev": true, "license": "MIT" }, - "node_modules/handlebars": { - "version": "4.7.8", - "license": "MIT", - "dependencies": { - "minimist": "^1.2.5", - "neo-async": "^2.6.2", - "source-map": "^0.6.1", - "wordwrap": "^1.0.0" - }, - "bin": { - "handlebars": "bin/handlebars" - }, - "engines": { - "node": ">=0.4.7" - }, - "optionalDependencies": { - "uglify-js": "^3.1.4" - } - }, - "node_modules/handlebars/node_modules/source-map": { - "version": "0.6.1", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/hapi-auth-jwt2": { "version": "10.5.1", "license": "ISC", @@ -20456,26 +20322,6 @@ "node": ">=18.0.0" } }, - "node_modules/hapi-swagger": { - "version": "17.2.1", - "license": "MIT", - "dependencies": { - "@apidevtools/json-schema-ref-parser": "^11.1.0", - "@hapi/boom": "^10.0.1", - "@hapi/hoek": "^11.0.2", - "handlebars": "^4.7.8", - "http-status": "^1.7.3", - "swagger-parser": "^10.0.3", - "swagger-ui-dist": "^5.9.1" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@hapi/hapi": ">=20.x.x", - "joi": "17.x" - } - }, "node_modules/har-schema": { "version": "2.0.0", "license": "ISC", @@ -20912,13 +20758,6 @@ "npm": ">=1.3.7" } }, - "node_modules/http-status": { - "version": "1.7.3", - "license": "BSD-3-Clause", - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/https-browserify": { "version": "1.0.0", "resolved": "https://a0us.jfrog.io/artifactory/api/npm/npm/https-browserify/-/https-browserify-1.0.0.tgz", @@ -22881,6 +22720,7 @@ }, "node_modules/lodash.isequal": { "version": "4.5.0", + "dev": true, "license": "MIT" }, "node_modules/lodash.isinteger": { @@ -23880,6 +23720,7 @@ }, "node_modules/neo-async": { "version": "2.6.2", + "dev": true, "license": "MIT" }, "node_modules/next-tick": { @@ -29176,11 +29017,6 @@ "node": ">= 0.6.0" } }, - "node_modules/openapi-types": { - "version": "12.1.3", - "license": "MIT", - "peer": true - }, "node_modules/optionator": { "version": "0.8.3", "dev": true, @@ -33342,20 +33178,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/swagger-parser": { - "version": "10.0.3", - "license": "MIT", - "dependencies": { - "@apidevtools/swagger-parser": "10.0.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/swagger-ui-dist": { - "version": "5.11.4", - "license": "Apache-2.0" - }, "node_modules/swap-case": { "version": "1.1.2", "license": "MIT", @@ -33907,7 +33729,7 @@ }, "node_modules/uglify-js": { "version": "3.17.4", - "devOptional": true, + "dev": true, "license": "BSD-2-Clause", "bin": { "uglifyjs": "bin/uglifyjs" @@ -34318,13 +34140,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "node_modules/validator": { - "version": "13.11.0", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, "node_modules/value-or-function": { "version": "3.0.0", "dev": true, @@ -36493,10 +36308,6 @@ "node": ">=0.10.0" } }, - "node_modules/wordwrap": { - "version": "1.0.0", - "license": "MIT" - }, "node_modules/wrappy": { "version": "1.0.2", "license": "ISC" @@ -36606,32 +36417,6 @@ "engines": { "node": ">=0.10.0" } - }, - "node_modules/z-schema": { - "version": "5.0.5", - "license": "MIT", - "dependencies": { - "lodash.get": "^4.4.2", - "lodash.isequal": "^4.5.0", - "validator": "^13.7.0" - }, - "bin": { - "z-schema": "bin/z-schema" - }, - "engines": { - "node": ">=8.0.0" - }, - "optionalDependencies": { - "commander": "^9.4.1" - } - }, - "node_modules/z-schema/node_modules/commander": { - "version": "9.5.0", - "license": "MIT", - "optional": true, - "engines": { - "node": "^12.20.0 || >=14" - } } } } diff --git a/package.json b/package.json index fc437869..6416efa7 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,6 @@ "blipp@4.0.2", "ejs@3.1.9", "hapi-auth-jwt2@10.5.1", - "hapi-swagger@17.2.1", "jsonwebtoken@9.0.1", "jwks-rsa@3.0.1", "lodash@4.17.21", @@ -76,7 +75,6 @@ "blipp": "^4.0.2", "ejs": "^3.1.9", "hapi-auth-jwt2": "10.5.1", - "hapi-swagger": "17.2.1", "joi": "17.12.2", "jose": "4.15.5", "jsonwebtoken": "^9.0.1", diff --git a/server/index.js b/server/index.js index aed0afef..4765fe3d 100644 --- a/server/index.js +++ b/server/index.js @@ -3,7 +3,6 @@ import inertPlugin from '@hapi/inert'; import Blipp from 'blipp'; import jwt from 'hapi-auth-jwt2'; import GoodConsole from '@hapi/good-console'; -import HapiSwagger from 'hapi-swagger'; import Joi from 'joi'; import config from './lib/config'; @@ -40,13 +39,6 @@ export default async () => { const externalPlugins = [ goodPlugin, - { - plugin: { ...HapiSwagger, name: 'hapi-swagger' }, - options: { - documentationPage: false, - swaggerUI: false - } - }, { plugin: { ...inertPlugin, name: 'inert' } }, diff --git a/tests/unit/client/reducers/configuration.tests.js b/tests/unit/client/reducers/configuration.tests.js index 6e71dc93..28f0ab70 100644 --- a/tests/unit/client/reducers/configuration.tests.js +++ b/tests/unit/client/reducers/configuration.tests.js @@ -352,69 +352,4 @@ describe('configuration reducer', () => { } ); }); - - it('should handle FETCH_CONFIGURATION_EXPLORER_PENDING', () => { - expect( - configuration(initialState, { - type: constants.FETCH_CONFIGURATION_EXPLORER_PENDING - }).toJSON() - ).toEqual( - { - loading: true, - error: null, - record: {}, - resourceserver: { }, - explorer: { }, - activeTab: 1, - hash: null - } - ); - }); - - it('should handle FETCH_CONFIGURATION_EXPLORER_REJECTED', () => { - expect( - configuration(initialState, { - type: constants.FETCH_CONFIGURATION_EXPLORER_REJECTED, - errorMessage: 'ERROR', - payload: {} - }).toJSON() - ).toEqual( - { - loading: false, - error: 'An error occurred while loading the api explorer configuration: ERROR', - record: {}, - resourceserver: { }, - explorer: { }, - activeTab: 1, - hash: null - } - ); - }); - - it('should handle FETCH_CONFIGURATION_EXPLORER_FULFILLED', () => { - expect( - configuration(initialState, { - type: constants.FETCH_CONFIGURATION_EXPLORER_FULFILLED, - payload: { - data: { - id: '/api', - name: 'my-test-api' - } - } - }).toJSON() - ).toEqual( - { - loading: false, - error: null, - record: { }, - resourceserver: { }, - explorer: { - id: '/api', - name: 'my-test-api' - }, - activeTab: 1, - hash: null - } - ); - }); });