Commit Graph

460 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 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 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
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
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
Patrik Oldsberg c9143d2abe Merge pull request #7409 from RoadieHQ/ch3367
Adopt extra field for OAuth state
2021-10-28 16:01:48 +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
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
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 4f4e22d176 Use KeyStores.fromConfig() in router
Signed-off-by: Marcus Eide <eide@spotify.com>
2021-10-15 10:38:47 +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
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
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
Daniel Deloff 044a4511eb adds docs, fixes plugin
Signed-off-by: Daniel Deloff <44780793+rv-ddeloff@users.noreply.github.com>
2021-10-12 11:30:12 -04:00
Daniel Deloff 5cb4d2eabc updates scope configuration
Signed-off-by: Daniel Deloff <44780793+rv-ddeloff@users.noreply.github.com>
2021-10-11 16:46:01 -04:00
Daniel Deloff 037447efd3 adds atlassian auth provider
Signed-off-by: Daniel Deloff <44780793+rv-ddeloff@users.noreply.github.com>
2021-10-11 15:05:21 -04:00
Fredrik Adelöw a9564f20a9 Merge pull request #7380 from mfrinnstrom/aws-alb-auth-backend
Update aws-alb auth provider
2021-10-11 20:58:19 +02:00
Alex Krantz 4611d59fdc fix: require https for Okta audience URL
Signed-off-by: Alex Krantz <alex@krantz.dev>
2021-10-09 17:30:11 -07:00
Fredrik Adelöw 4da03bd4a5 Merge pull request #7496 from Dolinskaya/add-extra-params-for-saml-provider
Added extra configuration params for saml adfs identity
2021-10-08 14:07:13 +02:00
Mattias Frinnström f29ad9fe6d Update api-report.md
Signed-off-by: Mattias Frinnström <mattias.frinnstrom@husqvarnagroup.com>
2021-10-07 16:43:05 +02:00
Mattias Frinnström 0de80576e3 auth-backend: update aws-alb provider
Signed-off-by: Mattias Frinnström <mattias.frinnstrom@husqvarnagroup.com>
2021-10-07 16:43:05 +02:00
gracheva defae8f579 Added extra configuration params for saml adfs identity
Signed-off-by: gracheva <gracheva@tutu.tech>
2021-10-07 16:12:39 +03:00
Johan Haals 604987599e chore: Adds missing method to mocked catalog APIs
Signed-off-by: Johan Haals <johan.haals@gmail.com>
2021-10-06 09:12:35 +02:00
Patrik Oldsberg 69e40c00b2 auth-backend: remove default bitbucket sign-in provider
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-10-05 18:35:37 +02:00
Patrik Oldsberg c2512887a6 Merge pull request #7308 from FilipSwiatczak/bitbucket-auth
Bitbucket cloud authentication
2021-10-05 17:06:42 +02:00
Filip Swiatczak ad7bfe6810 dropped display name Resolver, uuid -> user-id
Signed-off-by: Filip Swiatczak <filip.swiatczak@gmail.com>
2021-10-01 17:05:48 +01:00
Filip Swiatczak ed52838471 Resolvers: Username, DisplayName, UUID added. Default removed
Signed-off-by: Filip Swiatczak <filip.swiatczak@gmail.com>
2021-09-30 21:11:00 +01:00
Filip Swiatczak 7105058bac bitbucket typed.d.ts added
Signed-off-by: Filip Swiatczak <filip.swiatczak@gmail.com>
2021-09-30 10:30:47 +01:00