From e90c946e9614802e5fd61e41da9a1f4076809503 Mon Sep 17 00:00:00 2001 From: John Myers <9696606+johntmyers@users.noreply.github.com> Date: Fri, 18 Sep 2026 09:27:29 -0700 Subject: [PATCH] chore(license): align repository compliance text Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> --- CONTRIBUTING.md | 41 +++++++++- LICENSE | 14 +++- crates/openshell-cli/src/output.rs | 2 +- deploy/deb/control.in | 3 + deploy/deb/openshell-gateway.service | 3 + .../templates/_helpers.tpl | 3 + deploy/helm/openshell/templates/_helpers.tpl | 3 + e2e/kubernetes/openbao-tls-values.yaml | 2 +- scripts/bin/openshell | 4 + scripts/keycloak-realm.json.license | 2 + scripts/lint-mermaid/lint-mermaid.mjs | 4 + scripts/update_license_headers.py | 82 +++++++++++++++++-- .../oauth-client-credentials.json.license | 2 + sdk/go/docs/theme/custom.css | 5 ++ sdk/typescript/biome.json.license | 2 + sdk/typescript/tsconfig.build.json.license | 2 + sdk/typescript/tsconfig.json.license | 2 + 17 files changed, 167 insertions(+), 9 deletions(-) create mode 100644 scripts/keycloak-realm.json.license create mode 100644 sdk/conformance/oauth-client-credentials.json.license create mode 100644 sdk/typescript/biome.json.license create mode 100644 sdk/typescript/tsconfig.build.json.license create mode 100644 sdk/typescript/tsconfig.json.license diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 63921028b7..34e03ef13d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -551,7 +551,46 @@ chore(deps): bump tokio to 1.40 ### DCO -All human contributions must include a `Signed-off-by` line in each commit message. This certifies you have the right to submit the work under the project license. See the [Developer Certificate of Origin](https://developercertificate.org/). Dependabot-authored dependency update PRs are allowlisted because the bot cannot sign commits. +All human contributions must include a `Signed-off-by` line in each commit message. This certifies you have the right to submit the work under the project license. Dependabot-authored dependency update PRs are allowlisted because the bot cannot sign commits. + +The project uses version 1.1 of the [Developer Certificate of Origin](https://developercertificate.org/): + +```text +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. +``` ```bash git commit -s -m "feat(sandbox): add new capability" diff --git a/LICENSE b/LICENSE index f76e7a1eb7..114889973c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,4 @@ +Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. Apache License Version 2.0, January 2004 @@ -176,7 +177,18 @@ END OF TERMS AND CONDITIONS - Copyright 2025-2026 NVIDIA CORPORATION & AFFILIATES + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/crates/openshell-cli/src/output.rs b/crates/openshell-cli/src/output.rs index fee304870a..7a8120bf3b 100644 --- a/crates/openshell-cli/src/output.rs +++ b/crates/openshell-cli/src/output.rs @@ -1,4 +1,4 @@ -// Copyright (C) 2025 NVIDIA Corporation +// SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //! Generic output formatting helpers for CLI commands. diff --git a/deploy/deb/control.in b/deploy/deb/control.in index e0975d4d4d..27887c56cd 100644 --- a/deploy/deb/control.in +++ b/deploy/deb/control.in @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + Package: openshell Version: @VERSION@ Architecture: @ARCH@ diff --git a/deploy/deb/openshell-gateway.service b/deploy/deb/openshell-gateway.service index c5f766a129..18d24f8ced 100644 --- a/deploy/deb/openshell-gateway.service +++ b/deploy/deb/openshell-gateway.service @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + [Unit] Description=OpenShell Gateway Documentation=https://github.com/NVIDIA/OpenShell diff --git a/deploy/helm/openshell-workspace/templates/_helpers.tpl b/deploy/helm/openshell-workspace/templates/_helpers.tpl index eb948b9907..3be0152ef4 100644 --- a/deploy/helm/openshell-workspace/templates/_helpers.tpl +++ b/deploy/helm/openshell-workspace/templates/_helpers.tpl @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + {{/* Expand the name of the chart. */}} diff --git a/deploy/helm/openshell/templates/_helpers.tpl b/deploy/helm/openshell/templates/_helpers.tpl index 8ce4c73656..dd2d103f17 100644 --- a/deploy/helm/openshell/templates/_helpers.tpl +++ b/deploy/helm/openshell/templates/_helpers.tpl @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + {{/* Expand the name of the chart. */}} diff --git a/e2e/kubernetes/openbao-tls-values.yaml b/e2e/kubernetes/openbao-tls-values.yaml index 7b2e78d816..5a0fe60206 100644 --- a/e2e/kubernetes/openbao-tls-values.yaml +++ b/e2e/kubernetes/openbao-tls-values.yaml @@ -1,4 +1,4 @@ -# Copyright 2026 NVIDIA CORPORATION & AFFILIATES +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 global: diff --git a/scripts/bin/openshell b/scripts/bin/openshell index 58cef8ce30..15d16db1b1 100755 --- a/scripts/bin/openshell +++ b/scripts/bin/openshell @@ -1,4 +1,8 @@ #!/usr/bin/env bash + +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" diff --git a/scripts/keycloak-realm.json.license b/scripts/keycloak-realm.json.license new file mode 100644 index 0000000000..817df24424 --- /dev/null +++ b/scripts/keycloak-realm.json.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +SPDX-License-Identifier: Apache-2.0 diff --git a/scripts/lint-mermaid/lint-mermaid.mjs b/scripts/lint-mermaid/lint-mermaid.mjs index 3f73aed224..ab56470db8 100644 --- a/scripts/lint-mermaid/lint-mermaid.mjs +++ b/scripts/lint-mermaid/lint-mermaid.mjs @@ -1,4 +1,8 @@ #!/usr/bin/env node + +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + // Validate ```mermaid fenced blocks in Markdown/MDX files using the official // mermaid parser. Line numbers in error output are offset back to the source // file so editors can jump to them. diff --git a/scripts/update_license_headers.py b/scripts/update_license_headers.py index aa72b50171..49a76f4f34 100755 --- a/scripts/update_license_headers.py +++ b/scripts/update_license_headers.py @@ -20,6 +20,7 @@ import argparse import os +import re import subprocess import sys from pathlib import Path @@ -47,6 +48,26 @@ ".tsx": "//", ".mts": "//", ".cts": "//", + ".mjs": "//", + ".css": "/*", + ".in": "#", + ".service": "#", + ".tpl": "#", +} + +# Extensionless source files that cannot be identified by suffix. +FILE_COMMENT_STYLES: dict[str, str] = { + "scripts/bin/openshell": "#", +} + +# Strict JSON does not support comments. Keep SPDX data in REUSE-compatible +# sidecars so these files remain valid inputs to their consumers. +SIDECAR_LICENSE_FILES: set[str] = { + "scripts/keycloak-realm.json", + "sdk/conformance/oauth-client-credentials.json", + "sdk/typescript/biome.json", + "sdk/typescript/tsconfig.build.json", + "sdk/typescript/tsconfig.json", } # Directories to skip entirely (relative to repo root). @@ -83,6 +104,13 @@ def make_header(comment: str) -> str: """Return the two-line SPDX header for a given comment prefix.""" + if comment == "/*": + return ( + "/*\n" + f" * SPDX-FileCopyrightText: {COPYRIGHT_TEXT}\n" + f" * SPDX-License-Identifier: {LICENSE_ID}\n" + " */\n" + ) return ( f"{comment} SPDX-FileCopyrightText: {COPYRIGHT_TEXT}\n" f"{comment} SPDX-License-Identifier: {LICENSE_ID}\n" @@ -173,6 +201,8 @@ def is_dockerfile(path: Path) -> bool: def get_comment_style(path: Path) -> str | None: """Return the comment prefix for a file, or None if unsupported.""" + if path.as_posix() in FILE_COMMENT_STYLES: + return FILE_COMMENT_STYLES[path.as_posix()] if is_dockerfile(path): return "#" return COMMENT_STYLES.get(path.suffix) @@ -190,7 +220,10 @@ def discover_files(root: Path) -> list[Path]: continue if is_excluded(rel): continue - if get_comment_style(rel) is not None: + if ( + get_comment_style(rel) is not None + or rel.as_posix() in SIDECAR_LICENSE_FILES + ): results.append(path) return sorted(results) @@ -205,7 +238,10 @@ def discover_files(root: Path) -> list[Path]: rel = fpath.relative_to(root) if is_excluded(rel): continue - if get_comment_style(rel) is not None: + if ( + get_comment_style(rel) is not None + or rel.as_posix() in SIDECAR_LICENSE_FILES + ): results.append(fpath) return sorted(results) @@ -216,11 +252,20 @@ def discover_files(root: Path) -> list[Path]: # --------------------------------------------------------------------------- SPDX_MARKER = "SPDX-License-Identifier" +SPDX_COPYRIGHT_RE = re.compile( + r"SPDX-FileCopyrightText: Copyright \(c\) \d{4}(?:-\d{4})? " + r"NVIDIA CORPORATION & AFFILIATES\. All rights reserved\." +) def has_header(lines: list[str]) -> bool: - """Check if the SPDX header is present in the first 10 lines.""" - return any(SPDX_MARKER in line for line in lines[:10]) + """Check if the complete NVIDIA SPDX header is in the first 10 lines.""" + header_lines = lines[:10] + has_license = any( + f"{SPDX_MARKER}: {LICENSE_ID}" in line for line in header_lines + ) + has_copyright = any(SPDX_COPYRIGHT_RE.search(line) for line in header_lines) + return has_license and has_copyright def find_insertion_point(lines: list[str], path: Path) -> int: @@ -276,6 +321,30 @@ def insert_header(content: str, comment: str, path: Path) -> str: def process_file(path: Path, root: Path, *, check: bool, verbose: bool) -> bool: """Process a single file. Returns True if the file is compliant.""" rel = path.relative_to(root) + + if rel.as_posix() in SIDECAR_LICENSE_FILES: + sidecar = path.with_name(f"{path.name}.license") + lines = ( + sidecar.read_text(encoding="utf-8").splitlines() + if sidecar.exists() + else [] + ) + if has_header(lines): + if verbose: + print(f" ok: {rel} ({sidecar.name})") + return True + if check: + print(f" MISSING: {rel} ({sidecar.name})") + return False + sidecar.write_text( + f"SPDX-FileCopyrightText: {COPYRIGHT_TEXT}\n" + f"SPDX-License-Identifier: {LICENSE_ID}\n", + encoding="utf-8", + ) + if verbose: + print(f" added: {rel} ({sidecar.name})") + return True + comment = get_comment_style(rel) if comment is None: return True @@ -338,7 +407,10 @@ def main() -> int: continue if is_excluded(rel) or is_git_ignored(root, rel): continue - if get_comment_style(rel) is not None: + if ( + get_comment_style(rel) is not None + or rel.as_posix() in SIDECAR_LICENSE_FILES + ): files.append(p) else: files = discover_files(root) diff --git a/sdk/conformance/oauth-client-credentials.json.license b/sdk/conformance/oauth-client-credentials.json.license new file mode 100644 index 0000000000..817df24424 --- /dev/null +++ b/sdk/conformance/oauth-client-credentials.json.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +SPDX-License-Identifier: Apache-2.0 diff --git a/sdk/go/docs/theme/custom.css b/sdk/go/docs/theme/custom.css index 74b7011144..b235309c47 100644 --- a/sdk/go/docs/theme/custom.css +++ b/sdk/go/docs/theme/custom.css @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + /* OpenShell Go SDK - Custom Typography * * Font: Inter from Google Fonts CDN diff --git a/sdk/typescript/biome.json.license b/sdk/typescript/biome.json.license new file mode 100644 index 0000000000..817df24424 --- /dev/null +++ b/sdk/typescript/biome.json.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +SPDX-License-Identifier: Apache-2.0 diff --git a/sdk/typescript/tsconfig.build.json.license b/sdk/typescript/tsconfig.build.json.license new file mode 100644 index 0000000000..817df24424 --- /dev/null +++ b/sdk/typescript/tsconfig.build.json.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +SPDX-License-Identifier: Apache-2.0 diff --git a/sdk/typescript/tsconfig.json.license b/sdk/typescript/tsconfig.json.license new file mode 100644 index 0000000000..817df24424 --- /dev/null +++ b/sdk/typescript/tsconfig.json.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +SPDX-License-Identifier: Apache-2.0