Commit Graph

645 Commits

Author SHA1 Message Date
Patrik Oldsberg 63f3b46b86 Merge pull request #8160 from adrianbarwicki/patch-1
feat: expose catalog lib in `plugin-auth-backend`
2021-11-26 16:57:20 +01:00
Fredrik Adelöw de1f77b71c Merge pull request #8233 from backstage/freben/less-cross
🧹  Align on usage of `cross-fetch` vs `node-fetch` in frontend vs backend packages
2021-11-26 10:15:50 +01:00
github-actions[bot] ef34f5de7b Version Packages 2021-11-25 12:40:52 +00:00
Fredrik Adelöw b055a6addc Align on usage of cross-fetch vs node-fetch in frontend vs backend packages
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-11-25 13:05:08 +01:00
Adrian Barwicki 7071dce02d feat: expose catalog lib in plugin-auth-backend
We are writing a custom OIDC provider plugin and need to use CatalogIdentityClient class in our provider. It is however not exported and we are not able to use it.

It is not a problem for providers that are committed to backstage repo as they use the local path, e.g https://github.com/backstage/backstage/blob/master/plugins/auth-backend/src/providers/aws-alb/provider.ts#L31 - but only for the ones that are developed locally.

Signed-off-by: Adrian Barwicki <adrianbarwicki@gmail.com>
2021-11-23 15:17:19 +01:00
Patrik Oldsberg 9f9ff42e28 Merge pull request #8193 from backstage/mod/auth-responses
auth-backend: use more standardized error responses
2021-11-22 17:28:52 +01:00
Patrik Oldsberg 9312572360 auth-backend: use more standardized error responses
Co-authored-by: Johan Haals <johan.haals@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-22 13:17:26 +01:00
Otto Sichert b23bc7f9c3 Change default port of backend to 7007 due to MacOS Control Center update
Signed-off-by: Otto Sichert <git@ottosichert.de>
2021-11-18 16:45:57 +01:00
github-actions[bot] 99bf179ccf Version Packages 2021-11-18 11:52:08 +00:00
Zach Falen 7d6ab03ebb update test
Signed-off-by: Zach Falen <zfalen@deloitte.com>
2021-11-12 13:32:48 -07:00
Zach Falen 8a60033962 hotfix for Backstage token generation, prefer .token over .idToken
Signed-off-by: Zach Falen <zfalen@deloitte.com>
2021-11-12 12:53:13 -07:00
github-actions[bot] 3369ade8c0 Version Packages 2021-11-11 11:07:58 +00:00
Patrik Oldsberg e4989dec38 Merge pull request #7924 from backstage/rugvip/audience
auth-backend: add forwarding of the SAML audience option
2021-11-09 18:13:10 +01:00
Patrik Oldsberg 3e0e2f09d5 auth-backend: add forwarding of the SAML audience option
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-11-09 16:25:34 +01:00
Marcus Eide 00af71a8fc Filter out undefined keys from settings
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-11-09 10:42:21 +01:00
github-actions[bot] d66c5f1282 Version Packages 2021-10-28 14:06:43 +00:00
Patrik Oldsberg c9143d2abe Merge pull request #7409 from RoadieHQ/ch3367
Adopt extra field for OAuth state
2021-10-28 16:01:48 +02:00
blam d465f2e0af chore: bump the msw package and remove it from test-utils as it's not even needed
Signed-off-by: blam <ben@blam.sh>
2021-10-26 17:13:49 +02:00
Nicolas Arnold f18755ee49 Using req instead of state
Signed-off-by: Nicolas Arnold <nic@roadie.io>
2021-10-26 10:27:18 +01:00
Johan Haals f1e96dc5b1 chore/cli: Replace msw with setupRequestMockHandlers
Signed-off-by: Johan Haals <johan.haals@gmail.com>
2021-10-26 10:54:47 +02:00
Nicolas Arnold 8c93478a4e Update api docs
Signed-off-by: Nicolas Arnold <nic@roadie.io>
2021-10-22 15:24:19 +01:00
Nicolas Arnold 7714547af5 Fixing types
Signed-off-by: Nicolas Arnold <nic@roadie.io>
2021-10-22 10:40:37 +01:00
Nicolas Arnold f86173221c Add callback to allow users to override state
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>
2021-10-22 10:33:04 +01:00
Nicolas Arnold 3b767f19c9 Adopt extra field for OAuth state
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>
2021-10-22 10:23:44 +01:00
github-actions[bot] bf5090e59d Version Packages 2021-10-21 13:28:13 +00:00
Patrik Oldsberg 803c5550c5 Merge pull request #7568 from backstage/firestore-keystore
auth-backend: Add Firestore as new key-store provider
2021-10-21 14:43:05 +02:00
Patrik Oldsberg 34da1574a3 auth-backend: rename postgres keystore provider to database
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-10-21 13:48:49 +02:00
Daniel Deloff 727554274e updated api report, adds Atlassian to vocab
Signed-off-by: Daniel Deloff <44780793+rv-ddeloff@users.noreply.github.com>
2021-10-21 07:23:23 -04:00
Marcus Eide 6237e636eb Be more specific when accessing firestore provider config
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-10-21 10:30:29 +02:00
Marcus Eide 7e707db187 Undo making database optional
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-10-21 10:01:12 +02:00
Daniel Deloff cfbe1b97f6 Merge branch 'master' into atlassian-auth
Signed-off-by: Daniel Deloff <44780793+rv-ddeloff@users.noreply.github.com>
2021-10-20 22:10:37 -04:00
Daniel Deloff deda608b2e removes default signin resolver, updates tests
Signed-off-by: Daniel Deloff <44780793+rv-ddeloff@users.noreply.github.com>
2021-10-20 20:53:54 -04:00
Daniel Deloff ce038268c1 feedback fixes
Signed-off-by: Daniel Deloff <44780793+rv-ddeloff@users.noreply.github.com>
2021-10-20 17:15:00 -04:00
Patrik Oldsberg b2687344d8 Merge pull request #7534 from akrantz01/6284/okta-https-audience
Require https audience for Okta authentication
2021-10-20 18:50:57 +02:00
Marcus Eide b294f6056f Wrap operations in a configurable timeout and add method to verify the database connection
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-10-19 16:42:40 +02:00
Patrik Oldsberg 36e67d2f24 more strict error type checking in most packages and backend plugins
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-10-17 15:09:05 +02:00
Marcus Eide 33b9694f5c Add support for more settings
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-10-15 10:38:50 +02:00
Marcus Eide 5ad1f523d5 Make the create function async
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-10-15 10:38:49 +02:00
Marcus Eide d2f755fa73 Update api-reports
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-10-15 10:38:48 +02:00
Marcus Eide 4f4e22d176 Use KeyStores.fromConfig() in router
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-10-15 10:38:47 +02:00
Marcus Eide 12d4abe7b2 Add project dependency to package.json
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-10-15 10:38:43 +02:00
Marcus Eide 16288b6580 Add class that will return a key-store based on application config
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-10-15 10:37:56 +02:00
Marcus Eide 3a62f7619a Add class to use Firestore as a key-store
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-10-15 10:37:56 +02:00
Marcus Eide d8ea1edcdb Add support for auth.keyStore in application config
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-10-15 10:37:56 +02:00
Crevil de3e26aecc Fix refresh reuse bug in Github provider
Currently when the Github provider refreshes an access token it doesn't forward
the new refresh token to the caller. As Github only allows refresh tokens to be
used once, the next refresh call will fail.

This change fixes the bug by returning the new refresh token upon refresh.

This change is similar to 25a613bdd7 (#7110) for
the GitLab provider.

Signed-off-by: Crevil <bjoern.soerensen@gmail.com>
2021-10-14 21:26:43 +02:00
github-actions[bot] 4c840cebfa Version Packages 2021-10-14 12:45:08 +00:00
Daniel Deloff 93f6d19f7f updates api reports
Signed-off-by: Daniel Deloff <44780793+rv-ddeloff@users.noreply.github.com>
2021-10-13 08:23:37 -04:00
Alex Krantz e2039ef99a fix: add comment for clarification and require full scheme
Signed-off-by: Alex Krantz <alex@krantz.dev>
2021-10-12 10:29:18 -07:00
Daniel Deloff 471b212f85 merged in master
Signed-off-by: Daniel Deloff <44780793+rv-ddeloff@users.noreply.github.com>
2021-10-12 11:54:27 -04:00
Daniel Deloff 1f58e63bcc updates test
Signed-off-by: Daniel Deloff <44780793+rv-ddeloff@users.noreply.github.com>
2021-10-12 11:35:40 -04:00