Skip to content

Commit 9dea776

Browse files
committed
provider → scanner
1 parent 7d07a55 commit 9dea776

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<img src="https://bun.com/logo.png" height="36" />
22

3-
# Bun Security Provider Template
3+
# Bun Security Scanner Template
44

55
> [!WARNING]
66
> This feature is currently unfinished but will be shipping soon. Track progress at https://github.com/oven-sh/bun/pull/21183
77
8-
A template for creating a security provider for Bun's package installation
9-
process. Security providers scan packages against your threat intelligence feeds
8+
A template for creating a security scanner for Bun's package installation
9+
process. Security scanners scan packages against your threat intelligence feeds
1010
and control whether installations proceed based on detected threats.
1111

1212
📚 [**Full documentation**](https://bun.com/docs/install/security)
1313

1414
## How It Works
1515

16-
When packages are installed via Bun, your security provider:
16+
When packages are installed via Bun, your security scanner:
1717

1818
1. **Receives** package information (name, version)
1919
2. **Queries** your threat intelligence API
@@ -56,9 +56,9 @@ const ThreatFeedItemSchema = z.object({
5656

5757
### Useful Bun APIs
5858

59-
Bun provides several built-in APIs that are particularly useful for security providers:
59+
Bun provides several built-in APIs that are particularly useful for security scanner:
6060

61-
- [**Security Provider API Reference**](https://bun.com/reference/bun/Security): Complete API documentation for security providers
61+
- [**Security scanner API Reference**](https://bun.com/docs/install/security): Complete API documentation for security scanners
6262
- [**`Bun.semver.satisfies()`**](https://bun.com/docs/api/semver): Essential for checking if package versions match vulnerability ranges. No external dependencies needed.
6363

6464
```typescript
@@ -81,7 +81,7 @@ bun test
8181

8282
## Publishing Your Provider
8383

84-
Publish your security provider to npm:
84+
Publish your security scanner to npm:
8585

8686
```bash
8787
bun publish

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@acme/bun",
3-
"description": "Bun security provider for Acme",
3+
"description": "Bun security scanner for acmecorp",
44
"version": "1.0.0",
55
"author": "Acme",
66
"license": "MIT",

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ async function fetchThreatFeed(packages: Bun.Security.Package[]): Promise<Threat
3131
});
3232
}
3333

34-
export const provider: Bun.Security.Provider = {
35-
version: '1', // This is the version of Bun security provider implementation. You should keep this set as '1'
34+
export const scanner: Bun.Security.Scanner = {
35+
version: '1', // This is the version of Bun security scanner implementation. You should keep this set as '1'
3636
async scan({packages}) {
3737
const feed = await fetchThreatFeed(packages);
3838

temp.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ declare module 'bun' {
4040
* Level represents the degree of danger for a security advisory
4141
*
4242
* Bun behaves differently depending on the values returned from the
43-
* {@link Provider.scan `scan()`} hook:
43+
* {@link Scanner.scan `scan()`} hook:
4444
*
4545
* > In any case, Bun *always* pretty prints *all* the advisories,
4646
* > but...
@@ -72,14 +72,14 @@ declare module 'bun' {
7272
description: string | null;
7373
}
7474

75-
export interface Provider {
75+
export interface Scanner {
7676
/**
77-
* This is the version of the provider implementation. It may change in
77+
* This is the version of the scanner implementation. It may change in
7878
* future versions, so we will use this version to discriminate between
7979
* such versions. It's entirely possible this API changes in the future
8080
* so much that version 1 would no longer be supported.
8181
*
82-
* The version is required because third-party provider package versions
82+
* The version is required because third-party scanner package versions
8383
* are inherently unrelated to Bun versions
8484
*/
8585
version: '1';

0 commit comments

Comments
 (0)