Skip to content

Commit f53fac9

Browse files
authored
Merge branch 'Bearer:main' into main
2 parents 1b0d2ea + 125d7de commit f53fac9

File tree

180 files changed

+6846
-4554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+6846
-4554
lines changed

.github/workflows/command_doc_check.yml

+20
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,25 @@ jobs:
2222
go-version: 1.21
2323
- name: Generate command docs
2424
run: go run ./scripts/gen-doc-yaml.go
25+
- name: Setup Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: "16"
29+
- name: Cache dependencies
30+
uses: actions/cache@v3
31+
working-directory: ./docs
32+
with:
33+
path: ~/.npm
34+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-node-
37+
- name: Install dependencies
38+
run: npm ci
39+
working-directory: ./docs
40+
- name: prettier
41+
run: npm run prettier:fix
42+
working-directory: ./docs
43+
- name: Pick up any new files
44+
run: git add .
2545
- name: Check no uncommited changes
2646
run: git diff --exit-code

.github/workflows/e2e_test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
- opened
99
- synchronize
1010
- reopened
11+
paths-ignore:
12+
- 'docs/**'
1113
permissions:
1214
contents: read
1315
jobs:

.github/workflows/lint.yml

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
- opened
66
- synchronize
77
- reopened
8+
paths-ignore:
9+
- 'docs/**'
810
permissions:
911
contents: read
1012
jobs:

.github/workflows/lint_docs.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Lint Docs
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- synchronize
7+
- reopened
8+
paths:
9+
- 'docs/**'
10+
permissions:
11+
contents: read
12+
jobs:
13+
lint:
14+
defaults:
15+
run:
16+
working-directory: docs
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
- name: Setup Node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: "16"
25+
- name: Cache dependencies
26+
uses: actions/cache@v3
27+
with:
28+
path: ~/.npm
29+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
30+
restore-keys: |
31+
${{ runner.os }}-node-
32+
- name: Install dependencies
33+
run: npm ci
34+
- name: eslint
35+
run: npm run lint
36+
- name: prettier
37+
run: npm run prettier
38+

.github/workflows/test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
- opened
99
- synchronize
1010
- reopened
11+
paths-ignore:
12+
- 'docs/**'
1113
permissions:
1214
contents: read
1315
jobs:

.goreleaser.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ brews:
1414
name: bearer
1515
folder: Formula
1616
install: bin.install "bearer"
17+
dependencies:
18+
- name: git
1719
tap:
1820
owner: Bearer
1921
name: homebrew-tap

.tool-versions

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
golang 1.21.1

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<br /><br />
1111
Bearer CLI is a static application security testing (SAST) tool that scans your source code and analyzes your data flows to discover, filter and prioritize security and privacy risks.
1212
<br /><br />
13-
Currently supporting: <strong>JavaScript/TypeScript</strong> (GA), <strong>Ruby</strong> (GA), <strong>Java</strong> (Beta), <strong>PHP</strong> (Beta), <strong>Go</strong> (Alpha), <strong>Python</strong> (Alpha) - <a href="https://docs.bearer.com/reference/supported-languages/">Learn more</a>
13+
Currently supporting: <strong>JavaScript/TypeScript</strong> (GA), <strong>Ruby</strong> (GA), <strong>Java</strong> (Beta), <strong>PHP</strong> (Beta), <strong>Go</strong> (Beta), <strong>Python</strong> (Alpha) - <a href="https://docs.bearer.com/reference/supported-languages/">Learn more</a>
1414

1515
<br /><br />
1616

@@ -263,17 +263,17 @@ Bearer CLI currently supports:
263263
<table>
264264
<tr>
265265
<td>GA</td>
266-
<td>JavaScript/TypeScript, Ruby</td>
266+
<td>JavaScript/TypeScript, Ruby</td>
267267
</tr>
268268
<tr>
269269
<td>Beta</td>
270-
<td>Java, PHP</td>
270+
<td>Java, PHP</td>
271271
</tr>
272272
<tr>
273273
<td>Alpha</td>
274-
<td>Go, Python</td>
274+
<td>Go, Python</td>
275275
</tr>
276-
</table>
276+
</table>
277277

278278
[Learn more](https://docs.bearer.com/reference/supported-languages/) about language support.
279279

contrib/install.sh

+13
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,16 @@ http_copy() {
244244
echo "$body"
245245
}
246246

247+
check_dependencies() {
248+
log_info "Checking dependencies..."
249+
if git --version &> /dev/null; then
250+
log_debug "Git is installed. Version: $(git --version)"
251+
else
252+
log_crit "Git is not installed on this system."
253+
return 1
254+
fi
255+
}
256+
247257
github_release() {
248258
owner_repo=$1
249259
version=$2
@@ -310,6 +320,7 @@ log_prefix() {
310320
echo "$PREFIX"
311321
}
312322

323+
313324
PLATFORM="${OS}/${ARCH}"
314325
GITHUB_DOWNLOAD=https://github.com/${OWNER}/${REPO}/releases/download
315326

@@ -318,6 +329,8 @@ uname_arch_check "$ARCH"
318329

319330
parse_args "$@"
320331

332+
check_dependencies
333+
321334
get_binaries
322335

323336
tag_to_version

docs/.eleventy.js

+23-18
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const mdSetup = markdownIt({ html: true })
2323
mdSetup.renderer.rules.code_inline = (tokens, idx, { langPrefix = "" }) => {
2424
const token = tokens[idx]
2525
return `<code class="${langPrefix}">${mdSetup.utils.escapeHtml(
26-
token.content
26+
token.content,
2727
)}</code>`
2828
}
2929

@@ -51,10 +51,10 @@ module.exports = function (eleventyConfig) {
5151
return now
5252
})
5353
eleventyConfig.addShortcode("sectionLinks", function (sectionName) {
54-
const section = nav.find(item => item.name == sectionName)
54+
const section = nav.find((item) => item.name == sectionName)
5555
let out = ""
56-
if(section){
57-
section.items.forEach(item => {
56+
if (section) {
57+
section.items.forEach((item) => {
5858
out += `- [${item.name}](${item.url})\n`
5959
})
6060
}
@@ -63,19 +63,24 @@ module.exports = function (eleventyConfig) {
6363
})
6464

6565
// {% yamlExample "ci/gitlab/basic" %}
66-
eleventyConfig.addShortcode('yamlExample', function (exampleName) {
67-
const example = fs.readFileSync(`./_data/examples/${exampleName}.yaml`, 'utf8')
68-
return '```yaml\n' + example + '\n```';
69-
});
66+
eleventyConfig.addShortcode("yamlExample", function (exampleName) {
67+
const example = fs.readFileSync(
68+
`./_data/examples/${exampleName}.yaml`,
69+
"utf8",
70+
)
71+
return "```yaml\n" + example + "\n```"
72+
})
7073

71-
eleventyConfig.addShortcode('githubAction', function(data){
74+
eleventyConfig.addShortcode("githubAction", function (data) {
7275
out = "| Option | Description | Default |\n"
7376
out += "| - | - | - |\n"
74-
Object.keys(data).sort().forEach(key => {
75-
const item = data[key]
76-
const default_val = item.default ? "`"+item.default+"`" : ""
77-
out += `| **${key}** | ${item.description} | ${default_val} |\n`
78-
});
77+
Object.keys(data)
78+
.sort()
79+
.forEach((key) => {
80+
const item = data[key]
81+
const default_val = item.default ? "`" + item.default + "`" : ""
82+
out += `| **${key}** | ${item.description} | ${default_val} |\n`
83+
})
7984
return out
8085
})
8186

@@ -117,7 +122,8 @@ module.exports = function (eleventyConfig) {
117122
})
118123
eleventyConfig.addFilter("deduplicate", (arr) => {
119124
const result = arr.filter(
120-
(value, index, self) => index === self.findIndex((t) => t.id === value.id)
125+
(value, index, self) =>
126+
index === self.findIndex((t) => t.id === value.id),
121127
)
122128
return result
123129
})
@@ -178,8 +184,7 @@ module.exports = function (eleventyConfig) {
178184
const target = parent.split(path.sep).slice(1, -1)
179185
const check = child.split(path.sep).slice(1, -1)
180186
// handles individual rule pages highlighting "rule" in side nav
181-
const isRule =
182-
target.includes("rules") && check[check.length - 2] === "rules"
187+
const isRule = target.includes("rules")
183188
if (child === parent || isRule) {
184189
return true
185190
} else {
@@ -214,7 +219,7 @@ module.exports = function (eleventyConfig) {
214219
return `<div class="elv-callout${
215220
level ? ` elv-callout-${level}` : ""
216221
}">${labelHtml}${contentHtml}</div>`
217-
}
222+
},
218223
)
219224

220225
return {

docs/.eslintrc.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
commonjs: true,
5+
es2021: true,
6+
node: true,
7+
},
8+
extends: ["standard", "prettier"],
9+
parserOptions: {
10+
ecmaVersion: "latest",
11+
},
12+
}

docs/404.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Sorry, but we couldn't find the page you were looking for.
1212
- Want to get started right away? Head over to the [quick start guide](/quickstart/).
1313
- Bearer CLI detects [all sorts of data types](/reference/datatypes/) and has [built-in rules](/reference/rules/) to check for data security risks.
1414

15-
If you're looking for help using Bearer CLI, you can [create a new issue on GitHub]({{meta.links.issues}}) or join our [discord community]({{meta.links.discord}}).
15+
If you're looking for help using Bearer CLI, you can [create a new issue on GitHub]({{meta.links.issues}}) or join our [discord community]({{meta.links.discord}}).

docs/_data/bearer.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: bearer
22
options:
3-
- name: help
4-
shorthand: h
5-
default_value: "false"
6-
usage: help for bearer
3+
- name: help
4+
shorthand: h
5+
default_value: "false"
6+
usage: help for bearer
77
see_also:
8-
- bearer completion - Generate the autocompletion script for the your shell.
9-
- bearer ignore - Manage ignored fingerprints
10-
- bearer init - Generates a default config to `bearer.yml`
11-
- bearer scan - Scan a directory or file
12-
- bearer version - Print the version
13-
aliases:
8+
- bearer completion - Generate the autocompletion script for the your shell.
9+
- bearer ignore - Manage ignored fingerprints
10+
- bearer init - Generates a default config to `bearer.yml`
11+
- bearer scan - Scan a directory or file
12+
- bearer version - Print the version
13+
aliases:

docs/_data/bearerAction.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
const EleventyFetch = require("@11ty/eleventy-fetch");
2-
const yaml = require("js-yaml");
1+
const EleventyFetch = require("@11ty/eleventy-fetch")
2+
const yaml = require("js-yaml")
33
module.exports = async function () {
4-
let action;
4+
let action
55
try {
66
const response = await EleventyFetch(
77
"https://raw.githubusercontent.com/Bearer/bearer-action/main/action.yml",
88
{
99
duration: "60m",
1010
type: "text",
11-
}
12-
);
13-
action = yaml.load(response);
11+
},
12+
)
13+
action = yaml.load(response)
1414
} catch (err) {
15-
console.log("Could not fetch release");
15+
console.log("Could not fetch release")
1616
}
1717
return {
1818
...action,
19-
};
20-
};
19+
}
20+
}

docs/_data/bearer_completion.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: bearer completion
22
synopsis: Generate the autocompletion script for the your shell.
33
usage: bearer completion [command]
44
options:
5-
- name: help
6-
shorthand: h
7-
default_value: "false"
8-
usage: help for completion
5+
- name: help
6+
shorthand: h
7+
default_value: "false"
8+
usage: help for completion
99
see_also:
10-
- 'bearer - '
11-
aliases:
10+
- "bearer - "
11+
aliases:

0 commit comments

Comments
 (0)