auth0-deploy-cli icon indicating copy to clipboard operation
auth0-deploy-cli copied to clipboard

Store JS code in extra files

Open rfalke opened this issue 3 years ago • 2 comments

Describe the problem you'd like to have solved

Place all JS code (for example connection scripts) in separate file. Currently they are inline (both for yaml and json) which makes it harder to diff/work on them.

Describe the ideal solution

Provide an option (or make it the normal behavior) so that all JS code snippets are stored in an extra file.

Alternatives and current work-arounds

The current way of inline storage is ok but no ideal.

Additional context

.../connections/foo.json

{
  "options": {
    "scope": "openid email",
    "scripts": {
      "fetchUserProfile": "function(access_token, ctx, callback) {\n  'use strict';....

.../tenant.yaml

connections:
  - name: foo
    strategy: oauth2
    options:
      scripts:
        fetchUserProfile: |-
          function(access_token, ctx, callback) {
            'use strict';
...

rfalke avatar Feb 08 '22 08:02 rfalke

Appreciate the suggestion, it certainly would lend itself to a better developer experience. For transparency's sake, the roadmap for this project for the next couple quarters is focused on bugs and some high-impact features. So while a good suggestion, not realistically a candidate for development. However, if you're comfortable, I invite you to submit a PR to hasten the process.

willvedd avatar Feb 11 '22 20:02 willvedd

Thanks for the honest feedback.

rfalke avatar Feb 15 '22 13:02 rfalke