Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@adv-ui/ij-axios-interceptor

Package Overview
Dependencies
Maintainers
70
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adv-ui/ij-axios-interceptor - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

28

CHANGELOG.md
# CHANGELOG
# 1.3.0 (2023-06-19)
# 1.4.0 (2023-09-12)

@@ -8,29 +8,5 @@

* **axios-interceptor:** Remove cancelToken deprecated behaviour ([cc7602f](https://github.mpi-internal.com/scmspain/frontend-jobs--common/commit/cc7602fe068dbfe42642088204bd880f37ad38d6))
* **axios-interceptor:** rename prepare script to prepublishOnly ([9d4bb43](https://github.mpi-internal.com/scmspain/frontend-jobs--common/commit/9d4bb43f474238bdc02b28d203e000337580cad9))
# 1.2.0 (2023-06-07)
### Features
* **axios-interceptor:** New release in axios interceptor ([e458a7a](https://github.mpi-internal.com/scmspain/frontend-jobs--common/commit/e458a7abf1e8dfddeeda91e07521856f8e7d6df1))
# 1.1.0 (2023-06-06)
### Features
* **axios-interceptor:** Add test in filtering paths and adapt names of the filed and methods ([e305457](https://github.mpi-internal.com/scmspain/frontend-jobs--common/commit/e305457d4b8331c03dbfac563819eee7dc55daab))
* **axios-interceptor:** Create new axios interceptor package with new method ([39f03cb](https://github.mpi-internal.com/scmspain/frontend-jobs--common/commit/39f03cbaa8f1e3b626bf60e405be6bf96f54480e))
* **axios-interceptor:** PI-61754: Extract logic getIfPathAllowed in other file ([0b86372](https://github.mpi-internal.com/scmspain/frontend-jobs--common/commit/0b86372d0b1e743959aeef2646e7f10378e5fd86))
* **axios-interceptor:** Trying test(wip) ([53dd964](https://github.mpi-internal.com/scmspain/frontend-jobs--common/commit/53dd964df2f3245af774b71648108cf3f0fd9213))
* **Root:** Change README title ([b3cc197](https://github.mpi-internal.com/scmspain/frontend-jobs--common/commit/b3cc197f6d2f62ecd3a3f354000960f014c42716))
* **Root:** Mock requests with httpMock ([2d91fa9](https://github.mpi-internal.com/scmspain/frontend-jobs--common/commit/2d91fa9246df21d910be7c33b79c75b445f2999d))
* **Root:** test typo ([9897b7c](https://github.mpi-internal.com/scmspain/frontend-jobs--common/commit/9897b7c5fd1641544dc027f9c9ac85378b8c9063))

4

package.json
{
"name": "@adv-ui/ij-axios-interceptor",
"version": "1.3.0",
"version": "1.4.0",
"description": "Axios interceptor",

@@ -9,3 +9,3 @@ "main": "lib/index.js",

"lib": "npx rimraf ./lib && npx mkdirp ./lib && babel --presets sui ./src --out-dir ./lib",
"prepare": "npm run lib",
"prepublishOnly": "npm run lib",
"test": "NODE_ENV=development sui-test browser",

@@ -12,0 +12,0 @@ "test:ci": "npm run test -- --ci",

@@ -22,2 +22,7 @@ import {expect} from 'chai'

mocker.httpMock('http://test.com').get('/test').reply({}, 200)
mocker.httpMock('http://test.com').get('/test?page=1').reply({}, 200)
mocker
.httpMock('http://test.com')
.get('/test?page=1&limit=10')
.reply({}, 200)
mocker.httpMock('http://test.com').get('/test/:id').reply({}, 200)

@@ -76,3 +81,13 @@ mocker.httpMock('http://test.com').get('/test/:id/detail').reply({}, 200)

const expectRequestPage = await fetcher
.get('http://test.com/test?page=1')
.then(data => data)
const expectRequestPageLimit = await fetcher
.get('http://test.com/test?page=1&limit=10')
.then(data => data)
expect(expectRequest.status).to.eq(200)
expect(expectRequestPage.status).to.eq(200)
expect(expectRequestPageLimit.status).to.eq(200)
})

@@ -207,3 +222,3 @@ })

const expectError2 = await fetcher
const expectDetailError = await fetcher
.get('http://test.com/test/123/detail')

@@ -214,4 +229,36 @@ .catch(error => error.message)

expect(expectError).to.eq('Request aborted')
expect(expectError2).to.eq('Request aborted')
expect(expectDetailError).to.eq('Request aborted')
})
it('should allow the requests if the tenant is in the filterTenantPaths and the path match perfectly with the wildcard in the white list', async () => {
const currentTenant = 'infojobs'
const filterTenantPaths = [
{
tenant: 'infojobs',
allowedPathsList: [{path: '/test/*'}]
}
]
axiosInterceptor.setBlockingInterceptor({
fetcher,
currentTenant,
filterTenantPaths
})
const expectRequest = await fetcher
.get('http://test.com/test/123')
.then(data => data)
const expectError = await fetcher
.get('http://test.com/test')
.catch(error => error.message)
const expectRequestDetail = await fetcher
.get('http://test.com/test/123/detail')
.then(data => data)
expect(expectRequest.status).to.eq(200)
expect(expectError).to.eq('Request aborted')
expect(expectRequestDetail.status).to.eq(200)
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc