Skip to content
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

feat: use cookie cloud for cookie #16851

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sgpublic
Copy link
Contributor

@sgpublic sgpublic commented Sep 21, 2024

Involved Issue / 该 PR 相关 Issue

Close #

Example for the Proposed Route(s) / 路由地址示例

NOROUTE

New RSS Route Checklist / 新 RSS 路由检查表

  • New Route / 新的路由
  • Anti-bot or rate limit / 反爬/频率限制
    • If yes, do your code reflect this sign? / 如果有, 是否有对应的措施?
  • Date and time / 日期和时间
    • Parsed / 可以解析
    • Correct time zone / 时区正确
  • New package added / 添加了新的包
  • Puppeteer

Note / 说明

增加从 CookieCloud 获取 Cookie 的能力,并为 javdb 添加了适配。

有个不确定是否合适的操作是在这里 lib/utils/cookie-cloud.ts#L25 使用了 globalThis,如果不使用 globalThis 的话在 lib/routes/javdb/utils.ts#L22 会获取不到内容,我不是一个专业的前端开发,实在不知道怎么办才用了 globalThis。如果大佬们能有更优雅的办法还请不吝赐教!

@github-actions github-actions bot added dependencies This PR involves changes to dependencies core enhancement Route labels Sep 21, 2024
if (!cookie_data.hasOwnProperty(key)) {
continue;
}
cookies = cookies.concat(

Check warning

Code scanning / ESLint

Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`. Warning

Prefer the spread operator over Array#concat(…).
@github-actions github-actions bot added the Auto: Route Test Skipped PR involves no routes label Sep 21, 2024
};

const cookieDecrypt = (uuid: string, encrypted: string, password: string) => {
const the_key = CryptoJS.MD5(`${uuid}-${password}`).toString().substring(0, 16);

Check failure

Code scanning / CodeQL

Use of password hash with insufficient computational effort High

Password from
an access to COOKIE_CLOUD_PASSWORD
is hashed insecurely.
Password from
an access to password
is hashed insecurely.
Password from
an access to password
is hashed insecurely.
Password from
an access to password
is hashed insecurely.
Password from
an access to cookieCloudPassword
is hashed insecurely.
};

const cookieDecrypt = (uuid: string, encrypted: string, password: string) => {
const the_key = CryptoJS.MD5(`${uuid}-${password}`).toString().substring(0, 16);

Check failure

Code scanning / CodeQL

Use of a broken or weak cryptographic algorithm High

A broken or weak cryptographic algorithm
depends on
sensitive data from an access to COOKIE_CLOUD_UUID
.
A broken or weak cryptographic algorithm
depends on
sensitive data from an access to uuid
.
A broken or weak cryptographic algorithm
depends on
sensitive data from an access to uuid
.
A broken or weak cryptographic algorithm
depends on
sensitive data from an access to uuid
.
A broken or weak cryptographic algorithm
depends on
sensitive data from an access to cookieCloudUuid
.
@sgpublic
Copy link
Contributor Author

sgpublic commented Sep 27, 2024

Hi, @TonyRL. Could I kindly request your help in reviewing this PR? It utilizes CookieCloud to sync cookies from the user's browser, which would be beneficial for certain sites with short-lived cookies. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto: Route Test Skipped PR involves no routes core enhancement dependencies This PR involves changes to dependencies Route
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant