Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 13 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

Apache License
Version 2.0, January 2004
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion crates/openshell-cli/src/output.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 3 additions & 0 deletions deploy/deb/control.in
Original file line number Diff line number Diff line change
@@ -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@
Expand Down
3 changes: 3 additions & 0 deletions deploy/deb/openshell-gateway.service
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions deploy/helm/openshell-workspace/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -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.
*/}}
Expand Down
3 changes: 3 additions & 0 deletions deploy/helm/openshell/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -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.
*/}}
Expand Down
2 changes: 1 addition & 1 deletion e2e/kubernetes/openbao-tls-values.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 4 additions & 0 deletions scripts/bin/openshell
Original file line number Diff line number Diff line change
@@ -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)"
Expand Down
2 changes: 2 additions & 0 deletions scripts/keycloak-realm.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0
4 changes: 4 additions & 0 deletions scripts/lint-mermaid/lint-mermaid.mjs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
82 changes: 77 additions & 5 deletions scripts/update_license_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import argparse
import os
import re
import subprocess
import sys
from pathlib import Path
Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand All @@ -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)

Expand All @@ -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)
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions sdk/conformance/oauth-client-credentials.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0
5 changes: 5 additions & 0 deletions sdk/go/docs/theme/custom.css
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions sdk/typescript/biome.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0
2 changes: 2 additions & 0 deletions sdk/typescript/tsconfig.build.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0
2 changes: 2 additions & 0 deletions sdk/typescript/tsconfig.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0
Loading