
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@sebastianboehler/philipshue
Advanced tools
This is a Typescript package that provides a simple and easy-to-use wrapper around the Philips Hue API. It allows you to control your Philips Hue lights and other devices from your code.
npm install @sebastianboehler/philipshue@latest --registry=https://npm.pkg.github.com/
To use the package, import it in your code and create a new instance of the PhilipsHue class:
import PhilipsHue from 'philipsHue'
import express from 'express.js
const port = process.env.PORT || 3000
const redirect_path = `/philipsHue_callback`
const myPhilips = new PhilipsHue({
redirect_uri: `http://localhost:${port}${redirect_path}`,
CLIENT_ID: 'YOUR_CLIENT_ID',
CLIENT_SECRET: 'YOUR_CLIENT_SECRET'
})
const app = express()
app.get('/login', (req, res) => {
const oAuthUrl = myPhilips.getOAuthUrl()
res.redirect(oAuthUrl)
});
app.get(redirect_path, async (req, res) => {
const { code } = req.query
if (!code) {
res.json({
success: false
})
return
}
const success = await myPhilips.getAccessToken(code.toString())
if (success) = await myPhilips.createWhitelistUser()
res.json({
success
})
});
app.get('/scenes', async (req, res) => {
const scenes = await myPhilips.getScenesV2()
res.json(scenes)
});
app.listen(port, () => {
console.log(`Sever listening on port ${port}`)
});
getOAuthurl()
returns your oAuth urlgetAccessToken(code: string, grant_type = 'authorization_code')
stores access token, refresh token and expiration Date inside the classrefreshToken()
renews your access tokencreateWhitelistUser
whitelist your usersetLightState(id: string | number, state: LightStateV1)
lets you change the states of your light, turn them on/off, change color etc.shouldRefreshAccessToken(aboutToExpireInNextSeconds: number = 90)
returns true if your access token is about to expire in next x secondssetGroupState(id: string | number, state: LightStateV1 | {scene: string})
let you control whole groups in your homegetGroups()
returns all groups in your homegetLightsV2()
returns all lights in your homegetGroupsV2()
returns all groups in your homegetScenesV2()
returns all scenesgetSceneDetailsV2()
get a scene by its idgetSmartScenesV2()
returns all smart scenesactivateSceneV2(id: string)
activate a sceneactivateSmartSceneV2(id: string)
activates a smart scenePlease note that not all methods from the V1 and V2 API are supported yet. I'll try to update it as often as possible and extended it by the missing functions.
FAQs
Wrapper around the PhilipsHue REST API
The npm package @sebastianboehler/philipshue receives a total of 1 weekly downloads. As such, @sebastianboehler/philipshue popularity was classified as not popular.
We found that @sebastianboehler/philipshue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.