-
Notifications
You must be signed in to change notification settings - Fork 392
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
CB-4039 logout with context #2296
Merged
Merged
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1dc6a11
CB-4039 build logout redirect link on backend side
alexander-skoblikov 476f297
Merge branch 'devel' into CB-4039-logout-with-context
5585b07
CB-4039 fix return value
alexander-skoblikov 2f2c214
Merge branch 'devel' into CB-4039-logout-with-context
5602f68
CB-4039 adds logout with context for Okta Identity Provider
18be424
CB-4039 backward compatibility fix
alexander-skoblikov 121883d
Merge branch 'devel' into CB-4039-logout-with-context
dfea9e7
CB-4039 add since annotation
alexander-skoblikov a547a29
CB-4039 api return type fix
alexander-skoblikov 2d943a5
CB-4039 logout extended
1f6f9f3
Merge branch 'devel' into CB-4039-logout-with-context
38341af
CB-4039 okta logout redirect moved to AuthenticationService
b08cfa1
CB-4039 remove windowService dep
e20314e
CB-4039 removes old logic of identity provider logout links
3e4587c
CB-4039 okta review changes
afe11af
Merge branch 'devel' into CB-4039-logout-with-context
dariamarutkina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...er/bundles/io.cloudbeaver.service.auth/src/io/cloudbeaver/service/auth/WebLogoutInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* DBeaver - Universal Database Manager | ||
* Copyright (C) 2010-2024 DBeaver Corp and others | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.cloudbeaver.service.auth; | ||
|
||
import org.jkiss.code.NotNull; | ||
|
||
import java.util.List; | ||
|
||
public record WebLogoutInfo(@NotNull List<String> redirectLinks) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 5 additions & 9 deletions
14
webapp/packages/core-sdk/src/queries/authentication/authLogout.gql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
query authLogout( | ||
$provider: ID | ||
$configuration: ID | ||
) { | ||
authLogout( | ||
provider: $provider | ||
configuration: $configuration | ||
) | ||
} | ||
query authLogout($provider: ID, $configuration: ID) { | ||
authLogoutExtended(provider: $provider, configuration: $configuration) { | ||
redirectLinks | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { getUniqueId } from './getUniqueId'; | ||
|
||
describe('getUniqueId', () => { | ||
const uniqueIdsCount = 100; | ||
|
||
it('should return unique ids', () => { | ||
const ids = new Set(); | ||
for (let i = 0; i < uniqueIdsCount; i++) { | ||
ids.add(getUniqueId()); | ||
} | ||
expect(ids.size).toBe(uniqueIdsCount); | ||
}); | ||
|
||
it('should return unique ids in parallel', async () => { | ||
const ids = new Set(); | ||
const promises = []; | ||
for (let i = 0; i < uniqueIdsCount; i++) { | ||
promises.push( | ||
new Promise(resolve => { | ||
setTimeout(() => { | ||
ids.add(getUniqueId()); | ||
resolve(true); | ||
}, Math.random() * 100); | ||
}), | ||
); | ||
} | ||
await Promise.all(promises); | ||
expect(ids.size).toBe(uniqueIdsCount); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function getNextIdGenerator() { | ||
let id = 0; | ||
return () => id++; | ||
} | ||
|
||
const getNextId = getNextIdGenerator(); | ||
|
||
export function getUniqueId() { | ||
return getNextId(); | ||
} | ||
Wroud marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not clear what
Extended
suffix means especially if we will removeauthLogout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alexander decided
authLogout
function to be for a while for back backward compatibility. so this is why we have new function withExtended
suffixThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
problem is that
Extended
means nothing this is not good suffix for apiauthLogoutInfo
sound better