-
Notifications
You must be signed in to change notification settings - Fork 332
[SQSERVICES-1770] Register OAuth App (1/n) #2882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6e907ac
f673155
d5311f4
644fb2a
e5e3f8f
0c7887a
c38a5f4
9a74a06
942f1fa
b4dc360
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| New internal endpoint to register OAuth clients | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -377,6 +377,14 @@ nginx_conf: | |
| envs: | ||
| - all | ||
| disable_zauth: true | ||
| - path: /oauth/clients/([^/]*)$ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably should add that part to the changelog entry as well. |
||
| envs: | ||
| - all | ||
| - path: i/oauth/clients$ | ||
| envs: | ||
| - staging | ||
| disable_zauth: true | ||
| basic_auth: true | ||
| galley: | ||
| - path: /conversations/code-check | ||
| disable_zauth: true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,7 @@ module Data.Id | |
| RequestId (..), | ||
| BotId (..), | ||
| NoId, | ||
| OAuthClientId, | ||
| ) | ||
| where | ||
|
|
||
|
|
@@ -87,7 +88,7 @@ import Servant (FromHttpApiData (..), ToHttpApiData (..)) | |
| import Test.QuickCheck | ||
| import Test.QuickCheck.Instances () | ||
|
|
||
| data IdTag = A | C | I | U | P | S | T | STo | ||
| data IdTag = A | C | I | U | P | S | T | STo | OAuthClient | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i like how the names get exponentially longer over time. :)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a reason you're not just using a new type
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| idTagName :: IdTag -> Text | ||
| idTagName A = "Asset" | ||
|
|
@@ -98,6 +99,7 @@ idTagName P = "Provider" | |
| idTagName S = "Service" | ||
| idTagName T = "Team" | ||
| idTagName STo = "ScimToken" | ||
| idTagName OAuthClient = "OAuthClient" | ||
|
|
||
| class KnownIdTag (t :: IdTag) where | ||
| idTagValue :: IdTag | ||
|
|
@@ -118,6 +120,8 @@ instance KnownIdTag 'T where idTagValue = T | |
|
|
||
| instance KnownIdTag 'STo where idTagValue = STo | ||
|
|
||
| instance KnownIdTag 'OAuthClient where idTagValue = OAuthClient | ||
|
|
||
| type AssetId = Id 'A | ||
|
|
||
| type InvitationId = Id 'I | ||
|
|
@@ -136,6 +140,8 @@ type TeamId = Id 'T | |
|
|
||
| type ScimTokenId = Id 'STo | ||
|
|
||
| type OAuthClientId = Id 'OAuthClient | ||
|
|
||
| -- Id ------------------------------------------------------------------------- | ||
|
|
||
| data NoId = NoId deriving (Eq, Show, Generic) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| {-# LANGUAGE QuasiQuotes #-} | ||
|
|
||
| -- This file is part of the Wire Server implementation. | ||
| -- | ||
| -- Copyright (C) 2022 Wire Swiss GmbH <opensource@wire.com> | ||
| -- | ||
| -- This program is free software: you can redistribute it and/or modify it under | ||
| -- the terms of the GNU Affero General Public License as published by the Free | ||
| -- Software Foundation, either version 3 of the License, or (at your option) any | ||
| -- later version. | ||
| -- | ||
| -- This program is distributed in the hope that it will be useful, but WITHOUT | ||
| -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
| -- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
| -- details. | ||
| -- | ||
| -- You should have received a copy of the GNU Affero General Public License along | ||
| -- with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
|
||
| module V74_AddOAuthClientTable | ||
| ( migration, | ||
| ) | ||
| where | ||
|
|
||
| import Cassandra.Schema | ||
| import Imports | ||
| import Text.RawString.QQ | ||
|
|
||
| migration :: Migration | ||
| migration = | ||
| Migration 74 "Add table for OAuth clients" $ do | ||
| schema' | ||
| [r| | ||
| CREATE TABLE IF NOT EXISTS oauth_client | ||
| ( id uuid PRIMARY KEY | ||
| , name text | ||
| , redirect_uri blob | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. text? (same for secrect)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe, I did this according to other table columns with the same Haskell types.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. then we should probably keep it as is for consistency. |
||
| , secret blob | ||
| ) | ||
| |] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ import qualified Brig.API.Connection as API | |
| import Brig.API.Error | ||
| import Brig.API.Handler | ||
| import Brig.API.MLS.KeyPackages.Validation | ||
| import Brig.API.OAuth (IOAuthAPI, internalOauthAPI) | ||
| import Brig.API.Types | ||
| import qualified Brig.API.User as API | ||
| import qualified Brig.API.User as Api | ||
|
|
@@ -105,14 +106,24 @@ import Wire.API.User.RichInfo | |
| -- Sitemap (servant) | ||
|
|
||
| servantSitemap :: | ||
| Members | ||
| '[ BlacklistStore, | ||
| GalleyProvider, | ||
| UserPendingActivationStore p | ||
| ] | ||
| r => | ||
| ServerT (BrigIRoutes.API :<|> IOAuthAPI) (Handler r) | ||
| servantSitemap = brigInternalAPI :<|> internalOauthAPI | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not add same for public api. |
||
|
|
||
| brigInternalAPI :: | ||
| Members | ||
| '[ BlacklistStore, | ||
| GalleyProvider, | ||
| UserPendingActivationStore p | ||
| ] | ||
| r => | ||
| ServerT BrigIRoutes.API (Handler r) | ||
| servantSitemap = | ||
| brigInternalAPI = | ||
| ejpdAPI | ||
| :<|> accountAPI | ||
| :<|> mlsAPI | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.