JSPM_GITHUB_AUTH_TOKEN as header

316 views Asked by At

I am having trouble with a github alert that is telling me the following:

"On September 11th, 2020 at 18:16 (UTC) your personal access token (JSPM_PRUEBA) using jspm was used as part of a query parameter to access an endpoint through the GitHub API: Please use the Authorization HTTP header instead, as using the access_token query parameter is deprecated. If this token is being used by an app you don't have control over, be aware that it may stop working as a result of this deprecation."

The alert it is being triggered when I am doing a jspm install through a docker image that generates the dist folder with an npm install and then a jspm install inside it. The docker is being provided with a parameter JSPM_GITHUB_AUTH_TOKEN with a github PAT that is being generate and later obtained using:

jspm registry config github jspm registry export github

I believe this is working fine because the alert is showing the right PAT name "JSPM_PRUEBA".

The actual question is, what is what I need to configure to include the access_token as a header and not as a query param while pulling the jspm dependencies.

Need some help please.

package.son

    {
      "name": "aleph-media-ui",
      "version": "1.0.0",
      "description": "aleph-media-ui",
      "main": "app/app.js",
      "scripts": {
        "postinstall": "sh configure.sh"
      },
      "moduleConfig": {
        "mainJs": "app/app.js",
        "source": "app/**/*.js",
        "templates": "app/**/*.html",
        "sass": [
          "styles/**/*.scss",
          "styles/**/*.css"
        ],
        "output": "dist/",
        "build": "build/",
        "port": "18093"
      },
      "jspm": {
        "registry": "jspm",
        "directories": {
          "lib": "build"
        },
        "dependencies": {
          "angular": "github:angular/[email protected]",
          "angular-bootstrap": "bower:[email protected]",
          "angular-encode-uri": "bower:angular-encode-uri@^1.0.0",
          "angular-environment": "npm:angular-environment@^1.0.8",
          "angular-material": "github:angular/[email protected]",
          "angular-messages": "npm:angular-messages@^1.4.9",
          "angular-resource": "github:angular/[email protected]",
          "angular-route": "github:angular/[email protected]",
          "angular-ui-mask": "bower:angular-ui-mask@^1.8.3",
          "angular-ui-router": "github:angular-ui/[email protected]",
          "clean-css": "npm:[email protected]",
          "css": "github:systemjs/[email protected]",
          "jquery": "github:components/[email protected]",
          "module-crud-ui": "npm-redbee:[email protected]",
          "module-layout-ui": "npm-redbee:[email protected]",
          "module-security-ui": "npm-redbee:[email protected]",
          "remarkable-bootstrap-notify": "bower:remarkable-bootstrap-notify@^3.1.3"
        },
        "devDependencies": {
          "babel": "npm:babel-core@^5.8.24",
          "babel-runtime": "npm:babel-runtime@^5.8.24",
          "core-js": "npm:core-js@^1.1.4"
        }
      },
      "publishConfig": {
        "registry": "https://nexus.uat.aleph.turner.com/repository/npm-redbee"
      },
      "devDependencies": {
        "babel-core": "^5.8.22",
        "browser-sync": "^2.9.3",
        "del": "^1.2.1",
        "gulp": "^3.9.0",
        "gulp-angular-templatecache": "^1.7.0",
        "gulp-babel": "^5.2.1",
        "gulp-cached": "^1.1.0",
        "gulp-cdnify": "^1.0.3-pre",
        "gulp-changed": "^1.3.0",
        "gulp-css-base64": "^1.3.2",
        "gulp-img64": "0.0.6",
        "gulp-inject": "^3.0.0",
        "gulp-jshint": "^1.11.2",
        "gulp-minify-html": "^1.0.4",
        "gulp-ng-annotate": "^1.1.0",
        "gulp-plumber": "^1.0.1",
        "gulp-replace-task": "^0.11.0",
        "gulp-run": "^1.6.10",
        "gulp-sass": "^2.0.4",
        "gulp-sonar": "^1.0.3",
        "gulp-sourcemaps": "^1.5.2",
        "gulp-strip-code": "^0.1.2",
        "gulp-uglify": "^1.4.1",
        "gulp-util": "^3.0.6",
        "isparta": "^3.0.3",
        "istanbul": "^0.3.18",
        "jasmine-core": "^2.3.4",
        "jshint-stylish": "^2.0.1",
        "jspm": "^0.16.1",
        "jspm-bower-endpoint": "^0.3.2",
        "karma": "^0.13.9",
        "karma-babel-preprocessor": "^5.2.1",
        "karma-chrome-launcher": "^0.2.0",
        "karma-coverage": "^0.5.0",
        "karma-jasmine": "^0.3.6",
        "karma-jspm": "^2.0.1",
        "karma-junit-reporter": "^0.3.4",
        "karma-phantomjs-launcher": "^0.2.1",
        "karma-sourcemap-loader": "^0.3.5",
        "phantomjs": "^1.9.18",
        "proxy-middleware": "^0.14.0",
        "require-dir": "^0.3.0",
        "run-sequence": "^1.1.2",
        "url": "^0.11.0",
        "vinyl-paths": "^1.0.0",
        "angular-environment": "^1.0.8"
      }
    }

