diff options
| author | Mason Reed <mason@vector35.com> | 2025-02-13 13:26:44 -0500 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2025-02-13 13:59:09 -0500 |
| commit | b366ebd28bcb44492719b487f9dd34b6da56d23f (patch) | |
| tree | 1d911a5aceb38db38a09bd90bc528f859647d432 | |
| parent | 5365728462076834832090072788972585260876 (diff) | |
Add licensing check for Rust code
If we add new rust dependencies we should now be alerted when a new license type is added.
| -rw-r--r-- | .github/workflows/rust.yml | 20 | ||||
| -rw-r--r-- | about.hbs | 70 | ||||
| -rw-r--r-- | about.toml | 10 | ||||
| -rw-r--r-- | arch/msp430/Cargo.toml | 1 | ||||
| -rw-r--r-- | arch/riscv/Cargo.toml | 1 | ||||
| -rw-r--r-- | arch/riscv/disasm/Cargo.toml | 1 | ||||
| -rw-r--r-- | plugins/dwarf/dwarf_export/Cargo.toml | 1 | ||||
| -rw-r--r-- | plugins/dwarf/dwarf_import/Cargo.toml | 1 | ||||
| -rw-r--r-- | plugins/dwarf/dwarfdump/Cargo.toml | 1 | ||||
| -rw-r--r-- | plugins/dwarf/shared/Cargo.toml | 1 | ||||
| -rw-r--r-- | plugins/idb_import/Cargo.toml | 1 | ||||
| -rw-r--r-- | plugins/pdb-ng/Cargo.toml | 1 | ||||
| -rw-r--r-- | plugins/pdb-ng/demo/Cargo.toml | 1 | ||||
| -rw-r--r-- | plugins/warp/Cargo.toml | 1 | ||||
| -rw-r--r-- | rust/Cargo.toml | 1 | ||||
| -rw-r--r-- | rust/binaryninjacore-sys/Cargo.toml | 1 | ||||
| -rw-r--r-- | view/minidump/Cargo.toml | 1 |
17 files changed, 113 insertions, 1 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 747e152f..5d06aaa4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -53,4 +53,22 @@ jobs: - name: Typo Check uses: crate-ci/typos@v1.29.4 with: - files: ./rust
\ No newline at end of file + files: ./rust + + # Check licensing and produce a list of licenses + licensing: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cargo-about + uses: baptiste0928/cargo-install@v3 + with: + crate: cargo-about + version: "0.6.6" + - name: Run license check + run: cargo about generate about.hbs > license.html + - name: Archive license file + uses: actions/upload-artifact@v4 + with: + name: license + path: license.html
\ No newline at end of file diff --git a/about.hbs b/about.hbs new file mode 100644 index 00000000..9091a2a7 --- /dev/null +++ b/about.hbs @@ -0,0 +1,70 @@ +<html> + +<head> + <style> + @media (prefers-color-scheme: dark) { + body { + background: #333; + color: white; + } + a { + color: skyblue; + } + } + .container { + font-family: sans-serif; + max-width: 800px; + margin: 0 auto; + } + .intro { + text-align: center; + } + .licenses-list { + list-style-type: none; + margin: 0; + padding: 0; + } + .license-used-by { + margin-top: -10px; + } + .license-text { + max-height: 200px; + overflow-y: scroll; + white-space: pre-wrap; + } + </style> +</head> + +<body> +<main class="container"> + <div class="intro"> + <h1>Third Party Licenses</h1> + <p>This page lists the licenses of the **rust** projects used in binaryninja-api.</p> + </div> + + <h2>Overview of licenses:</h2> + <ul class="licenses-overview"> + {{#each overview}} + <li><a href="#{{id}}">{{name}}</a> ({{count}})</li> + {{/each}} + </ul> + + <h2>All license text:</h2> + <ul class="licenses-list"> + {{#each licenses}} + <li class="license"> + <h3 id="{{id}}">{{name}}</h3> + <h4>Used by:</h4> + <ul class="license-used-by"> + {{#each used_by}} + <li><a href="{{#if crate.repository}} {{crate.repository}} {{else}} https://crates.io/crates/{{crate.name}} {{/if}}">{{crate.name}} {{crate.version}}</a></li> + {{/each}} + </ul> + <pre class="license-text">{{text}}</pre> + </li> + {{/each}} + </ul> +</main> +</body> + +</html>
\ No newline at end of file diff --git a/about.toml b/about.toml new file mode 100644 index 00000000..aaf511f8 --- /dev/null +++ b/about.toml @@ -0,0 +1,10 @@ +accepted = [ + "Apache-2.0", + "MIT", + "Unicode-DFS-2016", + "Unicode-3.0", + "ISC", + "BSD-3-Clause", + "BSL-1.0", + "LicenseRef-scancode-google-patent-license-fuchsia" +]
\ No newline at end of file diff --git a/arch/msp430/Cargo.toml b/arch/msp430/Cargo.toml index ddc442e8..03940cd8 100644 --- a/arch/msp430/Cargo.toml +++ b/arch/msp430/Cargo.toml @@ -3,6 +3,7 @@ name = "arch_msp430" version = "0.1.0" authors = ["jrozner"] edition = "2021" +license = "Apache-2.0" [dependencies] binaryninja.workspace = true diff --git a/arch/riscv/Cargo.toml b/arch/riscv/Cargo.toml index 1c0979e9..a90000dd 100644 --- a/arch/riscv/Cargo.toml +++ b/arch/riscv/Cargo.toml @@ -3,6 +3,7 @@ name = "arch_riscv" version = "0.1.0" authors = ["Ryan Snyder <ryan.snyder.or@gmail.com>"] edition = "2021" +license = "Apache-2.0" [dependencies] binaryninja.workspace = true diff --git a/arch/riscv/disasm/Cargo.toml b/arch/riscv/disasm/Cargo.toml index a799dc18..f1e52d49 100644 --- a/arch/riscv/disasm/Cargo.toml +++ b/arch/riscv/disasm/Cargo.toml @@ -3,6 +3,7 @@ name = "riscv-dis" version = "0.1.0" authors = ["Ryan Snyder <ryan.snyder.or@gmail.com>"] edition = "2021" +license = "Apache-2.0" [dependencies] byteorder = "1" diff --git a/plugins/dwarf/dwarf_export/Cargo.toml b/plugins/dwarf/dwarf_export/Cargo.toml index a3d0e75b..570626f6 100644 --- a/plugins/dwarf/dwarf_export/Cargo.toml +++ b/plugins/dwarf/dwarf_export/Cargo.toml @@ -2,6 +2,7 @@ name = "dwarf_export" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [lib] crate-type = ["cdylib"] diff --git a/plugins/dwarf/dwarf_import/Cargo.toml b/plugins/dwarf/dwarf_import/Cargo.toml index 52f89a46..9527274a 100644 --- a/plugins/dwarf/dwarf_import/Cargo.toml +++ b/plugins/dwarf/dwarf_import/Cargo.toml @@ -2,6 +2,7 @@ name = "dwarf_import" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [lib] crate-type = ["cdylib"] diff --git a/plugins/dwarf/dwarfdump/Cargo.toml b/plugins/dwarf/dwarfdump/Cargo.toml index a58e2e33..cd13206a 100644 --- a/plugins/dwarf/dwarfdump/Cargo.toml +++ b/plugins/dwarf/dwarfdump/Cargo.toml @@ -3,6 +3,7 @@ name = "dwarfdump" version = "0.1.0" authors = ["Kyle Martin <kyle@vector35.com>"] edition = "2021" +license = "Apache-2.0" [lib] crate-type = ["cdylib"] diff --git a/plugins/dwarf/shared/Cargo.toml b/plugins/dwarf/shared/Cargo.toml index 2e2ee51e..83ecee93 100644 --- a/plugins/dwarf/shared/Cargo.toml +++ b/plugins/dwarf/shared/Cargo.toml @@ -3,6 +3,7 @@ name = "dwarfreader" version = "0.1.0" authors = ["Kyle Martin <kyle@vector35.com>"] edition = "2021" +license = "Apache-2.0" [dependencies] binaryninja.workspace = true diff --git a/plugins/idb_import/Cargo.toml b/plugins/idb_import/Cargo.toml index 1871df6e..db41d40a 100644 --- a/plugins/idb_import/Cargo.toml +++ b/plugins/idb_import/Cargo.toml @@ -3,6 +3,7 @@ name = "idb_import" version = "0.1.0" authors = ["Rubens Brandao <git@rubens.io>"] edition = "2021" +license = "Apache-2.0" [lib] crate-type = ["cdylib"] diff --git a/plugins/pdb-ng/Cargo.toml b/plugins/pdb-ng/Cargo.toml index d431fd64..3a9017d5 100644 --- a/plugins/pdb-ng/Cargo.toml +++ b/plugins/pdb-ng/Cargo.toml @@ -2,6 +2,7 @@ name = "pdb-import-plugin" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [lib] crate-type = ["cdylib"] diff --git a/plugins/pdb-ng/demo/Cargo.toml b/plugins/pdb-ng/demo/Cargo.toml index 02a645d0..ddde9b94 100644 --- a/plugins/pdb-ng/demo/Cargo.toml +++ b/plugins/pdb-ng/demo/Cargo.toml @@ -2,6 +2,7 @@ name = "pdb-import-plugin-static" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [lib] crate-type = ["staticlib"] diff --git a/plugins/warp/Cargo.toml b/plugins/warp/Cargo.toml index e7634075..07e0a4de 100644 --- a/plugins/warp/Cargo.toml +++ b/plugins/warp/Cargo.toml @@ -2,6 +2,7 @@ name = "warp_ninja" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [lib] crate-type = ["lib", "cdylib"] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 29170b6d..361b2057 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" authors = ["Ryan Snyder <ryan@vector35.com>", "Kyle Martin <kyle@vector35.com>"] edition = "2021" rust-version = "1.83.0" +license = "Apache-2.0" [features] # This is used when statically linking to prevent exporting CorePluginABIVersion and UiPluginABIVersion. diff --git a/rust/binaryninjacore-sys/Cargo.toml b/rust/binaryninjacore-sys/Cargo.toml index 3c72600a..bfd49a41 100644 --- a/rust/binaryninjacore-sys/Cargo.toml +++ b/rust/binaryninjacore-sys/Cargo.toml @@ -5,6 +5,7 @@ authors = ["Ryan Snyder <ryan@vector35.com>", "Kyle Martin <kyle@vector35.com>"] build = "build.rs" edition = "2021" links = "binaryninjacore" +license = "Apache-2.0" [build-dependencies] bindgen = "0.71.1" diff --git a/view/minidump/Cargo.toml b/view/minidump/Cargo.toml index 276080b4..aa1ff40e 100644 --- a/view/minidump/Cargo.toml +++ b/view/minidump/Cargo.toml @@ -2,6 +2,7 @@ name = "minidump_bn" version = "0.1.0" edition = "2021" +license = "Apache-2.0" [lib] crate-type = ["cdylib"] |
