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
修复从 token 解析 bucket 的 bug & 完善下类型 & fix issue #456
Conversation
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.
🐺
} catch (e) { | ||
this.onError(e) | ||
} |
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.
这个异常应该不重新 throw 出去吗? @nighca
src/utils.ts
Outdated
@@ -273,7 +273,7 @@ interface PutPolicy { | |||
export function getPutPolicy(token: string) { | |||
const segments = token.split(':') | |||
const ak = segments[0] |
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.
check
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.
要不要写一下文档链接或格式注释
// token 构造的差异参考:https://github.com/qbox/product/blob/master/kodo/auths/UpToken.md#admin-uptoken-authorization | ||
const ak = segments.length > 3 ? segments[1] : segments[0] | ||
const putPolicy: PutPolicy = JSON.parse(urlSafeBase64Decode(segments[segments.length - 1])) |
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.
@nighca = =…
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.
l g t m
* 完善下 observable 文件中的类型 * 增加 base64 编解码函数的导出 fix #455