Giter Club home page Giter Club logo

apigee-edge-js's Introduction

apigee-edge-js's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

apigee-edge-js's Issues

issue with sharedflow cleanup ?

Hi,
cleanOldRevisions.js works perfectly for Proxy cleanup but when i try -S (also tried -s) option to do sharedflow cleanup it just looks for proxies to cleanup only and not sharedflows. On OPDK 4.19.05

This is what i am running
/usr/local/bin/node cleanOldRevisions.js -M http://:8080 -n -T -o test -v -K -S 10

Add possibility to specify own LoginBaseUrl

There is a problem to use this module against a on-prem apiee installation. I suggest to add an option to specify customSSOUrl.
Meaning add this to the loginBaseUrl.js file.

module.exports = function getLoginBaseUrl(options) {
if (options.ssoZone) {
return 'https://' + options.ssoZone + '.login.apigee.com';
}
if (options.ssoUrl) {
return options.ssoUrl;
}
if (options.keyfile) {
return 'https://oauth2.googleapis.com/token';
}
if (options.customSSOUrl) {
return options.customSSOUrl;
}

return 'https://login.apigee.com';
};

Cannot read property 'headers' of undefined

I'm running into a weird error that pops up occasionally. I get the following message:

   let isJson = jsonRe.test(response.headers["content-type"]);
                                      ^

TypeError: Cannot read property 'headers' of undefined

I think it might have to do with the library getting a 401 back. I am using sso and an on-prem installation of Apigee. Its really weird because it works sometimes and not others. Any idea what could be causing this?

Refresh token expiry

I was going to do a PR to expose the tokenMgmt module. I was thinking it would be beneficial to be able to tell if the refresh token had expired cause it would be useful to know if you can just use the refresh token or need a whole new token. If I recall the refresh token is valid for 24 hrs after issuing the access_token. Does adding that functionality make sense? If so I can submit a PR

Missing credentials in app (version 0.2.24)

Hello,

First, a big thank you for creating and maintaining this library!

We have an issue with the last version (0.2.24), the 'credentials' property is missing in the app. We don't have any issue with version 0.2.22.

Here is a piece of the code that we use (simplified for readability):

const getApp = function getApp(org, developerEmail, partner) {
  const name = createApigeeAppNameForPartner(partner);

  const options = {
    developerEmail,
    appName: name,
  };

  return org.developerapps.getAsync(options);
};

getApp(org, apigeeDeveloper.email, partner, true)
   .then(app => app.credentials[0].consumerKey); // Cannot read property '0' of undefined

Could you have a look?

Thank you!

Can I use this library with Angular 8 and Nodejs 12

I am trying to create devportal with Angular 8 and Nodejs 12, Can I use this library with the mentioned versions.

While integrating, I am facing these errors :
WARNING in ./node_modules/apigee-edge-js/lib/edge.js 80:39-63 Critical dependency: the request of a dependency is an expression ERROR in ./node_modules/readline-sync/lib/readline-sync.js Module not found: Error: Can't resolve 'child_process' in 'G:\Angular\-app02\node_modules\readline-sync\lib' ERROR in ./node_modules/apigee-edge-js/lib/tokenMgmt.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\apigee-edge-js\lib' ERROR in ./node_modules/apigee-edge-js/lib/keystore.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\apigee-edge-js\lib' ERROR in ./node_modules/apigee-edge-js/lib/reference.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\apigee-edge-js\lib' ERROR in ./node_modules/apigee-edge-js/lib/resourcefile.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\apigee-edge-js\lib' ERROR in ./node_modules/apigee-edge-js/lib/spec.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\apigee-edge-js\lib' ERROR in ./node_modules/apigee-edge-js/lib/deployableAsset.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\apigee-edge-js\lib' ERROR in ./node_modules/apigee-edge-js/node_modules/adm-zip/util/fileSystem.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\apigee-edge-js\node_modules\adm-zip\util' ERROR in ./node_modules/archiver/lib/core.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\archiver\lib' ERROR in ./node_modules/fs.realpath/index.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\fs.realpath' ERROR in ./node_modules/fs.realpath/old.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\fs.realpath' ERROR in ./node_modules/glob/glob.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\glob' ERROR in ./node_modules/glob/sync.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\glob' ERROR in ./node_modules/graceful-fs/graceful-fs.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\graceful-fs' ERROR in ./node_modules/netrc/index.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\netrc' ERROR in ./node_modules/original-fs/index.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\original-fs' ERROR in ./node_modules/readline-sync/lib/readline-sync.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\readline-sync\lib' ERROR in ./node_modules/request/lib/har.js Module not found: Error: Can't resolve 'fs' in 'G:\Angular\-app02\node_modules\request\lib'

If anyone can help with this, that will be very helpful.

Thanks

Issue when using on mfa enable org

Hi,

I am trying to use the library with mfa enabled on the apigee management api and I get following error:

[2020-Nov-20 18:27:49] found no stashed token.
[2020-Nov-20 18:27:49] POST https://login.apigee.com/oauth/token
[2020-Nov-20 18:27:49] status: 401
[2020-Nov-20 18:27:49] result: {"error":"unauthorized","error_description":"Error: Invalid MFA code."}
[2020-Nov-20 18:27:49] POST error: bad status: 401

Since I'm never prompted for an mfa code this makes sense but I cannot figure out where to provide it or how to get prompted for it. An obvious place is in the options of the connect function as 'mfa_code' but the function that generates the oath endpoint simply lacks the mfa_token query param:

url : conn.loginBaseUrl + '/oauth/token'

In addition I believe there to be a bug here (and next line) that prevents the value of mfa_code to be passed from connection options in the first place:

if (arg1.mfa_token) {

This code references arg1.mfa_token instead of arg1.mfa_code so it doesn't get passed to invokeLegacyApigeeTokenEndpoint.

Based on above understanding I fixed this on my local machine. I would be happy to do a pull request if above is indeed correct. I also think this would help other people as I cannot imagine I'm the only one that is affected.

Regards,
Emile Bremmer

Setup of Proxy

Hi,

Is it possible to use a proxy? This is something that is needed when working from a coporate environment.

Cheers,

Bram

The use of stashed tokens

Hi,

How do I use the tokens that are stashed? Just connect without password, mfa_code?

var options = {
      org: organization,
      user: identifier,
      no_token: false
    };
let org = await edge.connect(options);

When I do this, I get a missing password error because the stashed token is null.

Cheers,

Bram Sinke

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.