Repository navigation
Feat/tap 11883 token url #633
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c5d8db2
feat(TAP-11883): send auth via Bearer instead of URL tokens
weiliang110100 d99e48b
revert(TAP-11883): read SAML callback access_token from URL
weiliang110100 33542e2
revert(TAP-11883): restore SAML ACS access_token redirect
weiliang110100 2f688dd
fix(TAP-11883): keep SAML access_token out of callback and logout URLs
weiliang110100 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,15 +1,14 @@ | ||
| import Cookie from '@tap/shared/src/cookie' | ||
| import { downloadAuthenticated } from './download' | ||
| import Http from './Http' | ||
|
|
||
| export default class JavascriptFunctions extends Http { | ||
| constructor() { | ||
| super('/api/Javascript_functions') | ||
| } | ||
| export(ids) { | ||
| const href = `${ | ||
| this.url | ||
| }/batch/load?id=${ids.join('&id=')}&access_token=${Cookie.get('access_token')}` | ||
| window.open(href) | ||
| return downloadAuthenticated( | ||
| `${this.url}/batch/load?id=${ids.join('&id=')}`, | ||
| ) | ||
| } | ||
| } | ||
| export { JavascriptFunctions } |
This file contains hidden or 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 hidden or 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,15 +1,14 @@ | ||
| import Cookie from '@tap/shared/src/cookie' | ||
| import { downloadAuthenticated } from './download' | ||
| import Http from './Http' | ||
|
|
||
| export default class PythonFunctions extends Http { | ||
| constructor() { | ||
| super('/api/python-functions') | ||
| } | ||
| export(ids) { | ||
| const href = `${ | ||
| this.url | ||
| }/batch/load?id=${ids.join('&id=')}&access_token=${Cookie.get('access_token')}` | ||
| window.open(href) | ||
| return downloadAuthenticated( | ||
| `${this.url}/batch/load?id=${ids.join('&id=')}`, | ||
| ) | ||
| } | ||
| } | ||
| export { PythonFunctions } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,8 +1,7 @@ | ||
| import Cookie from '@tap/shared/src/cookie' | ||
| import { downloadAuthenticated } from '../download' | ||
|
|
||
| const BASE_URL = '/api/Javascript_functions' | ||
|
|
||
| export function exportJavascriptFunctions(ids: string[]) { | ||
| const href = `${BASE_URL}/batch/load?id=${ids.join('&id=')}&access_token=${Cookie.get('access_token')}` | ||
| window.open(href) | ||
| return downloadAuthenticated(`${BASE_URL}/batch/load?id=${ids.join('&id=')}`) | ||
| } |
This file contains hidden or 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.
[P1] 这里只清理 Axios 请求。SAML 登出通过
window.location.href = getSamlLogoutUrl(accessToken)导航,packages/api/src/core/sso.ts:38仍会生成/logout?access_token=...,所以该凭证绕过此拦截器并进入请求 URL。请一并调整登出调用和服务端契约,确保 URL 不再携带 token。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.
已修复(2f688ddfa),并同步调整了服务端契约:tapdata/tapdata#3516。
getSamlLogoutUrl(token)改为startSamlLogout(token),以POST /api/sso/saml/logout+Authorization: Bearer发起登出,后端返回redirectUrl(IdP SLO 地址或登出后页面),signOut()再跳转;请求失败时回到#/login。登出 URL 不再携带 token。POST /logout,通过AccessTokenResolver从请求头解析 token;GET /logout保留兼容旧前端并标记 deprecated,url-token-mode=REJECT时忽略 URL token。注意发布顺序:本 PR 依赖 #3516,需在后端合并部署后(或同时)再合并,否则 SAML 登出只会回到登录页而不会终止服务端会话 / 触发 IdP SLO。