buape / carbon

A fully-featured HTTP library for Discord bots
https://carbon.buape.com/
MIT License
12 stars 6 forks source link

New Architecture #146

Closed apteryxxyz closed 1 month ago

apteryxxyz commented 2 months ago

Code

Testing

Documentation

Closes #99

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: 0d754eac4dd6d3c20eda0f7d00d7ab5410cfca59

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ------------- | ----- | | create-carbon | Minor | | @buape/carbon | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

gitguardian[bot] commented 2 months ago

⚠️ GitGuardian has uncovered 12 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard. Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | | | -------------- | ------------------ | ------------------------------ | ---------------- | --------------- | -------------------- | | [13620540](https://dashboard.gitguardian.com/workspace/355137/incidents/13620540) | Triggered | Generic High Entropy Secret | 0d754eac4dd6d3c20eda0f7d00d7ab5410cfca59 | packages/carbon/src/plugins/linked-roles/LinkedRoles.ts | [View secret](https://github.com/buape/carbon/commit/0d754eac4dd6d3c20eda0f7d00d7ab5410cfca59#diff-e19efeeb6384da11e9582dc7d994a1aeed35bee7c344768d905410149ec4490bR31) | | [13620540](https://dashboard.gitguardian.com/workspace/355137/incidents/13620540) | Triggered | Generic High Entropy Secret | 99f8d2be4b28c2e8d3c291dc531e35ab2ad8364a | packages/carbon/src/plugins/linked-roles/LinkedRoles.ts | [View secret](https://github.com/buape/carbon/commit/99f8d2be4b28c2e8d3c291dc531e35ab2ad8364a#diff-e19efeeb6384da11e9582dc7d994a1aeed35bee7c344768d905410149ec4490bR33) | | [13620540](https://dashboard.gitguardian.com/workspace/355137/incidents/13620540) | Triggered | Generic High Entropy Secret | b865841dfea58cebed65b9070735f6e3c8bb2632 | packages/carbon/src/plugins/linked-roles/LinkedRoles.ts | [View secret](https://github.com/buape/carbon/commit/b865841dfea58cebed65b9070735f6e3c8bb2632#diff-e19efeeb6384da11e9582dc7d994a1aeed35bee7c344768d905410149ec4490bR32) | | [13620540](https://dashboard.gitguardian.com/workspace/355137/incidents/13620540) | Triggered | Generic High Entropy Secret | 284c9ae3f38dc61d735a1fc07c7857f31f9c42a1 | packages/carbon/src/plugins/linked-roles/LinkedRoles.ts | [View secret](https://github.com/buape/carbon/commit/284c9ae3f38dc61d735a1fc07c7857f31f9c42a1#diff-e19efeeb6384da11e9582dc7d994a1aeed35bee7c344768d905410149ec4490bL31) | | [13620540](https://dashboard.gitguardian.com/workspace/355137/incidents/13620540) | Triggered | Generic High Entropy Secret | 284c9ae3f38dc61d735a1fc07c7857f31f9c42a1 | packages/carbon/src/plugins/linked-roles/LinkedRoles.ts | [View secret](https://github.com/buape/carbon/commit/284c9ae3f38dc61d735a1fc07c7857f31f9c42a1#diff-e19efeeb6384da11e9582dc7d994a1aeed35bee7c344768d905410149ec4490bR37) | | [13620541](https://dashboard.gitguardian.com/workspace/355137/incidents/13620541) | Triggered | Generic High Entropy Secret | 0d754eac4dd6d3c20eda0f7d00d7ab5410cfca59 | packages/carbon/src/plugins/linked-roles/LinkedRoles.ts | [View secret](https://github.com/buape/carbon/commit/0d754eac4dd6d3c20eda0f7d00d7ab5410cfca59#diff-e19efeeb6384da11e9582dc7d994a1aeed35bee7c344768d905410149ec4490bR33) | | [13620541](https://dashboard.gitguardian.com/workspace/355137/incidents/13620541) | Triggered | Generic High Entropy Secret | 284c9ae3f38dc61d735a1fc07c7857f31f9c42a1 | packages/carbon/src/plugins/linked-roles/LinkedRoles.ts | [View secret](https://github.com/buape/carbon/commit/284c9ae3f38dc61d735a1fc07c7857f31f9c42a1#diff-e19efeeb6384da11e9582dc7d994a1aeed35bee7c344768d905410149ec4490bR31) | | [13620541](https://dashboard.gitguardian.com/workspace/355137/incidents/13620541) | Triggered | Generic High Entropy Secret | 99f8d2be4b28c2e8d3c291dc531e35ab2ad8364a | packages/carbon/src/plugins/linked-roles/LinkedRoles.ts | [View secret](https://github.com/buape/carbon/commit/99f8d2be4b28c2e8d3c291dc531e35ab2ad8364a#diff-e19efeeb6384da11e9582dc7d994a1aeed35bee7c344768d905410149ec4490bR27) | | [13620541](https://dashboard.gitguardian.com/workspace/355137/incidents/13620541) | Triggered | Generic High Entropy Secret | b865841dfea58cebed65b9070735f6e3c8bb2632 | packages/carbon/src/plugins/linked-roles/LinkedRoles.ts | [View secret](https://github.com/buape/carbon/commit/b865841dfea58cebed65b9070735f6e3c8bb2632#diff-e19efeeb6384da11e9582dc7d994a1aeed35bee7c344768d905410149ec4490bL27) | | [13620541](https://dashboard.gitguardian.com/workspace/355137/incidents/13620541) | Triggered | Generic High Entropy Secret | 99f8d2be4b28c2e8d3c291dc531e35ab2ad8364a | packages/carbon/src/plugins/linked-roles/LinkedRoles.ts | [View secret](https://github.com/buape/carbon/commit/99f8d2be4b28c2e8d3c291dc531e35ab2ad8364a#diff-e19efeeb6384da11e9582dc7d994a1aeed35bee7c344768d905410149ec4490bL31) | | [13620541](https://dashboard.gitguardian.com/workspace/355137/incidents/13620541) | Triggered | Generic High Entropy Secret | b865841dfea58cebed65b9070735f6e3c8bb2632 | packages/carbon/src/plugins/linked-roles/LinkedRoles.ts | [View secret](https://github.com/buape/carbon/commit/b865841dfea58cebed65b9070735f6e3c8bb2632#diff-e19efeeb6384da11e9582dc7d994a1aeed35bee7c344768d905410149ec4490bR31) | | [13620541](https://dashboard.gitguardian.com/workspace/355137/incidents/13620541) | Triggered | Generic High Entropy Secret | 88886e0b1cf68dc1c113d6ab6c5be4b72e326077 | packages/carbon/src/classes/Client.ts | [View secret](https://github.com/buape/carbon/commit/88886e0b1cf68dc1c113d6ab6c5be4b72e326077#diff-841b0cb881773a19686161d4eac5727e9ccd1837c608a4c3e8b984ada1b8bd5fR66) |
🛠 Guidelines to remediate hardcoded secrets
1. Understand the implications of revoking this secret by investigating where it is used in your code. 2. Replace and store your secrets safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate these secrets](https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/generics/generic_high_entropy_secret#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data. To avoid such incidents in the future consider - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

pkg-pr-new[bot] commented 2 months ago

Open in Stackblitz

pnpm add https://pkg.pr.new/buape/carbon/@buape/carbon@146
pnpm add https://pkg.pr.new/buape/carbon/@buape/carbon-nodejs@146
pnpm add https://pkg.pr.new/buape/carbon/create-carbon@146
pnpm add https://pkg.pr.new/buape/carbon/@buape/carbon-request@146

commit: b4fedd4

thewilloftheshadow commented 2 months ago

You can rebase on main to fix the formatting CI error

apteryxxyz commented 2 months ago

Regarding the // at the end of some lines, this is just me forcing some preferred formatting.

For example, Biome would format a piece of code like this:

await this.rest.put(Routes.applicationCommands(this.options.clientId), {
    body: commands
})

I myself don't like this, so I'll put // to force the formatting to this:

await this.rest.put(
    Routes.applicationCommands(this.options.clientId), //
    { body: commands }
)
thewilloftheshadow commented 2 months ago

Ah, that's a neat trick

thewilloftheshadow commented 1 month ago

Any idea on the docs api script failing? Haven't tried to fix it yet but I haven't dug into how this version works

apteryxxyz commented 1 month ago

Any idea on the docs api script failing? Haven't tried to fix it yet but I haven't dug into how this version works

Seems to be related to the copy-api.sh script, the action doesnt like escaped_name="${name//@/\\@}". As to why my best guess is the shell in the action isn't bash, referencing this Stack Overflow answer. I'm not really sure though

apteryxxyz commented 1 month ago

Any idea on the docs api script failing? Haven't tried to fix it yet but I haven't dug into how this version works

185 fixes this issue

apteryxxyz commented 1 month ago

Finally done 😂😴