New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

neonctl

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

neonctl - npm Package Compare versions

Comparing version 0.0.9 to 0.1.0

2

package.json
{
"name": "neonctl",
"version": "0.0.9",
"version": "0.1.0",
"description": "CLI tool for NeonDB Cloud management",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -22,8 +22,6 @@ "use strict";

const log_1 = require("./log");
// what port to listen on for incoming requests
const CONFIG_LISTEN_PORT = 5555;
// oauth server timeouts
const SERVER_TIMEOUT = 10000;
// where to wait for incoming redirect request from oauth server to arrive
const REDIRECT_URI = 'http://127.0.0.1:5555/callback';
const REDIRECT_URI = (port) => `http://127.0.0.1:${port}/callback`;
// These scopes cannot be cancelled, they are always needed.

@@ -37,6 +35,14 @@ const DEFAULT_SCOPES = ['openid', 'offline'];

const issuer = yield openid_client_1.Issuer.discover(oauthHost);
//
// Start HTTP server and wait till /callback is hit
//
const server = (0, node_http_1.createServer)();
server.listen(0, function () {
log_1.log.info(`Listening on port ${this.address().port}`);
});
const listen_port = server.address().port;
const neonOAuthClient = new issuer.Client({
token_endpoint_auth_method: 'none',
client_id: clientId,
redirect_uris: [REDIRECT_URI],
redirect_uris: [REDIRECT_URI(listen_port)],
response_types: ['code'],

@@ -50,6 +56,3 @@ });

return new Promise((resolve) => {
//
// Start HTTP server and wait till /callback is hit
//
const server = (0, node_http_1.createServer)((request, response) => __awaiter(void 0, void 0, void 0, function* () {
server.on('request', (request, response) => __awaiter(void 0, void 0, void 0, function* () {
var _a;

@@ -66,3 +69,3 @@ //

const params = neonOAuthClient.callbackParams(request);
const tokenSet = yield neonOAuthClient.callback(REDIRECT_URI, params, {
const tokenSet = yield neonOAuthClient.callback(REDIRECT_URI(listen_port), params, {
code_verifier: codeVerifier,

@@ -76,5 +79,2 @@ state,

}));
server.listen(CONFIG_LISTEN_PORT, () => {
log_1.log.info(`Listening on port ${CONFIG_LISTEN_PORT}`);
});
//

@@ -81,0 +81,0 @@ // Open browser to let user authenticate

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