
Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
node-google-dfp-wrapper
Advanced tools
This project is a wrapper around node-google-dfp aimed at facilitating repeated interactions with the DFP API in a script.
$ npm install node-google-dfp-wrapper
var Dfp = require('node-google-dfp-wrapper');
// These are created by you in the configuration step
var config = require('../local/config')
// These are output by DFP as part of the DFP project authorization step.
var credentials = require('../local/application-creds');
// This is obtained as part of the obtain refresh token step
var refreshToken = config.refreshToken;
var dfp = new Dfp(credentials, config, refreshToken);
For examples of how to use this library, please refer to https://github.com/spanishdict/example-dfp-line-item-generator
These values are created by you, except for refreshToken
. If you do not have one, follow the directions below. Save the file as local/config.json
.
{
"networkCode": "<network code>",
"appName": "<Name of your app>",
"version": "<dfp api version number>",
"refreshToken": "<refresh token>"
}
To obtain your network code from DFP. It can be found in your url after you log in to DFP. For example in https://www.google.com/dfp/1027916#delivery
, the network code is 1027916.
version
is DFP API version. For example v201508
.
Prepare DFP project authorization (local/application-creds.json
). If you do not have one, follow the directions below.
Run:
$ cd node_modules/node-google-dfp-wrapper/
$ node generate-authentication-url.js
Go to the url and give authorization. Copy the auth code.
$ node generate-refresh-token.js --authCode <auth code>
If you are using this package as a dependency and local/application-creds lives in your project you can pass the config path as an arguments as follow:
$ node node_modules/node-google-dfp-wrapper/generate-authentication-url.js --config $(pwd)'/local/application-creds'
$ node node_modules/node-google-dfp-wrapper/generate-refresh-token.js --config $(pwd)'/local/application-creds' --authCode <auth code>
This will output a refresh token.
New Credentials
and then on OAuth client ID
Configure consent screen
and give your project a name.Application type
select Other
and give your client a name.OAuth 2.0 client IDs
and a download icon to the far right. Click that icon to download your cerdentials. Save the file as local/application-creds.json
. It should look like this, (though you may have to format it):{
"installed": {
"client_id": "<client id>",
"project_id": "<project id>",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "<client secret>",
"redirect_uris": [
"urn:ietf:wg:oauth:2.0:oob",
"oob"
]
}
}
FAQs
Simplifies and promisifies calls to node-google-dfp.
The npm package node-google-dfp-wrapper receives a total of 12 weekly downloads. As such, node-google-dfp-wrapper popularity was classified as not popular.
We found that node-google-dfp-wrapper 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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.