Skip to content

Commit

Permalink
autogen: update license overview
Browse files Browse the repository at this point in the history
  • Loading branch information
ory-bot committed Dec 30, 2024
1 parent 4681b5c commit a503af0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .bin/license-engine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ APPROVED_MODULES=(
'github.com/ory-corp/cloud/.*' # Ory IP
'github.com/golang/freetype/.*' # FreeType license: https://freetype.sourceforge.net/FTL.TXT
'go.opentelemetry.io/otel/exporters/jaeger/internal/third_party/thrift/lib/go/thrift' # Incorrect detection, actually Apache-2.0: https://github.com/open-telemetry/opentelemetry-go/blob/exporters/jaeger/v1.17.0/exporters/jaeger/internal/third_party/thrift/LICENSE
'go.uber.org/zap/exp/.*' # MIT license is in root of exp folder in monorepo at https://github.com/uber-go/zap/blob/master/exp/LICENSE
'github.com/ory/client-go' # Apache-2.0
'github.com/ian-kent/linkio' # BSD - https://github.com/ian-kent/linkio/blob/97566b8728870dac1c9863ba5b0f237c39166879/linkio.go#L1-L3
'github.com/t-k/fluent-logger-golang/fluent' # Apache-2.0 https://github.com/t-k/fluent-logger-golang/blob/master/LICENSE
'github.com/jmespath/go-jmespath' # Apache-2.0 https://github.com/jmespath/go-jmespath/blob/master/LICENSE
'github.com/ory/keto/proto/ory/keto/opl/v1alpha1' # Apache-2.0 - submodule of keto
'github.com/ory/keto/proto/ory/keto/relation_tuples/v1alpha2' # Apache-2.0 - submodule of keto
)

# These lines in the output should be ignored (plain text, no regex).
Expand Down
11 changes: 10 additions & 1 deletion .bin/list-licenses
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ set -e
# list Node licenses
if [ -f package.json ]; then
if grep -q '"dependencies":\s+{[^}]*"[^"]+":' package.json; then
npm exec --yes license-checker -- --production --csv --excludePrivatePackages --customPath .bin/license-template-node.json | grep -v '^$'
# List all direct Go module dependencies, transform their paths to root module paths
# (e.g., github.com/ory/x instead of github.com/ory/x/foo/bar), and generate a license report
# for each unique root module. This ensures that the license report is generated for the root
# module of a repository, where licenses are typically defined.
go list -f "{{if not .Indirect}}{{.Path}}{{end}}" -m ... |
sort -u |
awk -F/ '{ if ($1 == "github.com" && NF >= 3) { print $1"/"$2"/"$3 } else { print } }' |
sort -u |
xargs -I {} sh -c '.bin/go-licenses report --template .bin/license-template-go.tpl {}' 2>/dev/null |
grep -v '^$'
{ echo; } 2>/dev/null
else
echo "No dependencies found in package.json" >&2
Expand Down

0 comments on commit a503af0

Please sign in to comment.