This is a slightly different implementation. It allows the user to pass in a reference to a callback so that the state
can be set. It was a suggestion from @Rugvip on a discussion we had offline.
The callback is an async function that returns a Promise<string>
Note: due to the way the OAuthAdapter works, this callback must include an env + nonce. Without them, your oauth request will fail.
Signed-off-by: Nicolas Arnold <nic@roadie.io>
Currently, the OAuth state is very limited. It only accepts three field:
* env
* nonce
* origin
This does not give the user much flexibility when passing in other fields to the state. Origin is set based on the window location.
Env determined by the running environment of backstage. Nonce, randomly generated every time.
If a user wanted to verify other fields in the state, they would be unable to do so.
For example, let's say you have a GitHub app that serves multiple installations. In order for this to work you need a middle service between github and backstage.
This service needs to programaticaly determine where to redirect the requests to (GitHub apps only allow one redirect url).
Your intermediate service requires you to redirect to other paths on backstage based on the type of request the Github ap
p receives.
By adding in the `extraState` to the Github Provider Options, this can now be achieved. You can set the field to `{'redirect_url': '/some/path/to/redirect/to'}` to complete
the OAuth flow.
Although this is a very specific use case, I believe this will be useful across all the providers.
Signed-off-by: Nicolas Arnold <nic@roadie.io>
When the `--path` argument is specified, then perform the create-app templating
directly to that path. Otherwise, template to a temporary directory, and move
the files to a directory based on the project name.
Removed the `cleanUp` method in favor of removing temporary files directly in
the `moveApp` method in a `finally` block.
Reverted `moveApp` method to use the move operation instead ofe recursively
copying files.
Signed-off-by: Colton Padden <colton.padden@fastmail.com>
The ability to set file mode was introduced in octokit-plugin-create-pull-request:v3.10.
This PR updates the underlying octokit-plugin-create-pull-request
version to 3.10, and sets the file mode when creating the pull request.
Signed-off-by: Kenneth Feng <kenneth.feng@onepeloton.com>
When navigating between pages using the primary sidebar navigation menu,
scroll to the top of the generated markdown content via
`.scrollIntoView()`.
Signed-off-by: Colton Padden <colton.padden@fastmail.com>