config.js

System.config({
  baseURL: "/",
  defaultJSExtensions: true,
  transpiler: "babel",
  babelOptions: {
    "optional": [
      "runtime",
      "optimisation.modules.system"
    ]
  },
  paths: {
    "app/*": "dist/app/*",
    "github:*": "jspm_packages/github/*",
    "npm:*": "jspm_packages/npm/*",
    "npm-redbee:*": "jspm_packages/npm-redbee/*",
    "bower:*": "jspm_packages/bower/*"
  },

  map: {
    "angular": "github:angular/[email protected]",
    "angular-bootstrap": "bower:[email protected]",
    "angular-encode-uri": "bower:[email protected]",
    "angular-environment": "npm:[email protected]",
    "angular-material": "github:angular/[email protected]",
    "angular-messages": "npm:[email protected]",
    "angular-resource": "github:angular/[email protected]",
    "angular-route": "github:angular/[email protected]",
    "angular-ui-mask": "bower:[email protected]",
    "angular-ui-router": "github:angular-ui/[email protected]",
    "babel": "npm:[email protected]",
    "babel-runtime": "npm:[email protected]",
    "bootstrap-sweetalert": "bower:[email protected]",
    "clean-css": "npm:[email protected]",
    "core-js": "npm:[email protected]",
    "css": "github:systemjs/[email protected]",
    "jquery": "github:components/[email protected]",
    "module-crud-ui": "npm-redbee:[email protected]",
    "module-layout-ui": "npm-redbee:[email protected]",
    "module-security-ui": "npm-redbee:[email protected]",
    "remarkable-bootstrap-notify": "bower:[email protected]",
    "bower:[email protected]": {
      "angular": "bower:[email protected]"
    },
    "bower:[email protected]": {
      "angular": "bower:[email protected]"
    },
    "bower:[email protected]": {
      "angular": "bower:[email protected]"
    },
    "bower:[email protected]": {
      "angular": "bower:[email protected]"
    },
    "bower:[email protected]": {
      "angular": "bower:[email protected]",
      "css": "github:systemjs/[email protected]"
    },
    "bower:[email protected]": {
      "angular": "bower:[email protected]"
    },
    "bower:[email protected]": {
      "css": "github:systemjs/[email protected]"
    },
    "bower:[email protected]": {
      "jquery": "bower:[email protected]"
    },
    "bower:[email protected]": {
      "css": "github:systemjs/[email protected]"
    },
    "bower:[email protected]": {
      "bootstrap": "bower:[email protected]",
      "jquery": "bower:[email protected]"
    },
    "github:angular-translate/[email protected]": {
      "angular-translate": "github:angular-translate/[email protected]"
    },
    "github:angular-translate/[email protected]": {
      "angular": "github:angular/[email protected]"
    },
    "github:angular-ui/[email protected]": {
      "angular": "github:angular/[email protected]"
    },
    "github:angular/[email protected]": {
      "angular": "github:angular/[email protected]"
    },
    "github:angular/[email protected]": {
      "angular": "github:angular/[email protected]"
    },
    "github:angular/[email protected]": {
      "angular": "github:angular/[email protected]"
    },
    "github:angular/[email protected]": {
      "angular": "github:angular/[email protected]"
    },
    "github:angular/[email protected]": {
      "angular": "github:angular/[email protected]"
    },
    "github:angular/[email protected]": {
      "angular": "github:angular/[email protected]"
    },
    "github:angular/[email protected]": {
      "angular": "github:angular/[email protected]"
    },
    "github:angular/[email protected]": {
      "angular": "github:angular/[email protected]",
      "angular-animate": "github:angular/[email protected]",
      "angular-aria": "github:angular/[email protected]",
      "css": "github:systemjs/[email protected]"
    },
    "github:angular/[email protected]": {
      "angular": "github:angular/[email protected]",
      "angular-animate": "github:angular/[email protected]",
      "angular-aria": "github:angular/[email protected]",
      "css": "github:systemjs/[email protected]"
    },
    "github:chieffancypants/[email protected]": {
      "angular": "github:angular/[email protected]",
      "css": "github:systemjs/[email protected]"
    },
    "github:jspm/[email protected]": {
      "assert": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "buffer": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "events": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "Base64": "npm:[email protected]",
      "events": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "stream": "github:jspm/[email protected]",
      "url": "github:jspm/[email protected]",
      "util": "github:jspm/[email protected]"
    },
    "github:jspm/[email protected]": {
      "https-browserify": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "os-browserify": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "path-browserify": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "process": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "stream-browserify": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "url": "npm:[email protected]"
    },
    "github:jspm/[email protected]": {
      "util": "npm:[email protected]"
    },
    "npm-redbee:[email protected]": {
      "angular": "github:angular/[email protected]",
      "angular-mocks": "github:angular/[email protected]",
      "angular-resource": "github:angular/[email protected]",
      "angular-route": "github:angular/[email protected]",
      "angular-ui-router": "github:angular-ui/[email protected]"
    },
    "npm-redbee:[email protected]": {
      "angular": "github:angular/[email protected]",
      "angular-bootstrap": "bower:[email protected]",
      "angular-cookies": "github:angular/[email protected]",
      "angular-growl-v2": "bower:[email protected]",
      "angular-loading-bar": "github:chieffancypants/[email protected]",
      "angular-material": "github:angular/[email protected]",
      "angular-sanitize": "github:angular/[email protected]",
      "angular-translate": "github:angular-translate/[email protected]",
      "angular-translate-loader-static-files": "github:angular-translate/[email protected]",
      "angular-ui-router": "github:angular-ui/[email protected]",
      "angular-utils-ui-breadcrumbs": "bower:[email protected]",
      "bootstrap-sweetalert": "bower:[email protected]",
      "clean-css": "npm:[email protected]",
      "css": "github:systemjs/[email protected]",
      "jquery": "github:components/[email protected]",
      "material-design-iconic-font": "bower:[email protected]"
    },
    "npm-redbee:[email protected]": {
      "angular-cookies": "bower:[email protected]",
      "angular-uuid": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "fs": "github:jspm/[email protected]",
      "module": "github:jspm/[email protected]",
      "path": "github:jspm/[email protected]",
      "process": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "util": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "process": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "base64-js": "npm:[email protected]",
      "child_process": "github:jspm/[email protected]",
      "fs": "github:jspm/[email protected]",
      "ieee754": "npm:[email protected]",
      "isarray": "npm:[email protected]",
      "process": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "commander": "npm:[email protected]",
      "fs": "github:jspm/[email protected]",
      "http": "github:jspm/[email protected]",
      "https": "github:jspm/[email protected]",
      "os": "github:jspm/[email protected]",
      "path": "github:jspm/[email protected]",
      "process": "github:jspm/[email protected]",
      "source-map": "npm:[email protected]",
      "url": "github:jspm/[email protected]",
      "util": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "child_process": "github:jspm/[email protected]",
      "events": "github:jspm/[email protected]",
      "fs": "github:jspm/[email protected]",
      "graceful-readlink": "npm:[email protected]",
      "path": "github:jspm/[email protected]",
      "process": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "fs": "github:jspm/[email protected]",
      "path": "github:jspm/[email protected]",
      "process": "github:jspm/[email protected]",
      "systemjs-json": "github:systemjs/[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "fs": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "http": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "util": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "os": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "process": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "assert": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "process": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]",
      "core-util-is": "npm:[email protected]",
      "events": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "isarray": "npm:[email protected]",
      "process": "github:jspm/[email protected]",
      "stream-browserify": "npm:[email protected]",
      "string_decoder": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "amdefine": "npm:[email protected]",
      "process": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "events": "github:jspm/[email protected]",
      "inherits": "npm:[email protected]",
      "readable-stream": "npm:[email protected]"
    },
    "npm:[email protected]": {
      "buffer": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "assert": "github:jspm/[email protected]",
      "punycode": "npm:[email protected]",
      "querystring": "npm:[email protected]",
      "util": "github:jspm/[email protected]"
    },
    "npm:[email protected]": {
      "inherits": "npm:[email protected]",
      "process": "github:jspm/[email protected]"
    }
  }
});
1

There are 1 answers

3
Bertrand Martel On

Most likely, your are using an older version of the jspm github package. From the source code, it seems that it used the access_token query parameter in version < 1.0.0.

For instance, 0.13.20 version used the access_token query parameter contrary the newest package version (any version after 1.0.0)

It also seems that the package name has changed from jspm-github to @jspm/github for version >= 1.0.0. So you may just need to use the new @jspm/github package instead