diff --git a/cmd/syft/internal/test/integration/catalog_packages_cases_test.go b/cmd/syft/internal/test/integration/catalog_packages_cases_test.go index 8597e06206a..188b4ae455a 100644 --- a/cmd/syft/internal/test/integration/catalog_packages_cases_test.go +++ b/cmd/syft/internal/test/integration/catalog_packages_cases_test.go @@ -468,4 +468,12 @@ var commonTestCases = []testCase{ "memcached": "3.2.0", }, }, + { + name: "find lua rock package", + pkgType: pkg.LuaRocksPkg, + pkgLanguage: pkg.Lua, + pkgInfo: map[string]string{ + "kong": "3.7.0-0", + }, + }, } diff --git a/cmd/syft/internal/test/integration/test-fixtures/image-pkg-coverage/pkgs/rockspec/kong-3.7.0-0.rockspec b/cmd/syft/internal/test/integration/test-fixtures/image-pkg-coverage/pkgs/rockspec/kong-3.7.0-0.rockspec new file mode 100644 index 00000000000..cca7ee53d66 --- /dev/null +++ b/cmd/syft/internal/test/integration/test-fixtures/image-pkg-coverage/pkgs/rockspec/kong-3.7.0-0.rockspec @@ -0,0 +1,612 @@ +package = "kong" +version = "3.7.0-0" +rockspec_format = "3.0" +supported_platforms = {"linux", "macosx"} +source = { + url = "git+https://github.com/Kong/kong.git", + tag = "3.7.0" +} +description = { + summary = "Kong is a scalable and customizable API Management Layer built on top of Nginx.", + homepage = "https://konghq.com", + license = "Apache 2.0" +} +dependencies = { + "inspect == 3.1.3", + "luasec == 1.3.2", + "luasocket == 3.0-rc1", + "penlight == 1.13.1", + "lua-resty-http == 0.17.1", + "lua-resty-jit-uuid == 0.0.7", + "lua-ffi-zlib == 0.6", + "multipart == 0.5.9", + "version == 1.0.1", + "kong-lapis == 1.16.0.1", + "kong-pgmoon == 1.16.2", + "luatz == 0.4", + "lua_system_constants == 0.1.4", + "lyaml == 6.2.8", + "luasyslog == 2.0.1", + "lua_pack == 2.0.0", + "binaryheap >= 0.4", + "luaxxhash >= 1.0", + "lua-protobuf == 0.5.0", + "lua-resty-healthcheck == 3.0.1", + "lua-messagepack == 0.5.4", + "lua-resty-aws == 1.3.6", + "lua-resty-openssl == 1.2.0", + "lua-resty-counter == 0.2.1", + "lua-resty-ipmatcher == 0.6.1", + "lua-resty-acme == 0.12.0", + "lua-resty-session == 4.0.5", + "lua-resty-timer-ng == 0.2.6", + "lpeg == 1.1.0", + "lua-resty-ljsonschema == 1.1.6-2", +} +build = { + type = "builtin", + modules = { + ["kong"] = "kong/init.lua", + ["kong.meta"] = "kong/meta.lua", + ["kong.cache"] = "kong/cache/init.lua", + ["kong.cache.warmup"] = "kong/cache/warmup.lua", + ["kong.global"] = "kong/global.lua", + ["kong.reports"] = "kong/reports.lua", + ["kong.constants"] = "kong/constants.lua", + ["kong.concurrency"] = "kong/concurrency.lua", + ["kong.deprecation"] = "kong/deprecation.lua", + ["kong.globalpatches"] = "kong/globalpatches.lua", + ["kong.error_handlers"] = "kong/error_handlers.lua", + ["kong.hooks"] = "kong/hooks.lua", + + ["kong.router"] = "kong/router/init.lua", + ["kong.router.traditional"] = "kong/router/traditional.lua", + ["kong.router.compat"] = "kong/router/compat.lua", + ["kong.router.expressions"] = "kong/router/expressions.lua", + ["kong.router.atc"] = "kong/router/atc.lua", + ["kong.router.fields"] = "kong/router/fields.lua", + ["kong.router.utils"] = "kong/router/utils.lua", + + ["kong.conf_loader"] = "kong/conf_loader/init.lua", + ["kong.conf_loader.constants"] = "kong/conf_loader/constants.lua", + ["kong.conf_loader.parse"] = "kong/conf_loader/parse.lua", + ["kong.conf_loader.listeners"] = "kong/conf_loader/listeners.lua", + + ["kong.clustering"] = "kong/clustering/init.lua", + ["kong.clustering.data_plane"] = "kong/clustering/data_plane.lua", + ["kong.clustering.control_plane"] = "kong/clustering/control_plane.lua", + ["kong.clustering.utils"] = "kong/clustering/utils.lua", + ["kong.clustering.events"] = "kong/clustering/events.lua", + ["kong.clustering.compat"] = "kong/clustering/compat/init.lua", + ["kong.clustering.compat.version"] = "kong/clustering/compat/version.lua", + ["kong.clustering.compat.removed_fields"] = "kong/clustering/compat/removed_fields.lua", + ["kong.clustering.compat.checkers"] = "kong/clustering/compat/checkers.lua", + ["kong.clustering.config_helper"] = "kong/clustering/config_helper.lua", + ["kong.clustering.tls"] = "kong/clustering/tls.lua", + + ["kong.cluster_events"] = "kong/cluster_events/init.lua", + ["kong.cluster_events.strategies.postgres"] = "kong/cluster_events/strategies/postgres.lua", + ["kong.cluster_events.strategies.off"] = "kong/cluster_events/strategies/off.lua", + + ["kong.templates.nginx"] = "kong/templates/nginx.lua", + ["kong.templates.nginx_kong"] = "kong/templates/nginx_kong.lua", + ["kong.templates.nginx_kong_gui_include"] = "kong/templates/nginx_kong_gui_include.lua", + ["kong.templates.nginx_kong_stream"] = "kong/templates/nginx_kong_stream.lua", + ["kong.templates.kong_defaults"] = "kong/templates/kong_defaults.lua", + ["kong.templates.nginx_inject"] = "kong/templates/nginx_inject.lua", + ["kong.templates.nginx_kong_inject"] = "kong/templates/nginx_kong_inject.lua", + ["kong.templates.nginx_kong_stream_inject"] = "kong/templates/nginx_kong_stream_inject.lua", + ["kong.templates.kong_yml"] = "kong/templates/kong_yml.lua", + + ["kong.resty.dns.client"] = "kong/resty/dns/client.lua", + ["kong.resty.dns.utils"] = "kong/resty/dns/utils.lua", + ["kong.resty.ctx"] = "kong/resty/ctx.lua", + + ["kong.resty.mlcache"] = "kong/resty/mlcache/init.lua", + ["kong.resty.mlcache.ipc"] = "kong/resty/mlcache/ipc.lua", + + ["kong.cmd"] = "kong/cmd/init.lua", + ["kong.cmd.roar"] = "kong/cmd/roar.lua", + ["kong.cmd.stop"] = "kong/cmd/stop.lua", + ["kong.cmd.quit"] = "kong/cmd/quit.lua", + ["kong.cmd.start"] = "kong/cmd/start.lua", + ["kong.cmd.check"] = "kong/cmd/check.lua", + ["kong.cmd.config"] = "kong/cmd/config.lua", + ["kong.cmd.reload"] = "kong/cmd/reload.lua", + ["kong.cmd.restart"] = "kong/cmd/restart.lua", + ["kong.cmd.prepare"] = "kong/cmd/prepare.lua", + ["kong.cmd.migrations"] = "kong/cmd/migrations.lua", + ["kong.cmd.health"] = "kong/cmd/health.lua", + ["kong.cmd.vault"] = "kong/cmd/vault.lua", + ["kong.cmd.version"] = "kong/cmd/version.lua", + ["kong.cmd.hybrid"] = "kong/cmd/hybrid.lua", + ["kong.cmd.utils.log"] = "kong/cmd/utils/log.lua", + ["kong.cmd.utils.kill"] = "kong/cmd/utils/kill.lua", + ["kong.cmd.utils.env"] = "kong/cmd/utils/env.lua", + ["kong.cmd.utils.migrations"] = "kong/cmd/utils/migrations.lua", + ["kong.cmd.utils.tty"] = "kong/cmd/utils/tty.lua", + ["kong.cmd.utils.nginx_signals"] = "kong/cmd/utils/nginx_signals.lua", + ["kong.cmd.utils.prefix_handler"] = "kong/cmd/utils/prefix_handler.lua", + ["kong.cmd.utils.process_secrets"] = "kong/cmd/utils/process_secrets.lua", + ["kong.cmd.utils.inject_confs"] = "kong/cmd/utils/inject_confs.lua", + + ["kong.api"] = "kong/api/init.lua", + ["kong.api.api_helpers"] = "kong/api/api_helpers.lua", + ["kong.api.arguments"] = "kong/api/arguments.lua", + ["kong.api.endpoints"] = "kong/api/endpoints.lua", + ["kong.api.routes.cache"] = "kong/api/routes/cache.lua", + ["kong.api.routes.certificates"] = "kong/api/routes/certificates.lua", + ["kong.api.routes.clustering"] = "kong/api/routes/clustering.lua", + ["kong.api.routes.config"] = "kong/api/routes/config.lua", + ["kong.api.routes.consumers"] = "kong/api/routes/consumers.lua", + ["kong.api.routes.debug"] = "kong/api/routes/debug.lua", + ["kong.api.routes.filter_chains"] = "kong/api/routes/filter_chains.lua", + ["kong.api.routes.health"] = "kong/api/routes/health.lua", + ["kong.api.routes.kong"] = "kong/api/routes/kong.lua", + ["kong.api.routes.plugins"] = "kong/api/routes/plugins.lua", + ["kong.api.routes.snis"] = "kong/api/routes/snis.lua", + ["kong.api.routes.tags"] = "kong/api/routes/tags.lua", + ["kong.api.routes.targets"] = "kong/api/routes/targets.lua", + ["kong.api.routes.upstreams"] = "kong/api/routes/upstreams.lua", + + ["kong.admin_gui"] = "kong/admin_gui/init.lua", + ["kong.admin_gui.utils"] = "kong/admin_gui/utils.lua", + + ["kong.status"] = "kong/status/init.lua", + ["kong.status.ready"] = "kong/status/ready.lua", + + ["kong.tools.dns"] = "kong/tools/dns.lua", + ["kong.tools.grpc"] = "kong/tools/grpc.lua", + ["kong.tools.utils"] = "kong/tools/utils.lua", + ["kong.tools.timestamp"] = "kong/tools/timestamp.lua", + ["kong.tools.stream_api"] = "kong/tools/stream_api.lua", + ["kong.tools.queue"] = "kong/tools/queue.lua", + ["kong.tools.queue_schema"] = "kong/tools/queue_schema.lua", + ["kong.tools.sandbox"] = "kong/tools/sandbox.lua", + ["kong.tools.uri"] = "kong/tools/uri.lua", + ["kong.tools.kong-lua-sandbox"] = "kong/tools/kong-lua-sandbox.lua", + ["kong.tools.protobuf"] = "kong/tools/protobuf.lua", + ["kong.tools.mime_type"] = "kong/tools/mime_type.lua", + ["kong.tools.request_aware_table"] = "kong/tools/request_aware_table.lua", + ["kong.tools.gzip"] = "kong/tools/gzip.lua", + ["kong.tools.string"] = "kong/tools/string.lua", + ["kong.tools.table"] = "kong/tools/table.lua", + ["kong.tools.sha256"] = "kong/tools/sha256.lua", + ["kong.tools.yield"] = "kong/tools/yield.lua", + ["kong.tools.uuid"] = "kong/tools/uuid.lua", + ["kong.tools.rand"] = "kong/tools/rand.lua", + ["kong.tools.system"] = "kong/tools/system.lua", + ["kong.tools.time"] = "kong/tools/time.lua", + ["kong.tools.module"] = "kong/tools/module.lua", + ["kong.tools.ip"] = "kong/tools/ip.lua", + ["kong.tools.http"] = "kong/tools/http.lua", + ["kong.tools.cjson"] = "kong/tools/cjson.lua", + ["kong.tools.redis.schema"] = "kong/tools/redis/schema.lua", + + ["kong.runloop.handler"] = "kong/runloop/handler.lua", + ["kong.runloop.events"] = "kong/runloop/events.lua", + ["kong.runloop.log_level"] = "kong/runloop/log_level.lua", + ["kong.runloop.certificate"] = "kong/runloop/certificate.lua", + ["kong.runloop.plugins_iterator"] = "kong/runloop/plugins_iterator.lua", + ["kong.runloop.upstream_ssl"] = "kong/runloop/upstream_ssl.lua", + ["kong.runloop.balancer"] = "kong/runloop/balancer/init.lua", + ["kong.runloop.balancer.balancers"] = "kong/runloop/balancer/balancers.lua", + ["kong.runloop.balancer.consistent_hashing"] = "kong/runloop/balancer/consistent_hashing.lua", + ["kong.runloop.balancer.healthcheckers"] = "kong/runloop/balancer/healthcheckers.lua", + ["kong.runloop.balancer.least_connections"] = "kong/runloop/balancer/least_connections.lua", + ["kong.runloop.balancer.latency"] = "kong/runloop/balancer/latency.lua", + ["kong.runloop.balancer.round_robin"] = "kong/runloop/balancer/round_robin.lua", + ["kong.runloop.balancer.targets"] = "kong/runloop/balancer/targets.lua", + ["kong.runloop.balancer.upstreams"] = "kong/runloop/balancer/upstreams.lua", + ["kong.runloop.plugin_servers"] = "kong/runloop/plugin_servers/init.lua", + ["kong.runloop.plugin_servers.process"] = "kong/runloop/plugin_servers/process.lua", + ["kong.runloop.plugin_servers.mp_rpc"] = "kong/runloop/plugin_servers/mp_rpc.lua", + ["kong.runloop.plugin_servers.pb_rpc"] = "kong/runloop/plugin_servers/pb_rpc.lua", + ["kong.runloop.wasm"] = "kong/runloop/wasm.lua", + ["kong.runloop.wasm.properties"] = "kong/runloop/wasm/properties.lua", + + ["kong.workspaces"] = "kong/workspaces/init.lua", + + ["kong.db"] = "kong/db/init.lua", + ["kong.db.utils"] = "kong/db/utils.lua", + ["kong.db.errors"] = "kong/db/errors.lua", + ["kong.db.iteration"] = "kong/db/iteration.lua", + ["kong.db.dao"] = "kong/db/dao/init.lua", + ["kong.db.dao.certificates"] = "kong/db/dao/certificates.lua", + ["kong.db.dao.snis"] = "kong/db/dao/snis.lua", + ["kong.db.dao.targets"] = "kong/db/dao/targets.lua", + ["kong.db.dao.plugins"] = "kong/db/dao/plugins.lua", + ["kong.db.dao.tags"] = "kong/db/dao/tags.lua", + ["kong.db.dao.vaults"] = "kong/db/dao/vaults.lua", + ["kong.db.dao.workspaces"] = "kong/db/dao/workspaces.lua", + ["kong.db.dao.services"] = "kong/db/dao/services.lua", + ["kong.db.dao.ca_certificates"] = "kong/db/dao/ca_certificates.lua", + ["kong.db.declarative"] = "kong/db/declarative/init.lua", + ["kong.db.declarative.marshaller"] = "kong/db/declarative/marshaller.lua", + ["kong.db.declarative.export"] = "kong/db/declarative/export.lua", + ["kong.db.declarative.import"] = "kong/db/declarative/import.lua", + ["kong.db.schema"] = "kong/db/schema/init.lua", + ["kong.db.dao.keys"] = "kong/db/dao/keys.lua", + ["kong.db.dao.key_sets"] = "kong/db/dao/key_sets.lua", + ["kong.db.schema.entities.keys"] = "kong/db/schema/entities/keys.lua", + ["kong.db.schema.entities.key_sets"] = "kong/db/schema/entities/key_sets.lua", + ["kong.db.schema.entities.consumers"] = "kong/db/schema/entities/consumers.lua", + ["kong.db.schema.entities.routes"] = "kong/db/schema/entities/routes.lua", + ["kong.db.schema.entities.routes_subschemas"] = "kong/db/schema/entities/routes_subschemas.lua", + ["kong.db.schema.entities.services"] = "kong/db/schema/entities/services.lua", + ["kong.db.schema.entities.certificates"] = "kong/db/schema/entities/certificates.lua", + ["kong.db.schema.entities.snis"] = "kong/db/schema/entities/snis.lua", + ["kong.db.schema.entities.upstreams"] = "kong/db/schema/entities/upstreams.lua", + ["kong.db.schema.entities.targets"] = "kong/db/schema/entities/targets.lua", + ["kong.db.schema.entities.plugins"] = "kong/db/schema/entities/plugins.lua", + ["kong.db.schema.entities.tags"] = "kong/db/schema/entities/tags.lua", + ["kong.db.schema.entities.ca_certificates"] = "kong/db/schema/entities/ca_certificates.lua", + ["kong.db.schema.entities.vaults"] = "kong/db/schema/entities/vaults.lua", + ["kong.db.schema.entities.workspaces"] = "kong/db/schema/entities/workspaces.lua", + ["kong.db.schema.entities.clustering_data_planes"] = "kong/db/schema/entities/clustering_data_planes.lua", + ["kong.db.schema.entities.parameters"] = "kong/db/schema/entities/parameters.lua", + ["kong.db.schema.entities.filter_chains"] = "kong/db/schema/entities/filter_chains.lua", + ["kong.db.schema.json"] = "kong/db/schema/json.lua", + ["kong.db.schema.others.migrations"] = "kong/db/schema/others/migrations.lua", + ["kong.db.schema.others.declarative_config"] = "kong/db/schema/others/declarative_config.lua", + ["kong.db.schema.entity"] = "kong/db/schema/entity.lua", + ["kong.db.schema.metaschema"] = "kong/db/schema/metaschema.lua", + ["kong.db.schema.typedefs"] = "kong/db/schema/typedefs.lua", + ["kong.db.schema.plugin_loader"] = "kong/db/schema/plugin_loader.lua", + ["kong.db.schema.vault_loader"] = "kong/db/schema/vault_loader.lua", + ["kong.db.schema.topological_sort"] = "kong/db/schema/topological_sort.lua", + ["kong.db.strategies"] = "kong/db/strategies/init.lua", + ["kong.db.strategies.connector"] = "kong/db/strategies/connector.lua", + ["kong.db.strategies.postgres"] = "kong/db/strategies/postgres/init.lua", + ["kong.db.strategies.postgres.connector"] = "kong/db/strategies/postgres/connector.lua", + ["kong.db.strategies.postgres.tags"] = "kong/db/strategies/postgres/tags.lua", + ["kong.db.strategies.postgres.services"] = "kong/db/strategies/postgres/services.lua", + ["kong.db.strategies.postgres.plugins"] = "kong/db/strategies/postgres/plugins.lua", + ["kong.db.strategies.off"] = "kong/db/strategies/off/init.lua", + ["kong.db.strategies.off.connector"] = "kong/db/strategies/off/connector.lua", + ["kong.db.strategies.off.tags"] = "kong/db/strategies/off/tags.lua", + + ["kong.db.migrations.state"] = "kong/db/migrations/state.lua", + ["kong.db.migrations.subsystems"] = "kong/db/migrations/subsystems.lua", + ["kong.db.migrations.core"] = "kong/db/migrations/core/init.lua", + ["kong.db.migrations.core.000_base"] = "kong/db/migrations/core/000_base.lua", + ["kong.db.migrations.core.003_100_to_110"] = "kong/db/migrations/core/003_100_to_110.lua", + ["kong.db.migrations.core.004_110_to_120"] = "kong/db/migrations/core/004_110_to_120.lua", + ["kong.db.migrations.core.005_120_to_130"] = "kong/db/migrations/core/005_120_to_130.lua", + ["kong.db.migrations.core.006_130_to_140"] = "kong/db/migrations/core/006_130_to_140.lua", + ["kong.db.migrations.core.007_140_to_150"] = "kong/db/migrations/core/007_140_to_150.lua", + ["kong.db.migrations.core.008_150_to_200"] = "kong/db/migrations/core/008_150_to_200.lua", + ["kong.db.migrations.core.009_200_to_210"] = "kong/db/migrations/core/009_200_to_210.lua", + ["kong.db.migrations.core.010_210_to_211"] = "kong/db/migrations/core/010_210_to_211.lua", + ["kong.db.migrations.core.011_212_to_213"] = "kong/db/migrations/core/011_212_to_213.lua", + ["kong.db.migrations.core.012_213_to_220"] = "kong/db/migrations/core/012_213_to_220.lua", + ["kong.db.migrations.core.013_220_to_230"] = "kong/db/migrations/core/013_220_to_230.lua", + ["kong.db.migrations.core.014_230_to_270"] = "kong/db/migrations/core/014_230_to_270.lua", + ["kong.db.migrations.core.015_270_to_280"] = "kong/db/migrations/core/015_270_to_280.lua", + ["kong.db.migrations.core.016_280_to_300"] = "kong/db/migrations/core/016_280_to_300.lua", + ["kong.db.migrations.core.017_300_to_310"] = "kong/db/migrations/core/017_300_to_310.lua", + ["kong.db.migrations.core.018_310_to_320"] = "kong/db/migrations/core/018_310_to_320.lua", + ["kong.db.migrations.core.019_320_to_330"] = "kong/db/migrations/core/019_320_to_330.lua", + ["kong.db.migrations.core.020_330_to_340"] = "kong/db/migrations/core/020_330_to_340.lua", + ["kong.db.migrations.core.021_340_to_350"] = "kong/db/migrations/core/021_340_to_350.lua", + ["kong.db.migrations.core.022_350_to_360"] = "kong/db/migrations/core/022_350_to_360.lua", + ["kong.db.migrations.operations.200_to_210"] = "kong/db/migrations/operations/200_to_210.lua", + ["kong.db.migrations.operations.212_to_213"] = "kong/db/migrations/operations/212_to_213.lua", + ["kong.db.migrations.operations.280_to_300"] = "kong/db/migrations/operations/280_to_300.lua", + ["kong.db.migrations.migrate_path_280_300"] = "kong/db/migrations/migrate_path_280_300.lua", + ["kong.db.declarative.migrations"] = "kong/db/declarative/migrations/init.lua", + ["kong.db.declarative.migrations.route_path"] = "kong/db/declarative/migrations/route_path.lua", + + ["kong.pdk"] = "kong/pdk/init.lua", + ["kong.pdk.private.checks"] = "kong/pdk/private/checks.lua", + ["kong.pdk.private.phases"] = "kong/pdk/private/phases.lua", + ["kong.pdk.private.node"] = "kong/pdk/private/node.lua", + ["kong.pdk.client"] = "kong/pdk/client.lua", + ["kong.pdk.client.tls"] = "kong/pdk/client/tls.lua", + ["kong.pdk.ctx"] = "kong/pdk/ctx.lua", + ["kong.pdk.ip"] = "kong/pdk/ip.lua", + ["kong.pdk.log"] = "kong/pdk/log.lua", + ["kong.pdk.service"] = "kong/pdk/service.lua", + ["kong.pdk.service.request"] = "kong/pdk/service/request.lua", + ["kong.pdk.service.response"] = "kong/pdk/service/response.lua", + ["kong.pdk.router"] = "kong/pdk/router.lua", + ["kong.pdk.request"] = "kong/pdk/request.lua", + ["kong.pdk.response"] = "kong/pdk/response.lua", + ["kong.pdk.table"] = "kong/pdk/table.lua", + ["kong.pdk.node"] = "kong/pdk/node.lua", + ["kong.pdk.nginx"] = "kong/pdk/nginx.lua", + ["kong.pdk.cluster"] = "kong/pdk/cluster.lua", + ["kong.pdk.vault"] = "kong/pdk/vault.lua", + ["kong.pdk.tracing"] = "kong/pdk/tracing.lua", + ["kong.pdk.plugin"] = "kong/pdk/plugin.lua", + + ["kong.plugins.basic-auth.migrations"] = "kong/plugins/basic-auth/migrations/init.lua", + ["kong.plugins.basic-auth.migrations.000_base_basic_auth"] = "kong/plugins/basic-auth/migrations/000_base_basic_auth.lua", + ["kong.plugins.basic-auth.migrations.002_130_to_140"] = "kong/plugins/basic-auth/migrations/002_130_to_140.lua", + ["kong.plugins.basic-auth.migrations.003_200_to_210"] = "kong/plugins/basic-auth/migrations/003_200_to_210.lua", + ["kong.plugins.basic-auth.crypto"] = "kong/plugins/basic-auth/crypto.lua", + ["kong.plugins.basic-auth.handler"] = "kong/plugins/basic-auth/handler.lua", + ["kong.plugins.basic-auth.access"] = "kong/plugins/basic-auth/access.lua", + ["kong.plugins.basic-auth.schema"] = "kong/plugins/basic-auth/schema.lua", + ["kong.plugins.basic-auth.daos"] = "kong/plugins/basic-auth/daos.lua", + + ["kong.plugins.key-auth.migrations"] = "kong/plugins/key-auth/migrations/init.lua", + ["kong.plugins.key-auth.migrations.000_base_key_auth"] = "kong/plugins/key-auth/migrations/000_base_key_auth.lua", + ["kong.plugins.key-auth.migrations.002_130_to_140"] = "kong/plugins/key-auth/migrations/002_130_to_140.lua", + ["kong.plugins.key-auth.migrations.003_200_to_210"] = "kong/plugins/key-auth/migrations/003_200_to_210.lua", + ["kong.plugins.key-auth.migrations.004_320_to_330"] = "kong/plugins/key-auth/migrations/004_320_to_330.lua", + ["kong.plugins.key-auth.handler"] = "kong/plugins/key-auth/handler.lua", + ["kong.plugins.key-auth.schema"] = "kong/plugins/key-auth/schema.lua", + ["kong.plugins.key-auth.daos"] = "kong/plugins/key-auth/daos.lua", + + ["kong.plugins.oauth2.migrations"] = "kong/plugins/oauth2/migrations/init.lua", + ["kong.plugins.oauth2.migrations.000_base_oauth2"] = "kong/plugins/oauth2/migrations/000_base_oauth2.lua", + ["kong.plugins.oauth2.migrations.003_130_to_140"] = "kong/plugins/oauth2/migrations/003_130_to_140.lua", + ["kong.plugins.oauth2.migrations.004_200_to_210"] = "kong/plugins/oauth2/migrations/004_200_to_210.lua", + ["kong.plugins.oauth2.migrations.005_210_to_211"] = "kong/plugins/oauth2/migrations/005_210_to_211.lua", + ["kong.plugins.oauth2.migrations.006_320_to_330"] = "kong/plugins/oauth2/migrations/006_320_to_330.lua", + ["kong.plugins.oauth2.migrations.007_320_to_330"] = "kong/plugins/oauth2/migrations/007_320_to_330.lua", + ["kong.plugins.oauth2.handler"] = "kong/plugins/oauth2/handler.lua", + ["kong.plugins.oauth2.secret"] = "kong/plugins/oauth2/secret.lua", + ["kong.plugins.oauth2.access"] = "kong/plugins/oauth2/access.lua", + ["kong.plugins.oauth2.schema"] = "kong/plugins/oauth2/schema.lua", + ["kong.plugins.oauth2.daos"] = "kong/plugins/oauth2/daos.lua", + ["kong.plugins.oauth2.daos.oauth2_tokens"] = "kong/plugins/oauth2/daos/oauth2_tokens.lua", + + ["kong.plugins.tcp-log.handler"] = "kong/plugins/tcp-log/handler.lua", + ["kong.plugins.tcp-log.schema"] = "kong/plugins/tcp-log/schema.lua", + + ["kong.plugins.udp-log.handler"] = "kong/plugins/udp-log/handler.lua", + ["kong.plugins.udp-log.schema"] = "kong/plugins/udp-log/schema.lua", + + ["kong.plugins.http-log.handler"] = "kong/plugins/http-log/handler.lua", + ["kong.plugins.http-log.schema"] = "kong/plugins/http-log/schema.lua", + ["kong.plugins.http-log.migrations"] = "kong/plugins/http-log/migrations/init.lua", + ["kong.plugins.http-log.migrations.001_280_to_300"] = "kong/plugins/http-log/migrations/001_280_to_300.lua", + + ["kong.plugins.file-log.handler"] = "kong/plugins/file-log/handler.lua", + ["kong.plugins.file-log.schema"] = "kong/plugins/file-log/schema.lua", + + ["kong.plugins.rate-limiting.migrations"] = "kong/plugins/rate-limiting/migrations/init.lua", + ["kong.plugins.rate-limiting.migrations.000_base_rate_limiting"] = "kong/plugins/rate-limiting/migrations/000_base_rate_limiting.lua", + ["kong.plugins.rate-limiting.migrations.003_10_to_112"] = "kong/plugins/rate-limiting/migrations/003_10_to_112.lua", + ["kong.plugins.rate-limiting.migrations.004_200_to_210"] = "kong/plugins/rate-limiting/migrations/004_200_to_210.lua", + ["kong.plugins.rate-limiting.migrations.005_320_to_330"] = "kong/plugins/rate-limiting/migrations/005_320_to_330.lua", + ["kong.plugins.rate-limiting.migrations.006_350_to_360"] = "kong/plugins/rate-limiting/migrations/006_350_to_360.lua", + ["kong.plugins.rate-limiting.expiration"] = "kong/plugins/rate-limiting/expiration.lua", + ["kong.plugins.rate-limiting.handler"] = "kong/plugins/rate-limiting/handler.lua", + ["kong.plugins.rate-limiting.schema"] = "kong/plugins/rate-limiting/schema.lua", + ["kong.plugins.rate-limiting.daos"] = "kong/plugins/rate-limiting/daos.lua", + ["kong.plugins.rate-limiting.policies"] = "kong/plugins/rate-limiting/policies/init.lua", + ["kong.plugins.rate-limiting.policies.cluster"] = "kong/plugins/rate-limiting/policies/cluster.lua", + ["kong.plugins.rate-limiting.clustering.compat.redis_translation"] = "kong/plugins/rate-limiting/clustering/compat/redis_translation.lua", + + ["kong.plugins.response-ratelimiting.migrations"] = "kong/plugins/response-ratelimiting/migrations/init.lua", + ["kong.plugins.response-ratelimiting.migrations.000_base_response_rate_limiting"] = "kong/plugins/response-ratelimiting/migrations/000_base_response_rate_limiting.lua", + ["kong.plugins.response-ratelimiting.migrations.001_350_to_360"] = "kong/plugins/response-ratelimiting/migrations/001_350_to_360.lua", + ["kong.plugins.response-ratelimiting.handler"] = "kong/plugins/response-ratelimiting/handler.lua", + ["kong.plugins.response-ratelimiting.access"] = "kong/plugins/response-ratelimiting/access.lua", + ["kong.plugins.response-ratelimiting.header_filter"] = "kong/plugins/response-ratelimiting/header_filter.lua", + ["kong.plugins.response-ratelimiting.log"] = "kong/plugins/response-ratelimiting/log.lua", + ["kong.plugins.response-ratelimiting.schema"] = "kong/plugins/response-ratelimiting/schema.lua", + ["kong.plugins.response-ratelimiting.policies"] = "kong/plugins/response-ratelimiting/policies/init.lua", + ["kong.plugins.response-ratelimiting.policies.cluster"] = "kong/plugins/response-ratelimiting/policies/cluster.lua", + ["kong.plugins.response-ratelimiting.clustering.compat.redis_translation"] = "kong/plugins/response-ratelimiting/clustering/compat/redis_translation.lua", + + ["kong.plugins.request-size-limiting.handler"] = "kong/plugins/request-size-limiting/handler.lua", + ["kong.plugins.request-size-limiting.schema"] = "kong/plugins/request-size-limiting/schema.lua", + + ["kong.plugins.response-transformer.handler"] = "kong/plugins/response-transformer/handler.lua", + ["kong.plugins.response-transformer.body_transformer"] = "kong/plugins/response-transformer/body_transformer.lua", + ["kong.plugins.response-transformer.header_transformer"] = "kong/plugins/response-transformer/header_transformer.lua", + ["kong.plugins.response-transformer.schema"] = "kong/plugins/response-transformer/schema.lua", + + ["kong.plugins.cors.handler"] = "kong/plugins/cors/handler.lua", + ["kong.plugins.cors.schema"] = "kong/plugins/cors/schema.lua", + + ["kong.plugins.ip-restriction.handler"] = "kong/plugins/ip-restriction/handler.lua", + ["kong.plugins.ip-restriction.schema"] = "kong/plugins/ip-restriction/schema.lua", + ["kong.plugins.ip-restriction.migrations"] = "kong/plugins/ip-restriction/migrations/init.lua", + ["kong.plugins.ip-restriction.migrations.001_200_to_210"] = "kong/plugins/ip-restriction/migrations/001_200_to_210.lua", + + ["kong.plugins.acl.migrations"] = "kong/plugins/acl/migrations/init.lua", + ["kong.plugins.acl.migrations.000_base_acl"] = "kong/plugins/acl/migrations/000_base_acl.lua", + ["kong.plugins.acl.migrations.002_130_to_140"] = "kong/plugins/acl/migrations/002_130_to_140.lua", + ["kong.plugins.acl.migrations.003_200_to_210"] = "kong/plugins/acl/migrations/003_200_to_210.lua", + ["kong.plugins.acl.migrations.004_212_to_213"] = "kong/plugins/acl/migrations/004_212_to_213.lua", + ["kong.plugins.acl.handler"] = "kong/plugins/acl/handler.lua", + ["kong.plugins.acl.schema"] = "kong/plugins/acl/schema.lua", + ["kong.plugins.acl.daos"] = "kong/plugins/acl/daos.lua", + ["kong.plugins.acl.groups"] = "kong/plugins/acl/groups.lua", + ["kong.plugins.acl.acls"] = "kong/plugins/acl/acls.lua", + ["kong.plugins.acl.api"] = "kong/plugins/acl/api.lua", + + ["kong.plugins.correlation-id.handler"] = "kong/plugins/correlation-id/handler.lua", + ["kong.plugins.correlation-id.schema"] = "kong/plugins/correlation-id/schema.lua", + + ["kong.plugins.jwt.migrations"] = "kong/plugins/jwt/migrations/init.lua", + ["kong.plugins.jwt.migrations.000_base_jwt"] = "kong/plugins/jwt/migrations/000_base_jwt.lua", + ["kong.plugins.jwt.migrations.002_130_to_140"] = "kong/plugins/jwt/migrations/002_130_to_140.lua", + ["kong.plugins.jwt.migrations.003_200_to_210"] = "kong/plugins/jwt/migrations/003_200_to_210.lua", + ["kong.plugins.jwt.handler"] = "kong/plugins/jwt/handler.lua", + ["kong.plugins.jwt.schema"] = "kong/plugins/jwt/schema.lua", + ["kong.plugins.jwt.daos"] = "kong/plugins/jwt/daos.lua", + ["kong.plugins.jwt.jwt_parser"] = "kong/plugins/jwt/jwt_parser.lua", + + ["kong.plugins.hmac-auth.migrations"] = "kong/plugins/hmac-auth/migrations/init.lua", + ["kong.plugins.hmac-auth.migrations.000_base_hmac_auth"] = "kong/plugins/hmac-auth/migrations/000_base_hmac_auth.lua", + ["kong.plugins.hmac-auth.migrations.002_130_to_140"] = "kong/plugins/hmac-auth/migrations/002_130_to_140.lua", + ["kong.plugins.hmac-auth.migrations.003_200_to_210"] = "kong/plugins/hmac-auth/migrations/003_200_to_210.lua", + ["kong.plugins.hmac-auth.handler"] = "kong/plugins/hmac-auth/handler.lua", + ["kong.plugins.hmac-auth.access"] = "kong/plugins/hmac-auth/access.lua", + ["kong.plugins.hmac-auth.schema"] = "kong/plugins/hmac-auth/schema.lua", + ["kong.plugins.hmac-auth.daos"] = "kong/plugins/hmac-auth/daos.lua", + + ["kong.plugins.ldap-auth.handler"] = "kong/plugins/ldap-auth/handler.lua", + ["kong.plugins.ldap-auth.access"] = "kong/plugins/ldap-auth/access.lua", + ["kong.plugins.ldap-auth.schema"] = "kong/plugins/ldap-auth/schema.lua", + ["kong.plugins.ldap-auth.ldap"] = "kong/plugins/ldap-auth/ldap.lua", + ["kong.plugins.ldap-auth.asn1"] = "kong/plugins/ldap-auth/asn1.lua", + + ["kong.plugins.syslog.handler"] = "kong/plugins/syslog/handler.lua", + ["kong.plugins.syslog.schema"] = "kong/plugins/syslog/schema.lua", + + ["kong.plugins.loggly.handler"] = "kong/plugins/loggly/handler.lua", + ["kong.plugins.loggly.schema"] = "kong/plugins/loggly/schema.lua", + + ["kong.plugins.datadog.handler"] = "kong/plugins/datadog/handler.lua", + ["kong.plugins.datadog.schema"] = "kong/plugins/datadog/schema.lua", + ["kong.plugins.datadog.statsd_logger"] = "kong/plugins/datadog/statsd_logger.lua", + + ["kong.plugins.statsd.constants"] = "kong/plugins/statsd/constants.lua", + ["kong.plugins.statsd.handler"] = "kong/plugins/statsd/handler.lua", + ["kong.plugins.statsd.log"] = "kong/plugins/statsd/log.lua", + ["kong.plugins.statsd.schema"] = "kong/plugins/statsd/schema.lua", + ["kong.plugins.statsd.statsd_logger"] = "kong/plugins/statsd/statsd_logger.lua", + + ["kong.plugins.bot-detection.handler"] = "kong/plugins/bot-detection/handler.lua", + ["kong.plugins.bot-detection.schema"] = "kong/plugins/bot-detection/schema.lua", + ["kong.plugins.bot-detection.rules"] = "kong/plugins/bot-detection/rules.lua", + ["kong.plugins.bot-detection.migrations"] = "kong/plugins/bot-detection/migrations/init.lua", + ["kong.plugins.bot-detection.migrations.001_200_to_210"] = "kong/plugins/bot-detection/migrations/001_200_to_210.lua", + + ["kong.plugins.request-termination.handler"] = "kong/plugins/request-termination/handler.lua", + ["kong.plugins.request-termination.schema"] = "kong/plugins/request-termination/schema.lua", + + ["kong.plugins.aws-lambda.handler"] = "kong/plugins/aws-lambda/handler.lua", + ["kong.plugins.aws-lambda.schema"] = "kong/plugins/aws-lambda/schema.lua", + ["kong.plugins.aws-lambda.request-util"] = "kong/plugins/aws-lambda/request-util.lua", + + ["kong.plugins.grpc-gateway.deco"] = "kong/plugins/grpc-gateway/deco.lua", + ["kong.plugins.grpc-gateway.handler"] = "kong/plugins/grpc-gateway/handler.lua", + ["kong.plugins.grpc-gateway.schema"] = "kong/plugins/grpc-gateway/schema.lua", + + ["kong.plugins.acme.api"] = "kong/plugins/acme/api.lua", + ["kong.plugins.acme.client"] = "kong/plugins/acme/client.lua", + ["kong.plugins.acme.clustering.compat.redis_translation"] = "kong/plugins/acme/clustering/compat/redis_translation.lua", + ["kong.plugins.acme.daos"] = "kong/plugins/acme/daos.lua", + ["kong.plugins.acme.handler"] = "kong/plugins/acme/handler.lua", + ["kong.plugins.acme.migrations.000_base_acme"] = "kong/plugins/acme/migrations/000_base_acme.lua", + ["kong.plugins.acme.migrations.001_280_to_300"] = "kong/plugins/acme/migrations/001_280_to_300.lua", + ["kong.plugins.acme.migrations.002_320_to_330"] = "kong/plugins/acme/migrations/002_320_to_330.lua", + ["kong.plugins.acme.migrations.003_350_to_360"] = "kong/plugins/acme/migrations/003_350_to_360.lua", + ["kong.plugins.acme.migrations"] = "kong/plugins/acme/migrations/init.lua", + ["kong.plugins.acme.schema"] = "kong/plugins/acme/schema.lua", + ["kong.plugins.acme.storage.kong"] = "kong/plugins/acme/storage/kong.lua", + ["kong.plugins.acme.storage.config_adapters"] = "kong/plugins/acme/storage/config_adapters/init.lua", + ["kong.plugins.acme.storage.config_adapters.redis"] = "kong/plugins/acme/storage/config_adapters/redis.lua", + ["kong.plugins.acme.reserved_words"] = "kong/plugins/acme/reserved_words.lua", + + ["kong.plugins.prometheus.api"] = "kong/plugins/prometheus/api.lua", + ["kong.plugins.prometheus.status_api"] = "kong/plugins/prometheus/status_api.lua", + ["kong.plugins.prometheus.exporter"] = "kong/plugins/prometheus/exporter.lua", + ["kong.plugins.prometheus.handler"] = "kong/plugins/prometheus/handler.lua", + ["kong.plugins.prometheus.prometheus"] = "kong/plugins/prometheus/prometheus.lua", + ["kong.plugins.prometheus.serve"] = "kong/plugins/prometheus/serve.lua", + ["kong.plugins.prometheus.schema"] = "kong/plugins/prometheus/schema.lua", + + ["kong.plugins.session.handler"] = "kong/plugins/session/handler.lua", + ["kong.plugins.session.schema"] = "kong/plugins/session/schema.lua", + ["kong.plugins.session.access"] = "kong/plugins/session/access.lua", + ["kong.plugins.session.header_filter"] = "kong/plugins/session/header_filter.lua", + ["kong.plugins.session.session"] = "kong/plugins/session/session.lua", + ["kong.plugins.session.daos"] = "kong/plugins/session/daos.lua", + ["kong.plugins.session.storage.kong"] = "kong/plugins/session/storage/kong.lua", + ["kong.plugins.session.migrations.000_base_session"] = "kong/plugins/session/migrations/000_base_session.lua", + ["kong.plugins.session.migrations.001_add_ttl_index"] = "kong/plugins/session/migrations/001_add_ttl_index.lua", + ["kong.plugins.session.migrations.002_320_to_330"] = "kong/plugins/session/migrations/002_320_to_330.lua", + ["kong.plugins.session.migrations"] = "kong/plugins/session/migrations/init.lua", + + ["kong.plugins.proxy-cache.handler"] = "kong/plugins/proxy-cache/handler.lua", + ["kong.plugins.proxy-cache.cache_key"] = "kong/plugins/proxy-cache/cache_key.lua", + ["kong.plugins.proxy-cache.schema"] = "kong/plugins/proxy-cache/schema.lua", + ["kong.plugins.proxy-cache.api"] = "kong/plugins/proxy-cache/api.lua", + ["kong.plugins.proxy-cache.strategies"] = "kong/plugins/proxy-cache/strategies/init.lua", + ["kong.plugins.proxy-cache.strategies.memory"] = "kong/plugins/proxy-cache/strategies/memory.lua", + + ["kong.plugins.grpc-web.deco"] = "kong/plugins/grpc-web/deco.lua", + ["kong.plugins.grpc-web.handler"] = "kong/plugins/grpc-web/handler.lua", + ["kong.plugins.grpc-web.schema"] = "kong/plugins/grpc-web/schema.lua", + + ["kong.plugins.pre-function._handler"] = "kong/plugins/pre-function/_handler.lua", + ["kong.plugins.pre-function._schema"] = "kong/plugins/pre-function/_schema.lua", + ["kong.plugins.pre-function.migrations._001_280_to_300"] = "kong/plugins/pre-function/migrations/_001_280_to_300.lua", + + ["kong.plugins.pre-function.handler"] = "kong/plugins/pre-function/handler.lua", + ["kong.plugins.pre-function.schema"] = "kong/plugins/pre-function/schema.lua", + ["kong.plugins.pre-function.migrations"] = "kong/plugins/pre-function/migrations/init.lua", + ["kong.plugins.pre-function.migrations.001_280_to_300"] = "kong/plugins/pre-function/migrations/001_280_to_300.lua", + + ["kong.plugins.post-function.handler"] = "kong/plugins/post-function/handler.lua", + ["kong.plugins.post-function.schema"] = "kong/plugins/post-function/schema.lua", + ["kong.plugins.post-function.migrations"] = "kong/plugins/post-function/migrations/init.lua", + ["kong.plugins.post-function.migrations.001_280_to_300"] = "kong/plugins/post-function/migrations/001_280_to_300.lua", + + ["kong.plugins.zipkin.handler"] = "kong/plugins/zipkin/handler.lua", + ["kong.plugins.zipkin.reporter"] = "kong/plugins/zipkin/reporter.lua", + ["kong.plugins.zipkin.span"] = "kong/plugins/zipkin/span.lua", + ["kong.plugins.zipkin.schema"] = "kong/plugins/zipkin/schema.lua", + ["kong.plugins.zipkin.request_tags"] = "kong/plugins/zipkin/request_tags.lua", + + ["kong.plugins.request-transformer.migrations.postgres"] = "kong/plugins/request-transformer/migrations/postgres.lua", + ["kong.plugins.request-transformer.migrations.common"] = "kong/plugins/request-transformer/migrations/common.lua", + ["kong.plugins.request-transformer.handler"] = "kong/plugins/request-transformer/handler.lua", + ["kong.plugins.request-transformer.access"] = "kong/plugins/request-transformer/access.lua", + ["kong.plugins.request-transformer.schema"] = "kong/plugins/request-transformer/schema.lua", + + ["kong.plugins.azure-functions.handler"] = "kong/plugins/azure-functions/handler.lua", + ["kong.plugins.azure-functions.schema"] = "kong/plugins/azure-functions/schema.lua", + + ["kong.plugins.opentelemetry.handler"] = "kong/plugins/opentelemetry/handler.lua", + ["kong.plugins.opentelemetry.schema"] = "kong/plugins/opentelemetry/schema.lua", + ["kong.plugins.opentelemetry.proto"] = "kong/plugins/opentelemetry/proto.lua", + ["kong.plugins.opentelemetry.otlp"] = "kong/plugins/opentelemetry/otlp.lua", + + ["kong.plugins.ai-proxy.handler"] = "kong/plugins/ai-proxy/handler.lua", + ["kong.plugins.ai-proxy.schema"] = "kong/plugins/ai-proxy/schema.lua", + + ["kong.plugins.ai-request-transformer.handler"] = "kong/plugins/ai-request-transformer/handler.lua", + ["kong.plugins.ai-request-transformer.schema"] = "kong/plugins/ai-request-transformer/schema.lua", + + ["kong.plugins.ai-response-transformer.handler"] = "kong/plugins/ai-response-transformer/handler.lua", + ["kong.plugins.ai-response-transformer.schema"] = "kong/plugins/ai-response-transformer/schema.lua", + + ["kong.llm"] = "kong/llm/init.lua", + ["kong.llm.drivers.shared"] = "kong/llm/drivers/shared.lua", + ["kong.llm.drivers.openai"] = "kong/llm/drivers/openai.lua", + ["kong.llm.drivers.azure"] = "kong/llm/drivers/azure.lua", + ["kong.llm.drivers.cohere"] = "kong/llm/drivers/cohere.lua", + ["kong.llm.drivers.anthropic"] = "kong/llm/drivers/anthropic.lua", + ["kong.llm.drivers.mistral"] = "kong/llm/drivers/mistral.lua", + ["kong.llm.drivers.llama2"] = "kong/llm/drivers/llama2.lua", + + ["kong.plugins.ai-prompt-decorator.handler"] = "kong/plugins/ai-prompt-decorator/handler.lua", + ["kong.plugins.ai-prompt-decorator.schema"] = "kong/plugins/ai-prompt-decorator/schema.lua", + + ["kong.plugins.ai-prompt-template.handler"] = "kong/plugins/ai-prompt-template/handler.lua", + ["kong.plugins.ai-prompt-template.schema"] = "kong/plugins/ai-prompt-template/schema.lua", + ["kong.plugins.ai-prompt-template.templater"] = "kong/plugins/ai-prompt-template/templater.lua", + + ["kong.plugins.ai-prompt-guard.handler"] = "kong/plugins/ai-prompt-guard/handler.lua", + ["kong.plugins.ai-prompt-guard.schema"] = "kong/plugins/ai-prompt-guard/schema.lua", + + ["kong.vaults.env"] = "kong/vaults/env/init.lua", + ["kong.vaults.env.schema"] = "kong/vaults/env/schema.lua", + + ["kong.tracing.instrumentation"] = "kong/tracing/instrumentation.lua", + ["kong.tracing.propagation"] = "kong/tracing/propagation.lua", + ["kong.tracing.request_id"] = "kong/tracing/request_id.lua", + ["kong.tracing.tracing_context"] = "kong/tracing/tracing_context.lua", + + ["kong.timing"] = "kong/timing/init.lua", + ["kong.timing.context"] = "kong/timing/context.lua", + ["kong.timing.hooks"] = "kong/timing/hooks/init.lua", + ["kong.timing.hooks.dns"] = "kong/timing/hooks/dns.lua", + ["kong.timing.hooks.http"] = "kong/timing/hooks/http.lua", + ["kong.timing.hooks.redis"] = "kong/timing/hooks/redis.lua", + ["kong.timing.hooks.socket"] = "kong/timing/hooks/socket.lua", + + ["kong.dynamic_hook"] = "kong/dynamic_hook/init.lua", + ["kong.dynamic_hook.wrap_function_gen"] = "kong/dynamic_hook/wrap_function_gen.lua", + } +} diff --git a/go.mod b/go.mod index 77dfbc7146e..5e9ffe257a0 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/anchore/go-macholibre v0.0.0-20220308212642-53e6d0aaf6fb github.com/anchore/go-testutils v0.0.0-20200925183923-d5f45b0d3c04 github.com/anchore/go-version v1.2.2-0.20200701162849-18adb9c92b9b - github.com/anchore/packageurl-go v0.1.1-0.20240312213626-055233e539b4 + github.com/anchore/packageurl-go v0.1.1-0.20240507183024-848e011fc24f github.com/anchore/stereoscope v0.0.3-0.20240501181043-2e9894674185 github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // we are hinting brotli to latest due to warning when installing archiver v3: diff --git a/go.sum b/go.sum index 73677e45111..7eef1df8ea4 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/anchore/go-testutils v0.0.0-20200925183923-d5f45b0d3c04 h1:VzprUTpc0v github.com/anchore/go-testutils v0.0.0-20200925183923-d5f45b0d3c04/go.mod h1:6dK64g27Qi1qGQZ67gFmBFvEHScy0/C8qhQhNe5B5pQ= github.com/anchore/go-version v1.2.2-0.20200701162849-18adb9c92b9b h1:e1bmaoJfZVsCYMrIZBpFxwV26CbsuoEh5muXD5I1Ods= github.com/anchore/go-version v1.2.2-0.20200701162849-18adb9c92b9b/go.mod h1:Bkc+JYWjMCF8OyZ340IMSIi2Ebf3uwByOk6ho4wne1E= -github.com/anchore/packageurl-go v0.1.1-0.20240312213626-055233e539b4 h1:SjemQ90fgflz39HG+VMkNfrpUVJpcFW6ZFA3TDXqzBM= -github.com/anchore/packageurl-go v0.1.1-0.20240312213626-055233e539b4/go.mod h1:Blo6OgJNiYF41ufcgHKkbCKF2MDOMlrqhXv/ij6ocR4= +github.com/anchore/packageurl-go v0.1.1-0.20240507183024-848e011fc24f h1:B/E9ixKNCasntpoch61NDaQyGPDXLEJlL+B9B/PbdbA= +github.com/anchore/packageurl-go v0.1.1-0.20240507183024-848e011fc24f/go.mod h1:Blo6OgJNiYF41ufcgHKkbCKF2MDOMlrqhXv/ij6ocR4= github.com/anchore/stereoscope v0.0.3-0.20240501181043-2e9894674185 h1:SuViDJ27nZ+joGdKbAkxAlm7tYMt9NTxTZZ05po4hls= github.com/anchore/stereoscope v0.0.3-0.20240501181043-2e9894674185/go.mod h1:ckIamHiRMp8iBwWoTtE5Xkt9VQ5QC+6+O4VzwqyZr5Q= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= diff --git a/internal/constants.go b/internal/constants.go index 97e8ab6ebab..add8a915e8a 100644 --- a/internal/constants.go +++ b/internal/constants.go @@ -3,5 +3,5 @@ package internal const ( // JSONSchemaVersion is the current schema version output by the JSON encoder // This is roughly following the "SchemaVer" guidelines for versioning the JSON schema. Please see schema/json/README.md for details on how to increment. - JSONSchemaVersion = "16.0.9" + JSONSchemaVersion = "16.0.10" ) diff --git a/internal/task/package_tasks.go b/internal/task/package_tasks.go index 079857f76be..d9eca298f34 100644 --- a/internal/task/package_tasks.go +++ b/internal/task/package_tasks.go @@ -19,6 +19,7 @@ import ( "github.com/anchore/syft/syft/pkg/cataloger/java" "github.com/anchore/syft/syft/pkg/cataloger/javascript" "github.com/anchore/syft/syft/pkg/cataloger/kernel" + "github.com/anchore/syft/syft/pkg/cataloger/lua" "github.com/anchore/syft/syft/pkg/cataloger/nix" "github.com/anchore/syft/syft/pkg/cataloger/php" "github.com/anchore/syft/syft/pkg/cataloger/python" @@ -110,6 +111,7 @@ func DefaultPackageTaskFactories() PackageTaskFactories { ), newSimplePackageTaskFactory(java.NewNativeImageCataloger, pkgcataloging.DirectoryTag, pkgcataloging.InstalledTag, pkgcataloging.ImageTag, pkgcataloging.LanguageTag, "java"), newSimplePackageTaskFactory(nix.NewStoreCataloger, pkgcataloging.DirectoryTag, pkgcataloging.InstalledTag, pkgcataloging.ImageTag, pkgcataloging.LanguageTag, "nix"), + newSimplePackageTaskFactory(lua.NewPackageCataloger, pkgcataloging.DirectoryTag, pkgcataloging.InstalledTag, pkgcataloging.ImageTag, pkgcataloging.LanguageTag, "lua"), // other package catalogers /////////////////////////////////////////////////////////////////////////// newPackageTaskFactory( diff --git a/schema/json/schema-16.0.10.json b/schema/json/schema-16.0.10.json new file mode 100644 index 00000000000..e07f0cb269f --- /dev/null +++ b/schema/json/schema-16.0.10.json @@ -0,0 +1,2445 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "anchore.io/schema/syft/json/16.0.10/document", + "$ref": "#/$defs/Document", + "$defs": { + "AlpmDbEntry": { + "properties": { + "basepackage": { + "type": "string" + }, + "package": { + "type": "string" + }, + "version": { + "type": "string" + }, + "description": { + "type": "string" + }, + "architecture": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "packager": { + "type": "string" + }, + "url": { + "type": "string" + }, + "validation": { + "type": "string" + }, + "reason": { + "type": "integer" + }, + "files": { + "items": { + "$ref": "#/$defs/AlpmFileRecord" + }, + "type": "array" + }, + "backup": { + "items": { + "$ref": "#/$defs/AlpmFileRecord" + }, + "type": "array" + }, + "provides": { + "items": { + "type": "string" + }, + "type": "array" + }, + "depends": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "basepackage", + "package", + "version", + "description", + "architecture", + "size", + "packager", + "url", + "validation", + "reason", + "files", + "backup" + ] + }, + "AlpmFileRecord": { + "properties": { + "path": { + "type": "string" + }, + "type": { + "type": "string" + }, + "uid": { + "type": "string" + }, + "gid": { + "type": "string" + }, + "time": { + "type": "string", + "format": "date-time" + }, + "size": { + "type": "string" + }, + "link": { + "type": "string" + }, + "digest": { + "items": { + "$ref": "#/$defs/Digest" + }, + "type": "array" + } + }, + "type": "object" + }, + "ApkDbEntry": { + "properties": { + "package": { + "type": "string" + }, + "originPackage": { + "type": "string" + }, + "maintainer": { + "type": "string" + }, + "version": { + "type": "string" + }, + "architecture": { + "type": "string" + }, + "url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "installedSize": { + "type": "integer" + }, + "pullDependencies": { + "items": { + "type": "string" + }, + "type": "array" + }, + "provides": { + "items": { + "type": "string" + }, + "type": "array" + }, + "pullChecksum": { + "type": "string" + }, + "gitCommitOfApkPort": { + "type": "string" + }, + "files": { + "items": { + "$ref": "#/$defs/ApkFileRecord" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "package", + "originPackage", + "maintainer", + "version", + "architecture", + "url", + "description", + "size", + "installedSize", + "pullDependencies", + "provides", + "pullChecksum", + "gitCommitOfApkPort", + "files" + ] + }, + "ApkFileRecord": { + "properties": { + "path": { + "type": "string" + }, + "ownerUid": { + "type": "string" + }, + "ownerGid": { + "type": "string" + }, + "permissions": { + "type": "string" + }, + "digest": { + "$ref": "#/$defs/Digest" + } + }, + "type": "object", + "required": [ + "path" + ] + }, + "BinarySignature": { + "properties": { + "matches": { + "items": { + "$ref": "#/$defs/ClassifierMatch" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "matches" + ] + }, + "CConanFileEntry": { + "properties": { + "ref": { + "type": "string" + } + }, + "type": "object", + "required": [ + "ref" + ] + }, + "CConanInfoEntry": { + "properties": { + "ref": { + "type": "string" + }, + "package_id": { + "type": "string" + } + }, + "type": "object", + "required": [ + "ref" + ] + }, + "CConanLockEntry": { + "properties": { + "ref": { + "type": "string" + }, + "package_id": { + "type": "string" + }, + "prev": { + "type": "string" + }, + "requires": { + "items": { + "type": "string" + }, + "type": "array" + }, + "build_requires": { + "items": { + "type": "string" + }, + "type": "array" + }, + "py_requires": { + "items": { + "type": "string" + }, + "type": "array" + }, + "options": { + "$ref": "#/$defs/KeyValues" + }, + "path": { + "type": "string" + }, + "context": { + "type": "string" + } + }, + "type": "object", + "required": [ + "ref" + ] + }, + "CConanLockV2Entry": { + "properties": { + "ref": { + "type": "string" + }, + "packageID": { + "type": "string" + }, + "username": { + "type": "string" + }, + "channel": { + "type": "string" + }, + "recipeRevision": { + "type": "string" + }, + "packageRevision": { + "type": "string" + }, + "timestamp": { + "type": "string" + } + }, + "type": "object", + "required": [ + "ref" + ] + }, + "CPE": { + "properties": { + "cpe": { + "type": "string" + }, + "source": { + "type": "string" + } + }, + "type": "object", + "required": [ + "cpe" + ] + }, + "ClassifierMatch": { + "properties": { + "classifier": { + "type": "string" + }, + "location": { + "$ref": "#/$defs/Location" + } + }, + "type": "object", + "required": [ + "classifier", + "location" + ] + }, + "CocoaPodfileLockEntry": { + "properties": { + "checksum": { + "type": "string" + } + }, + "type": "object", + "required": [ + "checksum" + ] + }, + "Coordinates": { + "properties": { + "path": { + "type": "string" + }, + "layerID": { + "type": "string" + } + }, + "type": "object", + "required": [ + "path" + ] + }, + "DartPubspecLockEntry": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "hosted_url": { + "type": "string" + }, + "vcs_url": { + "type": "string" + } + }, + "type": "object", + "required": [ + "name", + "version" + ] + }, + "Descriptor": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "configuration": true + }, + "type": "object", + "required": [ + "name", + "version" + ] + }, + "Digest": { + "properties": { + "algorithm": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object", + "required": [ + "algorithm", + "value" + ] + }, + "Document": { + "properties": { + "artifacts": { + "items": { + "$ref": "#/$defs/Package" + }, + "type": "array" + }, + "artifactRelationships": { + "items": { + "$ref": "#/$defs/Relationship" + }, + "type": "array" + }, + "files": { + "items": { + "$ref": "#/$defs/File" + }, + "type": "array" + }, + "source": { + "$ref": "#/$defs/Source" + }, + "distro": { + "$ref": "#/$defs/LinuxRelease" + }, + "descriptor": { + "$ref": "#/$defs/Descriptor" + }, + "schema": { + "$ref": "#/$defs/Schema" + } + }, + "type": "object", + "required": [ + "artifacts", + "artifactRelationships", + "source", + "distro", + "descriptor", + "schema" + ] + }, + "DotnetDepsEntry": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "path": { + "type": "string" + }, + "sha512": { + "type": "string" + }, + "hashPath": { + "type": "string" + } + }, + "type": "object", + "required": [ + "name", + "version", + "path", + "sha512", + "hashPath" + ] + }, + "DotnetPortableExecutableEntry": { + "properties": { + "assemblyVersion": { + "type": "string" + }, + "legalCopyright": { + "type": "string" + }, + "comments": { + "type": "string" + }, + "internalName": { + "type": "string" + }, + "companyName": { + "type": "string" + }, + "productName": { + "type": "string" + }, + "productVersion": { + "type": "string" + } + }, + "type": "object", + "required": [ + "assemblyVersion", + "legalCopyright", + "companyName", + "productName", + "productVersion" + ] + }, + "DpkgDbEntry": { + "properties": { + "package": { + "type": "string" + }, + "source": { + "type": "string" + }, + "version": { + "type": "string" + }, + "sourceVersion": { + "type": "string" + }, + "architecture": { + "type": "string" + }, + "maintainer": { + "type": "string" + }, + "installedSize": { + "type": "integer" + }, + "provides": { + "items": { + "type": "string" + }, + "type": "array" + }, + "depends": { + "items": { + "type": "string" + }, + "type": "array" + }, + "preDepends": { + "items": { + "type": "string" + }, + "type": "array" + }, + "files": { + "items": { + "$ref": "#/$defs/DpkgFileRecord" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "package", + "source", + "version", + "sourceVersion", + "architecture", + "maintainer", + "installedSize", + "files" + ] + }, + "DpkgFileRecord": { + "properties": { + "path": { + "type": "string" + }, + "digest": { + "$ref": "#/$defs/Digest" + }, + "isConfigFile": { + "type": "boolean" + } + }, + "type": "object", + "required": [ + "path", + "isConfigFile" + ] + }, + "ELFSecurityFeatures": { + "properties": { + "symbolTableStripped": { + "type": "boolean" + }, + "stackCanary": { + "type": "boolean" + }, + "nx": { + "type": "boolean" + }, + "relRO": { + "type": "string" + }, + "pie": { + "type": "boolean" + }, + "dso": { + "type": "boolean" + }, + "safeStack": { + "type": "boolean" + }, + "cfi": { + "type": "boolean" + }, + "fortify": { + "type": "boolean" + } + }, + "type": "object", + "required": [ + "symbolTableStripped", + "nx", + "relRO", + "pie", + "dso" + ] + }, + "ElfBinaryPackageNoteJsonPayload": { + "properties": { + "type": { + "type": "string" + }, + "vendor": { + "type": "string" + }, + "system": { + "type": "string" + }, + "sourceRepo": { + "type": "string" + }, + "commit": { + "type": "string" + } + }, + "type": "object" + }, + "ElixirMixLockEntry": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "pkgHash": { + "type": "string" + }, + "pkgHashExt": { + "type": "string" + } + }, + "type": "object", + "required": [ + "name", + "version", + "pkgHash", + "pkgHashExt" + ] + }, + "ErlangRebarLockEntry": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "pkgHash": { + "type": "string" + }, + "pkgHashExt": { + "type": "string" + } + }, + "type": "object", + "required": [ + "name", + "version", + "pkgHash", + "pkgHashExt" + ] + }, + "Executable": { + "properties": { + "format": { + "type": "string" + }, + "hasExports": { + "type": "boolean" + }, + "hasEntrypoint": { + "type": "boolean" + }, + "importedLibraries": { + "items": { + "type": "string" + }, + "type": "array" + }, + "elfSecurityFeatures": { + "$ref": "#/$defs/ELFSecurityFeatures" + } + }, + "type": "object", + "required": [ + "format", + "hasExports", + "hasEntrypoint", + "importedLibraries" + ] + }, + "File": { + "properties": { + "id": { + "type": "string" + }, + "location": { + "$ref": "#/$defs/Coordinates" + }, + "metadata": { + "$ref": "#/$defs/FileMetadataEntry" + }, + "contents": { + "type": "string" + }, + "digests": { + "items": { + "$ref": "#/$defs/Digest" + }, + "type": "array" + }, + "licenses": { + "items": { + "$ref": "#/$defs/FileLicense" + }, + "type": "array" + }, + "executable": { + "$ref": "#/$defs/Executable" + } + }, + "type": "object", + "required": [ + "id", + "location" + ] + }, + "FileLicense": { + "properties": { + "value": { + "type": "string" + }, + "spdxExpression": { + "type": "string" + }, + "type": { + "type": "string" + }, + "evidence": { + "$ref": "#/$defs/FileLicenseEvidence" + } + }, + "type": "object", + "required": [ + "value", + "spdxExpression", + "type" + ] + }, + "FileLicenseEvidence": { + "properties": { + "confidence": { + "type": "integer" + }, + "offset": { + "type": "integer" + }, + "extent": { + "type": "integer" + } + }, + "type": "object", + "required": [ + "confidence", + "offset", + "extent" + ] + }, + "FileMetadataEntry": { + "properties": { + "mode": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "linkDestination": { + "type": "string" + }, + "userID": { + "type": "integer" + }, + "groupID": { + "type": "integer" + }, + "mimeType": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "type": "object", + "required": [ + "mode", + "type", + "userID", + "groupID", + "mimeType", + "size" + ] + }, + "GoModuleBuildinfoEntry": { + "properties": { + "goBuildSettings": { + "$ref": "#/$defs/KeyValues" + }, + "goCompiledVersion": { + "type": "string" + }, + "architecture": { + "type": "string" + }, + "h1Digest": { + "type": "string" + }, + "mainModule": { + "type": "string" + }, + "goCryptoSettings": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "goCompiledVersion", + "architecture" + ] + }, + "GoModuleEntry": { + "properties": { + "h1Digest": { + "type": "string" + } + }, + "type": "object" + }, + "HaskellHackageStackEntry": { + "properties": { + "pkgHash": { + "type": "string" + } + }, + "type": "object" + }, + "HaskellHackageStackLockEntry": { + "properties": { + "pkgHash": { + "type": "string" + }, + "snapshotURL": { + "type": "string" + } + }, + "type": "object" + }, + "IDLikes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "JavaArchive": { + "properties": { + "virtualPath": { + "type": "string" + }, + "manifest": { + "$ref": "#/$defs/JavaManifest" + }, + "pomProperties": { + "$ref": "#/$defs/JavaPomProperties" + }, + "pomProject": { + "$ref": "#/$defs/JavaPomProject" + }, + "digest": { + "items": { + "$ref": "#/$defs/Digest" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "virtualPath" + ] + }, + "JavaManifest": { + "properties": { + "main": { + "$ref": "#/$defs/KeyValues" + }, + "sections": { + "items": { + "$ref": "#/$defs/KeyValues" + }, + "type": "array" + } + }, + "type": "object" + }, + "JavaPomParent": { + "properties": { + "groupId": { + "type": "string" + }, + "artifactId": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "type": "object", + "required": [ + "groupId", + "artifactId", + "version" + ] + }, + "JavaPomProject": { + "properties": { + "path": { + "type": "string" + }, + "parent": { + "$ref": "#/$defs/JavaPomParent" + }, + "groupId": { + "type": "string" + }, + "artifactId": { + "type": "string" + }, + "version": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object", + "required": [ + "path", + "groupId", + "artifactId", + "version", + "name" + ] + }, + "JavaPomProperties": { + "properties": { + "path": { + "type": "string" + }, + "name": { + "type": "string" + }, + "groupId": { + "type": "string" + }, + "artifactId": { + "type": "string" + }, + "version": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "extraFields": { + "patternProperties": { + ".*": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object", + "required": [ + "path", + "name", + "groupId", + "artifactId", + "version" + ] + }, + "JavascriptNpmPackage": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "author": { + "type": "string" + }, + "homepage": { + "type": "string" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "private": { + "type": "boolean" + } + }, + "type": "object", + "required": [ + "name", + "version", + "author", + "homepage", + "description", + "url", + "private" + ] + }, + "JavascriptNpmPackageLockEntry": { + "properties": { + "resolved": { + "type": "string" + }, + "integrity": { + "type": "string" + } + }, + "type": "object", + "required": [ + "resolved", + "integrity" + ] + }, + "JavascriptYarnLockEntry": { + "properties": { + "resolved": { + "type": "string" + }, + "integrity": { + "type": "string" + } + }, + "type": "object", + "required": [ + "resolved", + "integrity" + ] + }, + "KeyValue": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object", + "required": [ + "key", + "value" + ] + }, + "KeyValues": { + "items": { + "$ref": "#/$defs/KeyValue" + }, + "type": "array" + }, + "License": { + "properties": { + "value": { + "type": "string" + }, + "spdxExpression": { + "type": "string" + }, + "type": { + "type": "string" + }, + "urls": { + "items": { + "type": "string" + }, + "type": "array" + }, + "locations": { + "items": { + "$ref": "#/$defs/Location" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "value", + "spdxExpression", + "type", + "urls", + "locations" + ] + }, + "LinuxKernelArchive": { + "properties": { + "name": { + "type": "string" + }, + "architecture": { + "type": "string" + }, + "version": { + "type": "string" + }, + "extendedVersion": { + "type": "string" + }, + "buildTime": { + "type": "string" + }, + "author": { + "type": "string" + }, + "format": { + "type": "string" + }, + "rwRootFS": { + "type": "boolean" + }, + "swapDevice": { + "type": "integer" + }, + "rootDevice": { + "type": "integer" + }, + "videoMode": { + "type": "string" + } + }, + "type": "object", + "required": [ + "name", + "architecture", + "version" + ] + }, + "LinuxKernelModule": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "sourceVersion": { + "type": "string" + }, + "path": { + "type": "string" + }, + "description": { + "type": "string" + }, + "author": { + "type": "string" + }, + "license": { + "type": "string" + }, + "kernelVersion": { + "type": "string" + }, + "versionMagic": { + "type": "string" + }, + "parameters": { + "patternProperties": { + ".*": { + "$ref": "#/$defs/LinuxKernelModuleParameter" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "LinuxKernelModuleParameter": { + "properties": { + "type": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "type": "object" + }, + "LinuxRelease": { + "properties": { + "prettyName": { + "type": "string" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "idLike": { + "$ref": "#/$defs/IDLikes" + }, + "version": { + "type": "string" + }, + "versionID": { + "type": "string" + }, + "versionCodename": { + "type": "string" + }, + "buildID": { + "type": "string" + }, + "imageID": { + "type": "string" + }, + "imageVersion": { + "type": "string" + }, + "variant": { + "type": "string" + }, + "variantID": { + "type": "string" + }, + "homeURL": { + "type": "string" + }, + "supportURL": { + "type": "string" + }, + "bugReportURL": { + "type": "string" + }, + "privacyPolicyURL": { + "type": "string" + }, + "cpeName": { + "type": "string" + }, + "supportEnd": { + "type": "string" + } + }, + "type": "object" + }, + "Location": { + "properties": { + "path": { + "type": "string" + }, + "layerID": { + "type": "string" + }, + "accessPath": { + "type": "string" + }, + "annotations": { + "patternProperties": { + ".*": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object", + "required": [ + "path", + "accessPath" + ] + }, + "LuarocksPackage": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "license": { + "type": "string" + }, + "homepage": { + "type": "string" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "dependencies": { + "patternProperties": { + ".*": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object", + "required": [ + "name", + "version", + "license", + "homepage", + "description", + "url", + "dependencies" + ] + }, + "MicrosoftKbPatch": { + "properties": { + "product_id": { + "type": "string" + }, + "kb": { + "type": "string" + } + }, + "type": "object", + "required": [ + "product_id", + "kb" + ] + }, + "NixStoreEntry": { + "properties": { + "outputHash": { + "type": "string" + }, + "output": { + "type": "string" + }, + "files": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "outputHash", + "files" + ] + }, + "Package": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "type": { + "type": "string" + }, + "foundBy": { + "type": "string" + }, + "locations": { + "items": { + "$ref": "#/$defs/Location" + }, + "type": "array" + }, + "licenses": { + "$ref": "#/$defs/licenses" + }, + "language": { + "type": "string" + }, + "cpes": { + "$ref": "#/$defs/cpes" + }, + "purl": { + "type": "string" + }, + "metadataType": { + "type": "string" + }, + "metadata": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/AlpmDbEntry" + }, + { + "$ref": "#/$defs/ApkDbEntry" + }, + { + "$ref": "#/$defs/BinarySignature" + }, + { + "$ref": "#/$defs/CConanFileEntry" + }, + { + "$ref": "#/$defs/CConanInfoEntry" + }, + { + "$ref": "#/$defs/CConanLockEntry" + }, + { + "$ref": "#/$defs/CConanLockV2Entry" + }, + { + "$ref": "#/$defs/CocoaPodfileLockEntry" + }, + { + "$ref": "#/$defs/DartPubspecLockEntry" + }, + { + "$ref": "#/$defs/DotnetDepsEntry" + }, + { + "$ref": "#/$defs/DotnetPortableExecutableEntry" + }, + { + "$ref": "#/$defs/DpkgDbEntry" + }, + { + "$ref": "#/$defs/ElfBinaryPackageNoteJsonPayload" + }, + { + "$ref": "#/$defs/ElixirMixLockEntry" + }, + { + "$ref": "#/$defs/ErlangRebarLockEntry" + }, + { + "$ref": "#/$defs/GoModuleBuildinfoEntry" + }, + { + "$ref": "#/$defs/GoModuleEntry" + }, + { + "$ref": "#/$defs/HaskellHackageStackEntry" + }, + { + "$ref": "#/$defs/HaskellHackageStackLockEntry" + }, + { + "$ref": "#/$defs/JavaArchive" + }, + { + "$ref": "#/$defs/JavascriptNpmPackage" + }, + { + "$ref": "#/$defs/JavascriptNpmPackageLockEntry" + }, + { + "$ref": "#/$defs/JavascriptYarnLockEntry" + }, + { + "$ref": "#/$defs/LinuxKernelArchive" + }, + { + "$ref": "#/$defs/LinuxKernelModule" + }, + { + "$ref": "#/$defs/LuarocksPackage" + }, + { + "$ref": "#/$defs/MicrosoftKbPatch" + }, + { + "$ref": "#/$defs/NixStoreEntry" + }, + { + "$ref": "#/$defs/PhpComposerInstalledEntry" + }, + { + "$ref": "#/$defs/PhpComposerLockEntry" + }, + { + "$ref": "#/$defs/PhpPeclEntry" + }, + { + "$ref": "#/$defs/PortageDbEntry" + }, + { + "$ref": "#/$defs/PythonPackage" + }, + { + "$ref": "#/$defs/PythonPipRequirementsEntry" + }, + { + "$ref": "#/$defs/PythonPipfileLockEntry" + }, + { + "$ref": "#/$defs/PythonPoetryLockEntry" + }, + { + "$ref": "#/$defs/RDescription" + }, + { + "$ref": "#/$defs/RpmArchive" + }, + { + "$ref": "#/$defs/RpmDbEntry" + }, + { + "$ref": "#/$defs/RubyGemspec" + }, + { + "$ref": "#/$defs/RustCargoAuditEntry" + }, + { + "$ref": "#/$defs/RustCargoLockEntry" + }, + { + "$ref": "#/$defs/SwiftPackageManagerLockEntry" + }, + { + "$ref": "#/$defs/WordpressPluginEntry" + } + ] + } + }, + "type": "object", + "required": [ + "id", + "name", + "version", + "type", + "foundBy", + "locations", + "licenses", + "language", + "cpes", + "purl" + ] + }, + "PhpComposerAuthors": { + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "homepage": { + "type": "string" + } + }, + "type": "object", + "required": [ + "name" + ] + }, + "PhpComposerExternalReference": { + "properties": { + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "reference": { + "type": "string" + }, + "shasum": { + "type": "string" + } + }, + "type": "object", + "required": [ + "type", + "url", + "reference" + ] + }, + "PhpComposerInstalledEntry": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "source": { + "$ref": "#/$defs/PhpComposerExternalReference" + }, + "dist": { + "$ref": "#/$defs/PhpComposerExternalReference" + }, + "require": { + "patternProperties": { + ".*": { + "type": "string" + } + }, + "type": "object" + }, + "provide": { + "patternProperties": { + ".*": { + "type": "string" + } + }, + "type": "object" + }, + "require-dev": { + "patternProperties": { + ".*": { + "type": "string" + } + }, + "type": "object" + }, + "suggest": { + "patternProperties": { + ".*": { + "type": "string" + } + }, + "type": "object" + }, + "license": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": { + "type": "string" + }, + "notification-url": { + "type": "string" + }, + "bin": { + "items": { + "type": "string" + }, + "type": "array" + }, + "authors": { + "items": { + "$ref": "#/$defs/PhpComposerAuthors" + }, + "type": "array" + }, + "description": { + "type": "string" + }, + "homepage": { + "type": "string" + }, + "keywords": { + "items": { + "type": "string" + }, + "type": "array" + }, + "time": { + "type": "string" + } + }, + "type": "object", + "required": [ + "name", + "version", + "source", + "dist" + ] + }, + "PhpComposerLockEntry": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "source": { + "$ref": "#/$defs/PhpComposerExternalReference" + }, + "dist": { + "$ref": "#/$defs/PhpComposerExternalReference" + }, + "require": { + "patternProperties": { + ".*": { + "type": "string" + } + }, + "type": "object" + }, + "provide": { + "patternProperties": { + ".*": { + "type": "string" + } + }, + "type": "object" + }, + "require-dev": { + "patternProperties": { + ".*": { + "type": "string" + } + }, + "type": "object" + }, + "suggest": { + "patternProperties": { + ".*": { + "type": "string" + } + }, + "type": "object" + }, + "license": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": { + "type": "string" + }, + "notification-url": { + "type": "string" + }, + "bin": { + "items": { + "type": "string" + }, + "type": "array" + }, + "authors": { + "items": { + "$ref": "#/$defs/PhpComposerAuthors" + }, + "type": "array" + }, + "description": { + "type": "string" + }, + "homepage": { + "type": "string" + }, + "keywords": { + "items": { + "type": "string" + }, + "type": "array" + }, + "time": { + "type": "string" + } + }, + "type": "object", + "required": [ + "name", + "version", + "source", + "dist" + ] + }, + "PhpPeclEntry": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "license": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "name", + "version" + ] + }, + "PortageDbEntry": { + "properties": { + "installedSize": { + "type": "integer" + }, + "files": { + "items": { + "$ref": "#/$defs/PortageFileRecord" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "installedSize", + "files" + ] + }, + "PortageFileRecord": { + "properties": { + "path": { + "type": "string" + }, + "digest": { + "$ref": "#/$defs/Digest" + } + }, + "type": "object", + "required": [ + "path" + ] + }, + "PythonDirectURLOriginInfo": { + "properties": { + "url": { + "type": "string" + }, + "commitId": { + "type": "string" + }, + "vcs": { + "type": "string" + } + }, + "type": "object", + "required": [ + "url" + ] + }, + "PythonFileDigest": { + "properties": { + "algorithm": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object", + "required": [ + "algorithm", + "value" + ] + }, + "PythonFileRecord": { + "properties": { + "path": { + "type": "string" + }, + "digest": { + "$ref": "#/$defs/PythonFileDigest" + }, + "size": { + "type": "string" + } + }, + "type": "object", + "required": [ + "path" + ] + }, + "PythonPackage": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "author": { + "type": "string" + }, + "authorEmail": { + "type": "string" + }, + "platform": { + "type": "string" + }, + "files": { + "items": { + "$ref": "#/$defs/PythonFileRecord" + }, + "type": "array" + }, + "sitePackagesRootPath": { + "type": "string" + }, + "topLevelPackages": { + "items": { + "type": "string" + }, + "type": "array" + }, + "directUrlOrigin": { + "$ref": "#/$defs/PythonDirectURLOriginInfo" + } + }, + "type": "object", + "required": [ + "name", + "version", + "author", + "authorEmail", + "platform", + "sitePackagesRootPath" + ] + }, + "PythonPipRequirementsEntry": { + "properties": { + "name": { + "type": "string" + }, + "extras": { + "items": { + "type": "string" + }, + "type": "array" + }, + "versionConstraint": { + "type": "string" + }, + "url": { + "type": "string" + }, + "markers": { + "type": "string" + } + }, + "type": "object", + "required": [ + "name", + "versionConstraint" + ] + }, + "PythonPipfileLockEntry": { + "properties": { + "hashes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "index": { + "type": "string" + } + }, + "type": "object", + "required": [ + "hashes", + "index" + ] + }, + "PythonPoetryLockEntry": { + "properties": { + "index": { + "type": "string" + } + }, + "type": "object", + "required": [ + "index" + ] + }, + "RDescription": { + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "author": { + "type": "string" + }, + "maintainer": { + "type": "string" + }, + "url": { + "items": { + "type": "string" + }, + "type": "array" + }, + "repository": { + "type": "string" + }, + "built": { + "type": "string" + }, + "needsCompilation": { + "type": "boolean" + }, + "imports": { + "items": { + "type": "string" + }, + "type": "array" + }, + "depends": { + "items": { + "type": "string" + }, + "type": "array" + }, + "suggests": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "Relationship": { + "properties": { + "parent": { + "type": "string" + }, + "child": { + "type": "string" + }, + "type": { + "type": "string" + }, + "metadata": true + }, + "type": "object", + "required": [ + "parent", + "child", + "type" + ] + }, + "RpmArchive": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "epoch": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "architecture": { + "type": "string" + }, + "release": { + "type": "string" + }, + "sourceRpm": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "vendor": { + "type": "string" + }, + "modularityLabel": { + "type": "string" + }, + "provides": { + "items": { + "type": "string" + }, + "type": "array" + }, + "requires": { + "items": { + "type": "string" + }, + "type": "array" + }, + "files": { + "items": { + "$ref": "#/$defs/RpmFileRecord" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "name", + "version", + "epoch", + "architecture", + "release", + "sourceRpm", + "size", + "vendor", + "files" + ] + }, + "RpmDbEntry": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "epoch": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "architecture": { + "type": "string" + }, + "release": { + "type": "string" + }, + "sourceRpm": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "vendor": { + "type": "string" + }, + "modularityLabel": { + "type": "string" + }, + "provides": { + "items": { + "type": "string" + }, + "type": "array" + }, + "requires": { + "items": { + "type": "string" + }, + "type": "array" + }, + "files": { + "items": { + "$ref": "#/$defs/RpmFileRecord" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "name", + "version", + "epoch", + "architecture", + "release", + "sourceRpm", + "size", + "vendor", + "files" + ] + }, + "RpmFileRecord": { + "properties": { + "path": { + "type": "string" + }, + "mode": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "digest": { + "$ref": "#/$defs/Digest" + }, + "userName": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "flags": { + "type": "string" + } + }, + "type": "object", + "required": [ + "path", + "mode", + "size", + "digest", + "userName", + "groupName", + "flags" + ] + }, + "RubyGemspec": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "files": { + "items": { + "type": "string" + }, + "type": "array" + }, + "authors": { + "items": { + "type": "string" + }, + "type": "array" + }, + "homepage": { + "type": "string" + } + }, + "type": "object", + "required": [ + "name", + "version" + ] + }, + "RustCargoAuditEntry": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "source": { + "type": "string" + } + }, + "type": "object", + "required": [ + "name", + "version", + "source" + ] + }, + "RustCargoLockEntry": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "source": { + "type": "string" + }, + "checksum": { + "type": "string" + }, + "dependencies": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "name", + "version", + "source", + "checksum", + "dependencies" + ] + }, + "Schema": { + "properties": { + "version": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object", + "required": [ + "version", + "url" + ] + }, + "Source": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "type": { + "type": "string" + }, + "metadata": true + }, + "type": "object", + "required": [ + "id", + "name", + "version", + "type", + "metadata" + ] + }, + "SwiftPackageManagerLockEntry": { + "properties": { + "revision": { + "type": "string" + } + }, + "type": "object", + "required": [ + "revision" + ] + }, + "WordpressPluginEntry": { + "properties": { + "pluginInstallDirectory": { + "type": "string" + }, + "author": { + "type": "string" + }, + "authorUri": { + "type": "string" + } + }, + "type": "object", + "required": [ + "pluginInstallDirectory" + ] + }, + "cpes": { + "items": { + "$ref": "#/$defs/CPE" + }, + "type": "array" + }, + "licenses": { + "items": { + "$ref": "#/$defs/License" + }, + "type": "array" + } + } +} diff --git a/schema/json/schema-latest.json b/schema/json/schema-latest.json index 26f33c9431c..e07f0cb269f 100644 --- a/schema/json/schema-latest.json +++ b/schema/json/schema-latest.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "anchore.io/schema/syft/json/16.0.9/document", + "$id": "anchore.io/schema/syft/json/16.0.10/document", "$ref": "#/$defs/Document", "$defs": { "AlpmDbEntry": { @@ -1342,6 +1342,46 @@ "accessPath" ] }, + "LuarocksPackage": { + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "license": { + "type": "string" + }, + "homepage": { + "type": "string" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "dependencies": { + "patternProperties": { + ".*": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object", + "required": [ + "name", + "version", + "license", + "homepage", + "description", + "url", + "dependencies" + ] + }, "MicrosoftKbPatch": { "properties": { "product_id": { @@ -1496,6 +1536,9 @@ { "$ref": "#/$defs/LinuxKernelModule" }, + { + "$ref": "#/$defs/LuarocksPackage" + }, { "$ref": "#/$defs/MicrosoftKbPatch" }, diff --git a/syft/format/internal/spdxutil/helpers/originator_supplier_test.go b/syft/format/internal/spdxutil/helpers/originator_supplier_test.go index 5becc4bf0e8..705d0ab9891 100644 --- a/syft/format/internal/spdxutil/helpers/originator_supplier_test.go +++ b/syft/format/internal/spdxutil/helpers/originator_supplier_test.go @@ -27,6 +27,7 @@ func Test_OriginatorSupplier(t *testing.T) { pkg.HackageStackYamlLockEntry{}, pkg.HackageStackYamlEntry{}, pkg.LinuxKernel{}, + pkg.LuaRocksPackage{}, pkg.MicrosoftKbPatch{}, pkg.NixStoreEntry{}, pkg.NpmPackageLockEntry{}, @@ -185,6 +186,14 @@ func Test_OriginatorSupplier(t *testing.T) { originator: "Person: auth", supplier: "Person: auth", }, + { + name: "from Lua Rockspecs", + input: pkg.Package{ + Metadata: pkg.LuaRocksPackage{}, + }, + originator: "", + supplier: "", + }, { name: "from npm", input: pkg.Package{ diff --git a/syft/format/internal/spdxutil/helpers/source_info.go b/syft/format/internal/spdxutil/helpers/source_info.go index 7e10aab390c..a4970943a48 100644 --- a/syft/format/internal/spdxutil/helpers/source_info.go +++ b/syft/format/internal/spdxutil/helpers/source_info.go @@ -6,7 +6,7 @@ import ( "github.com/anchore/syft/syft/pkg" ) -//nolint:funlen +//nolint:funlen, gocyclo func SourceInfo(p pkg.Package) string { answer := "" switch p.Type { @@ -58,6 +58,8 @@ func SourceInfo(p pkg.Package) string { answer = "acquired package info from nix store path" case pkg.Rpkg: answer = "acquired package info from R-package DESCRIPTION file" + case pkg.LuaRocksPkg: + answer = "acquired package info from Rockspec package file" case pkg.SwiftPkg: answer = "acquired package info from resolved Swift package manifest" case pkg.GithubActionPkg, pkg.GithubActionWorkflowPkg: diff --git a/syft/format/internal/spdxutil/helpers/source_info_test.go b/syft/format/internal/spdxutil/helpers/source_info_test.go index 337a1ba7732..82f89a0eaaa 100644 --- a/syft/format/internal/spdxutil/helpers/source_info_test.go +++ b/syft/format/internal/spdxutil/helpers/source_info_test.go @@ -247,6 +247,14 @@ func Test_SourceInfo(t *testing.T) { "acquired package info from R-package DESCRIPTION file", }, }, + { + input: pkg.Package{ + Type: pkg.LuaRocksPkg, + }, + expected: []string{ + "acquired package info from Rockspec package file", + }, + }, { input: pkg.Package{ Type: pkg.SwiftPkg, diff --git a/syft/internal/packagemetadata/generated.go b/syft/internal/packagemetadata/generated.go index fec04d2c1b4..07d53474458 100644 --- a/syft/internal/packagemetadata/generated.go +++ b/syft/internal/packagemetadata/generated.go @@ -29,6 +29,7 @@ func AllTypes() []any { pkg.JavaArchive{}, pkg.LinuxKernel{}, pkg.LinuxKernelModule{}, + pkg.LuaRocksPackage{}, pkg.MicrosoftKbPatch{}, pkg.NixStoreEntry{}, pkg.NpmPackage{}, diff --git a/syft/internal/packagemetadata/names.go b/syft/internal/packagemetadata/names.go index 222c8237f2c..97ba0a958e2 100644 --- a/syft/internal/packagemetadata/names.go +++ b/syft/internal/packagemetadata/names.go @@ -105,6 +105,7 @@ var jsonTypes = makeJSONTypes( jsonNames(pkg.RustCargoLockEntry{}, "rust-cargo-lock-entry", "RustCargoPackageMetadata"), jsonNamesWithoutLookup(pkg.RustBinaryAuditEntry{}, "rust-cargo-audit-entry", "RustCargoPackageMetadata"), // the legacy value is split into two types, where the other is preferred jsonNames(pkg.WordpressPluginEntry{}, "wordpress-plugin-entry", "WordpressMetadata"), + jsonNames(pkg.LuaRocksPackage{}, "luarocks-package"), ) func expandLegacyNameVariants(names ...string) []string { diff --git a/syft/internal/parsing/basic_parsing.go b/syft/internal/parsing/basic_parsing.go new file mode 100644 index 00000000000..27a1175c836 --- /dev/null +++ b/syft/internal/parsing/basic_parsing.go @@ -0,0 +1,71 @@ +package parsing + +import ( + "bytes" + "fmt" + "strings" + "unicode" +) + +func IsWhitespace(c byte) bool { + return unicode.IsSpace(rune(c)) +} + +func IsLiteral(c byte) bool { + r := rune(c) + return unicode.IsNumber(r) || unicode.IsLetter(r) || r == '.' || r == '_' +} + +func SkipWhitespace(data []byte, i *int) { + for *i < len(data) && IsWhitespace(data[*i]) { + *i++ + } +} + +func PrintError(data []byte, i int) string { + line := 1 + char := 1 + + prev := []string{} + curr := bytes.Buffer{} + + for idx, c := range data { + if c == '\n' { + prev = append(prev, curr.String()) + curr.Reset() + + if idx >= i { + break + } + + line++ + char = 1 + continue + } + if idx < i { + char++ + } + curr.WriteByte(c) + } + + l1 := fmt.Sprintf("%d", line-1) + l2 := fmt.Sprintf("%d", line) + + if len(l1) < len(l2) { + l1 = " " + l1 + } + + sep := ": " + + lines := "" + if len(prev) > 1 { + lines += fmt.Sprintf("%s%s%s\n", l1, sep, prev[len(prev)-2]) + } + if len(prev) > 0 { + lines += fmt.Sprintf("%s%s%s\n", l2, sep, prev[len(prev)-1]) + } + + pointer := strings.Repeat(" ", len(l2)+len(sep)+char-1) + "^" + + return fmt.Sprintf("line: %v, char: %v\n%s%s", line, char, lines, pointer) +} diff --git a/syft/pkg/cataloger/erlang/erlang_parser.go b/syft/pkg/cataloger/erlang/erlang_parser.go index 829b0c143fd..60149b631da 100644 --- a/syft/pkg/cataloger/erlang/erlang_parser.go +++ b/syft/pkg/cataloger/erlang/erlang_parser.go @@ -5,8 +5,8 @@ import ( "errors" "fmt" "io" - "strings" - "unicode" + + "github.com/anchore/syft/syft/internal/parsing" ) type erlangNode struct { @@ -60,14 +60,14 @@ func parseErlang(reader io.Reader) (erlangNode, error) { for i < len(data) { item, err := parseErlangBlock(data, &i) if err == errSkipComments { - skipWhitespace(data, &i) + parsing.SkipWhitespace(data, &i) continue } if err != nil { - return node(nil), fmt.Errorf("%w\n%s", err, printError(data, i)) + return node(nil), fmt.Errorf("%w\n%s", err, parsing.PrintError(data, i)) } - skipWhitespace(data, &i) + parsing.SkipWhitespace(data, &i) if i, ok := item.value.(string); ok && i == "." { continue @@ -78,78 +78,24 @@ func parseErlang(reader io.Reader) (erlangNode, error) { return out, nil } -func printError(data []byte, i int) string { - line := 1 - char := 1 - - prev := []string{} - curr := bytes.Buffer{} - - for idx, c := range data { - if c == '\n' { - prev = append(prev, curr.String()) - curr.Reset() - - if idx >= i { - break - } - - line++ - char = 1 - continue - } - if idx < i { - char++ - } - curr.WriteByte(c) - } - - l1 := fmt.Sprintf("%d", line-1) - l2 := fmt.Sprintf("%d", line) - - if len(l1) < len(l2) { - l1 = " " + l1 - } - - sep := ": " - - lines := "" - if len(prev) > 1 { - lines += fmt.Sprintf("%s%s%s\n", l1, sep, prev[len(prev)-2]) - } - if len(prev) > 0 { - lines += fmt.Sprintf("%s%s%s\n", l2, sep, prev[len(prev)-1]) - } - - pointer := strings.Repeat(" ", len(l2)+len(sep)+char-1) + "^" - - return fmt.Sprintf("line: %v, char: %v\n%s%s", line, char, lines, pointer) -} - -func skipWhitespace(data []byte, i *int) { - for *i < len(data) && isWhitespace(data[*i]) { - *i++ - } -} - func parseErlangBlock(data []byte, i *int) (erlangNode, error) { block, err := parseErlangNode(data, i) if err != nil { return node(nil), err } - skipWhitespace(data, i) + parsing.SkipWhitespace(data, i) *i++ // skip the trailing . return block, nil } func parseErlangNode(data []byte, i *int) (erlangNode, error) { - skipWhitespace(data, i) + parsing.SkipWhitespace(data, i) c := data[*i] switch c { case '[', '{': offset := *i + 1 - skipWhitespace(data, &offset) + parsing.SkipWhitespace(data, &offset) c2 := data[offset] // Add support for empty lists @@ -170,27 +116,18 @@ func parseErlangNode(data []byte, i *int) (erlangNode, error) { return node(nil), errSkipComments } - if isLiteral(c) { + if parsing.IsLiteral(c) { return parseErlangLiteral(data, i) } return erlangNode{}, fmt.Errorf("invalid literal character: %s", string(c)) } -func isWhitespace(c byte) bool { - return unicode.IsSpace(rune(c)) -} - -func isLiteral(c byte) bool { - r := rune(c) - return unicode.IsNumber(r) || unicode.IsLetter(r) || r == '.' || r == '_' -} - func parseErlangLiteral(data []byte, i *int) (erlangNode, error) { var buf bytes.Buffer for *i < len(data) { c := data[*i] - if isLiteral(c) { + if parsing.IsLiteral(c) { buf.WriteByte(c) } else { break @@ -239,13 +176,13 @@ func parseErlangList(data []byte, i *int) (erlangNode, error) { item, err := parseErlangNode(data, i) if err != nil { if err == errSkipComments { - skipWhitespace(data, i) + parsing.SkipWhitespace(data, i) continue } return node(nil), err } out.value = append(out.value.([]erlangNode), item) - skipWhitespace(data, i) + parsing.SkipWhitespace(data, i) c := data[*i] switch c { case ',': diff --git a/syft/pkg/cataloger/lua/cataloger.go b/syft/pkg/cataloger/lua/cataloger.go new file mode 100644 index 00000000000..97df0fe464a --- /dev/null +++ b/syft/pkg/cataloger/lua/cataloger.go @@ -0,0 +1,15 @@ +/* +Package lua provides a concrete Cataloger implementation for packages relating to the Lua language ecosystem. +*/ +package lua + +import ( + "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/pkg/cataloger/generic" +) + +// NewPackageCataloger returns a new cataloger object for Lua ROck. +func NewPackageCataloger() pkg.Cataloger { + return generic.NewCataloger("lua-rock-cataloger"). + WithParserByGlobs(parseRockspec, "**/*.rockspec") +} diff --git a/syft/pkg/cataloger/lua/cataloger_test.go b/syft/pkg/cataloger/lua/cataloger_test.go new file mode 100644 index 00000000000..1dc591739d2 --- /dev/null +++ b/syft/pkg/cataloger/lua/cataloger_test.go @@ -0,0 +1,31 @@ +package lua + +import ( + "github.com/anchore/syft/syft/pkg/cataloger/internal/pkgtest" + "testing" +) + +func Test_PackageCataloger_Globs(t *testing.T) { + tests := []struct { + name string + fixture string + expected []string + }{ + { + name: "obtain package files", + fixture: "test-fixtures/glob-paths", + expected: []string{ + "lua/package.rockspec", + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + pkgtest.NewCatalogTester(). + FromDirectory(t, test.fixture). + ExpectsResolverContentQueries(test.expected). + TestCataloger(t, NewPackageCataloger()) + }) + } +} diff --git a/syft/pkg/cataloger/lua/package.go b/syft/pkg/cataloger/lua/package.go new file mode 100644 index 00000000000..c9eaa4da995 --- /dev/null +++ b/syft/pkg/cataloger/lua/package.go @@ -0,0 +1,45 @@ +package lua + +import ( + "github.com/anchore/packageurl-go" + "github.com/anchore/syft/syft/file" + "github.com/anchore/syft/syft/pkg" +) + +func newLuaRocksPackage(u luaRocksPackage, indexLocation file.Location) pkg.Package { + license := pkg.NewLicensesFromLocation(indexLocation, u.License) + p := pkg.Package{ + Name: u.Name, + Version: u.Version, + PURL: packageURL(u.Name, u.Version), + Locations: file.NewLocationSet(indexLocation), + Language: pkg.Lua, + Licenses: pkg.NewLicenseSet(license...), + Type: pkg.LuaRocksPkg, + Metadata: pkg.LuaRocksPackage{ + Name: u.Name, + Version: u.Version, + License: u.License, + Homepage: u.Homepage, + Description: u.Description, + URL: u.Repository.URL, + Dependencies: u.Dependencies, + }, + } + + p.SetID() + + return p +} + +// packageURL returns the PURL for the specific Lua Rock package (see https://github.com/package-url/purl-spec) +func packageURL(name, version string) string { + return packageurl.NewPackageURL( + packageurl.TypeLuaRocks, + "", + name, + version, + nil, + "", + ).ToString() +} diff --git a/syft/pkg/cataloger/lua/package_test.go b/syft/pkg/cataloger/lua/package_test.go new file mode 100644 index 00000000000..2a16c274266 --- /dev/null +++ b/syft/pkg/cataloger/lua/package_test.go @@ -0,0 +1,36 @@ +package lua + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/anchore/packageurl-go" +) + +func Test_packageURL(t *testing.T) { + + tests := []struct { + testName string + name string + version string + expected string + }{ + { + name: "kong", + version: "3.7.0-0", + expected: "pkg:luarocks/kong@3.7.0-0", + }, + } + for _, tt := range tests { + t.Run(tt.testName, func(t *testing.T) { + actual := packageURL(tt.name, tt.version) + assert.Equal(t, tt.expected, actual) + decoded, err := packageurl.FromString(actual) + require.NoError(t, err) + assert.Equal(t, tt.name, decoded.Name) + assert.Equal(t, tt.version, decoded.Version) + }) + } +} diff --git a/syft/pkg/cataloger/lua/parse_rockspec.go b/syft/pkg/cataloger/lua/parse_rockspec.go new file mode 100644 index 00000000000..a11709fa8e5 --- /dev/null +++ b/syft/pkg/cataloger/lua/parse_rockspec.go @@ -0,0 +1,80 @@ +package lua + +import ( + "context" + "strings" + + "github.com/anchore/syft/internal/log" + "github.com/anchore/syft/syft/artifact" + "github.com/anchore/syft/syft/file" + "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/pkg/cataloger/generic" +) + +type luaRocksPackage struct { + Name string + Version string + License string + Homepage string + Description string + Dependencies map[string]string + Repository repository +} + +type repository struct { + URL string +} + +// parseRockspec parses a package.rockspec and returns the discovered Lua packages. +func parseRockspec(_ context.Context, _ file.Resolver, _ *generic.Environment, reader file.LocationReadCloser) ([]pkg.Package, []artifact.Relationship, error) { + doc, err := parseRockspecData(reader) + if err != nil { + log.WithFields("error", err).Trace("unable to parse Rockspec app") + return nil, nil, nil + } + + var name, version, license, homepage, description, url string + + for _, node := range doc.value { + switch node.key { + case "package": + name = node.String() + case "version": + version = node.String() + case "source": + for _, child := range node.Slice() { + if child.key == "url" { + url = child.String() + break + } + } + case "description": + for _, child := range node.Slice() { + switch child.key { + case "summary": + description = child.String() + case "homepage": + homepage = child.String() + case "license": + license = strings.ReplaceAll(child.String(), " ", "-") + } + } + } + } + + p := newLuaRocksPackage( + luaRocksPackage{ + Name: name, + Version: version, + License: license, + Repository: repository{ + URL: url, + }, + Homepage: homepage, + Description: description, + }, + reader.Location.WithAnnotation(pkg.EvidenceAnnotationKey, pkg.PrimaryEvidenceAnnotation), + ) + + return []pkg.Package{p}, nil, nil +} diff --git a/syft/pkg/cataloger/lua/parse_rockspec_test.go b/syft/pkg/cataloger/lua/parse_rockspec_test.go new file mode 100644 index 00000000000..6c6ebc5cc8e --- /dev/null +++ b/syft/pkg/cataloger/lua/parse_rockspec_test.go @@ -0,0 +1,86 @@ +package lua + +import ( + "github.com/anchore/syft/syft/file" + "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/pkg/cataloger/internal/pkgtest" + "testing" +) + +func TestParseRockspec(t *testing.T) { + tests := []struct { + Fixture string + ExpectedPkg pkg.Package + }{ + { + Fixture: "test-fixtures/rockspec/kong-3.7.0-0.rockspec", + ExpectedPkg: pkg.Package{ + Name: "kong", + Version: "3.7.0-0", + PURL: "pkg:luarocks/kong@3.7.0-0", + Type: pkg.LuaRocksPkg, + Language: pkg.Lua, + Licenses: pkg.NewLicenseSet( + pkg.NewLicenseFromLocations("Apache-2.0", file.NewLocation("test-fixtures/rockspec/kong-3.7.0-0.rockspec")), + ), + Metadata: pkg.LuaRocksPackage{ + Name: "kong", + Version: "3.7.0-0", + License: "Apache-2.0", + Homepage: "https://konghq.com", + Description: "Kong is a scalable and customizable API Management Layer built on top of Nginx.", + URL: "git+https://github.com/Kong/kong.git", + }, + }, + }, + { + Fixture: "test-fixtures/rockspec/lpeg-1.0.2-1.rockspec", + ExpectedPkg: pkg.Package{ + Name: "LPeg", + Version: "1.0.2-1", + PURL: "pkg:luarocks/LPeg@1.0.2-1", + Type: pkg.LuaRocksPkg, + Language: pkg.Lua, + Licenses: pkg.NewLicenseSet( + pkg.NewLicenseFromLocations("MIT/X11", file.NewLocation("test-fixtures/rockspec/lpeg-1.0.2-1.rockspec")), + ), + Metadata: pkg.LuaRocksPackage{ + Name: "LPeg", + Version: "1.0.2-1", + License: "MIT/X11", + Homepage: "http://www.inf.puc-rio.br/~roberto/lpeg.html", + Description: "Parsing Expression Grammars For Lua", + URL: "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.2.tar.gz", + }, + }, + }, + { + Fixture: "test-fixtures/rockspec/kong-pgmoon-1.16.2-1.rockspec", + ExpectedPkg: pkg.Package{ + Name: "kong-pgmoon", + Version: "1.16.2-1", + PURL: "pkg:luarocks/kong-pgmoon@1.16.2-1", + Type: pkg.LuaRocksPkg, + Language: pkg.Lua, + Licenses: pkg.NewLicenseSet( + pkg.NewLicenseFromLocations("MIT", file.NewLocation("test-fixtures/rockspec/kong-pgmoon-1.16.2-1.rockspec")), + ), + Metadata: pkg.LuaRocksPackage{ + Name: "kong-pgmoon", + Version: "1.16.2-1", + License: "MIT", + Homepage: "https://github.com/Kong/pgmoon", + Description: "Postgres driver for OpenResty and Lua", + URL: "git+https://github.com/kong/pgmoon.git", + }, + }, + }, + } + + for _, test := range tests { + t.Run(test.Fixture, func(t *testing.T) { + test.ExpectedPkg.Locations.Add(file.NewLocation(test.Fixture)) + pkgtest.TestFileParser(t, test.Fixture, parseRockspec, []pkg.Package{test.ExpectedPkg}, nil) + }) + } +} diff --git a/syft/pkg/cataloger/lua/rockspec_parser.go b/syft/pkg/cataloger/lua/rockspec_parser.go new file mode 100644 index 00000000000..0da26c36466 --- /dev/null +++ b/syft/pkg/cataloger/lua/rockspec_parser.go @@ -0,0 +1,352 @@ +package lua + +import ( + "bytes" + "fmt" + "io" + + "github.com/anchore/syft/syft/internal/parsing" +) + +type rockspec struct { + value []rockspecNode +} + +type rockspecNode struct { + key string + value interface{} +} + +func (r rockspecNode) Slice() []rockspecNode { + out, ok := r.value.([]rockspecNode) + if ok { + return out + } + return nil +} + +func (r rockspecNode) String() string { + out, ok := r.value.(string) + if ok { + return out + } + return "" +} + +var noReturn = rockspec{ + value: nil, +} + +// parseRockspec basic parser for rockspec +func parseRockspecData(reader io.Reader) (rockspec, error) { + data, err := io.ReadAll(reader) + if err != nil { + return noReturn, err + } + + i := 0 + blocks, err := parseRockspecBlock(data, &i) + + if err != nil { + return noReturn, err + } + + return rockspec{ + value: blocks, + }, nil +} + +func parseRockspecBlock(data []byte, i *int) ([]rockspecNode, error) { + var out []rockspecNode + var iterator func(data []byte, i *int) (*rockspecNode, error) + + parsing.SkipWhitespace(data, i) + + if *i >= len(data) && len(out) > 0 { + return nil, fmt.Errorf("unexpected end of block at %d", *i) + } + + c := data[*i] + switch { + case c == '"' || c == '\'': + iterator = parseRockspecListItem + case isLiteral(c): + iterator = parseRockspecNode + default: + return nil, fmt.Errorf("unexpected character: %s", string(c)) + } + + for *i < len(data) { + item, err := iterator(data, i) + if err != nil { + return nil, fmt.Errorf("%w\n%s", err, parsing.PrintError(data, *i)) + } + + parsing.SkipWhitespace(data, i) + + if (item.key == "," || item.key == "-") && item.value == nil { + continue + } + + if item.key == "}" && item.value == nil { + break + } + + out = append(out, *item) + } + + return out, nil +} + +//nolint:funlen +func parseRockspecNode(data []byte, i *int) (*rockspecNode, error) { + parsing.SkipWhitespace(data, i) + + if *i >= len(data) { + return nil, fmt.Errorf("unexpected end of node at %d", *i) + } + + c := data[*i] + + if c == ',' || c == ';' || c == '}' { + *i++ + return &rockspecNode{ + key: string(c), + }, nil + } + + if c == '-' { + offset := *i + 1 + if offset >= len(data) { + return nil, fmt.Errorf("unexpected character: %s", string(c)) + } + c2 := data[offset] + + if c2 != '-' { + return nil, fmt.Errorf("unexpected character: %s", string(c2)) + } + + parseComment(data, i) + return &rockspecNode{ + key: string(c), + }, nil + } + + if !isLiteral(c) { + return nil, fmt.Errorf("invalid literal character: %s", string(c)) + } + + key, err := parseRockspecLiteral(data, i) + if err != nil { + return nil, err + } + + parsing.SkipWhitespace(data, i) + + if *i >= len(data) { + return nil, fmt.Errorf("unexpected end of node at %d", *i) + } + + c = data[*i] + if c != '=' { + return nil, fmt.Errorf("unexpected character: %s", string(c)) + } + + *i++ + parsing.SkipWhitespace(data, i) + + if *i >= len(data) { + return nil, fmt.Errorf("unexpected end of node at %d", *i) + } + + c = data[*i] + + switch c { + case '{': + offset := *i + 1 + parsing.SkipWhitespace(data, &offset) + if offset >= len(data) { + return nil, fmt.Errorf("unterminated block at %d", *i) + } + c2 := data[offset] + + // Add support for empty lists + if c == '{' && c2 == '}' { + *i = offset + 1 + return &rockspecNode{}, nil + } else { + *i = offset + } + + parsing.SkipWhitespace(data, i) + + obj, err := parseRockspecBlock(data, i) + + if err != nil { + return nil, err + } + value := obj + + return &rockspecNode{ + key, value, + }, nil + case '"', '\'': + str, err := parseRockspecString(data, i) + + if err != nil { + return nil, err + } + value := str.value + + return &rockspecNode{ + key, value, + }, nil + case '[': + offset := *i + 1 + if offset >= len(data) { + return nil, fmt.Errorf("unterminated block at %d", *i) + } + c2 := data[offset] + + if c2 != '[' { + return nil, fmt.Errorf("unexpected character: %s", string(c)) + } + + *i++ + + str, err := parseRockspecString(data, i) + + if err != nil { + return nil, err + } + value := str.String() + + c = data[*i] + + if c != ']' { + return nil, fmt.Errorf("unexpected character: %s", string(c)) + } + + *i++ + + return &rockspecNode{ + key, value, + }, nil + } + + return nil, nil +} + +func parseRockspecListItem(data []byte, i *int) (*rockspecNode, error) { + parsing.SkipWhitespace(data, i) + + if *i >= len(data) { + return nil, fmt.Errorf("unexpected end of block at %d", *i) + } + + c := data[*i] + if c == ',' || c == ';' || c == '}' { + *i++ + return &rockspecNode{ + key: string(c), + }, nil + } + + if c == '-' { + offset := *i + 1 + if offset >= len(data) { + return nil, fmt.Errorf("unexpected character: %s", string(c)) + } + c2 := data[offset] + + if c2 != '-' { + return nil, fmt.Errorf("unexpected character: %s", string(c2)) + } + + parseComment(data, i) + return &rockspecNode{ + key: string(c), + }, nil + } + + str, err := parseRockspecString(data, i) + if err != nil { + return nil, err + } + return str, nil +} + +func parseRockspecLiteral(data []byte, i *int) (string, error) { + var buf bytes.Buffer +out: + for *i < len(data) { + c := data[*i] + switch { + case c == '[': + *i++ + nested, err := parseRockspecString(data, i) + if err != nil { + return "", err + } + c = data[*i] + if c != ']' { + return "", fmt.Errorf("unterminated literal at %d", *i) + } + buf.WriteString(fmt.Sprintf("[\"%s\"]", nested.String())) + case isLiteral(c): + buf.WriteByte(c) + default: + break out + } + *i++ + } + return buf.String(), nil +} + +func parseRockspecString(data []byte, i *int) (*rockspecNode, error) { + delim := data[*i] + var endDelim byte + switch delim { + case '"', '\'': + endDelim = delim + case '[': + endDelim = ']' + } + + *i++ + var buf bytes.Buffer + for *i < len(data) { + c := data[*i] + if c == endDelim { + *i++ + str := rockspecNode{value: buf.String()} + return &str, nil + } + buf.WriteByte(c) + *i++ + } + return nil, fmt.Errorf("unterminated string at %d", *i) +} + +func parseComment(data []byte, i *int) { + for *i < len(data) { + c := data[*i] + + *i++ + + // Rest of a line is a comment. Deals with CR, LF and CR/LF + if c == '\n' { + break + } else if c == '\r' && data[*i] == '\n' { + *i++ + break + } + } +} + +func isLiteral(c byte) bool { + if c == '[' || c == ']' { + return true + } + return parsing.IsLiteral(c) +} diff --git a/syft/pkg/cataloger/lua/rockspec_parser_test.go b/syft/pkg/cataloger/lua/rockspec_parser_test.go new file mode 100644 index 00000000000..dfd5264a47c --- /dev/null +++ b/syft/pkg/cataloger/lua/rockspec_parser_test.go @@ -0,0 +1,170 @@ +package lua + +import ( + "bytes" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_parseRockspecData(t *testing.T) { + tests := []struct { + name string + content string + wantErr require.ErrorAssertionFunc + }{ + { + name: "basic valid content", + content: ` +foo = "bar" +hello = "world" +object = { + foo = "bar", + baz = "test", + nested = { + lorem = "ipsum" + } +} +alice = "bob" +`, + }, + { + name: "lists", + content: ` +foo = "bar" +list = {"hello", "world" } +`, + }, + { + name: "empty list", + content: ` +foo = "bar" +list = {} +`, + }, + { + name: "different string delimiters", + content: ` +foo = 'bar' +hello = "world" +`, + }, + { + + name: "multiline string", + content: ` +foo = "bar" +multiline = [[ + this is + a multiline + string +]] +`, + }, + { + name: "complex syntax", + content: ` +foo = "bar" +object = { + ["baz"] = "bar" +} +`, + }, + { + name: "content with comment", + content: ` +foo = "bar" +-- this is a comment +object = { + hello = "world" + -- this is another comment +} +`, + }, + { + name: "list with comment", + content: ` +list = { + "foo", + "bar", + -- "baz" + "hello" +} +`, + }, + { + name: "invalid complex syntax", + wantErr: require.Error, + content: ` +foo = "bar" +object = { + ["baz" = "bar" + ["hello"] = world +} +`, + }, + { + name: "unterminated block", + wantErr: require.Error, + content: ` +foo = "bar" +hello = "world" +object = { +`, + }, + { + name: "invalid string content", + wantErr: require.Error, + content: ` +test = "unfinished + `, + }, + { + name: "mixed string delimiters", + wantErr: require.Error, + content: ` +foo = "bar' +`, + }, + { + name: "unterminated multiline string", + wantErr: require.Error, + content: ` + foo = "bar" + hello = "world" + object = [[ + `, + }, + { + name: "invalid multiline string content", + wantErr: require.Error, + content: ` +test = [[ + unfinished + `, + }, + { + name: "list with unterminated comment", + wantErr: require.Error, + content: ` +list = { + "foo", + "bar", + -`, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + value, err := parseRockspecData(bytes.NewReader([]byte(test.content))) + + if test.wantErr == nil { + require.NoError(t, err) + } else { + test.wantErr(t, err) + } + + assert.IsType(t, rockspec{}, value) + }) + } +} diff --git a/syft/pkg/cataloger/lua/test-fixtures/glob-paths/lua/package.rockspec b/syft/pkg/cataloger/lua/test-fixtures/glob-paths/lua/package.rockspec new file mode 100644 index 00000000000..17be6bb3911 --- /dev/null +++ b/syft/pkg/cataloger/lua/test-fixtures/glob-paths/lua/package.rockspec @@ -0,0 +1 @@ +bogus rockspec \ No newline at end of file diff --git a/syft/pkg/cataloger/lua/test-fixtures/rockspec/kong-3.7.0-0.rockspec b/syft/pkg/cataloger/lua/test-fixtures/rockspec/kong-3.7.0-0.rockspec new file mode 100644 index 00000000000..cca7ee53d66 --- /dev/null +++ b/syft/pkg/cataloger/lua/test-fixtures/rockspec/kong-3.7.0-0.rockspec @@ -0,0 +1,612 @@ +package = "kong" +version = "3.7.0-0" +rockspec_format = "3.0" +supported_platforms = {"linux", "macosx"} +source = { + url = "git+https://github.com/Kong/kong.git", + tag = "3.7.0" +} +description = { + summary = "Kong is a scalable and customizable API Management Layer built on top of Nginx.", + homepage = "https://konghq.com", + license = "Apache 2.0" +} +dependencies = { + "inspect == 3.1.3", + "luasec == 1.3.2", + "luasocket == 3.0-rc1", + "penlight == 1.13.1", + "lua-resty-http == 0.17.1", + "lua-resty-jit-uuid == 0.0.7", + "lua-ffi-zlib == 0.6", + "multipart == 0.5.9", + "version == 1.0.1", + "kong-lapis == 1.16.0.1", + "kong-pgmoon == 1.16.2", + "luatz == 0.4", + "lua_system_constants == 0.1.4", + "lyaml == 6.2.8", + "luasyslog == 2.0.1", + "lua_pack == 2.0.0", + "binaryheap >= 0.4", + "luaxxhash >= 1.0", + "lua-protobuf == 0.5.0", + "lua-resty-healthcheck == 3.0.1", + "lua-messagepack == 0.5.4", + "lua-resty-aws == 1.3.6", + "lua-resty-openssl == 1.2.0", + "lua-resty-counter == 0.2.1", + "lua-resty-ipmatcher == 0.6.1", + "lua-resty-acme == 0.12.0", + "lua-resty-session == 4.0.5", + "lua-resty-timer-ng == 0.2.6", + "lpeg == 1.1.0", + "lua-resty-ljsonschema == 1.1.6-2", +} +build = { + type = "builtin", + modules = { + ["kong"] = "kong/init.lua", + ["kong.meta"] = "kong/meta.lua", + ["kong.cache"] = "kong/cache/init.lua", + ["kong.cache.warmup"] = "kong/cache/warmup.lua", + ["kong.global"] = "kong/global.lua", + ["kong.reports"] = "kong/reports.lua", + ["kong.constants"] = "kong/constants.lua", + ["kong.concurrency"] = "kong/concurrency.lua", + ["kong.deprecation"] = "kong/deprecation.lua", + ["kong.globalpatches"] = "kong/globalpatches.lua", + ["kong.error_handlers"] = "kong/error_handlers.lua", + ["kong.hooks"] = "kong/hooks.lua", + + ["kong.router"] = "kong/router/init.lua", + ["kong.router.traditional"] = "kong/router/traditional.lua", + ["kong.router.compat"] = "kong/router/compat.lua", + ["kong.router.expressions"] = "kong/router/expressions.lua", + ["kong.router.atc"] = "kong/router/atc.lua", + ["kong.router.fields"] = "kong/router/fields.lua", + ["kong.router.utils"] = "kong/router/utils.lua", + + ["kong.conf_loader"] = "kong/conf_loader/init.lua", + ["kong.conf_loader.constants"] = "kong/conf_loader/constants.lua", + ["kong.conf_loader.parse"] = "kong/conf_loader/parse.lua", + ["kong.conf_loader.listeners"] = "kong/conf_loader/listeners.lua", + + ["kong.clustering"] = "kong/clustering/init.lua", + ["kong.clustering.data_plane"] = "kong/clustering/data_plane.lua", + ["kong.clustering.control_plane"] = "kong/clustering/control_plane.lua", + ["kong.clustering.utils"] = "kong/clustering/utils.lua", + ["kong.clustering.events"] = "kong/clustering/events.lua", + ["kong.clustering.compat"] = "kong/clustering/compat/init.lua", + ["kong.clustering.compat.version"] = "kong/clustering/compat/version.lua", + ["kong.clustering.compat.removed_fields"] = "kong/clustering/compat/removed_fields.lua", + ["kong.clustering.compat.checkers"] = "kong/clustering/compat/checkers.lua", + ["kong.clustering.config_helper"] = "kong/clustering/config_helper.lua", + ["kong.clustering.tls"] = "kong/clustering/tls.lua", + + ["kong.cluster_events"] = "kong/cluster_events/init.lua", + ["kong.cluster_events.strategies.postgres"] = "kong/cluster_events/strategies/postgres.lua", + ["kong.cluster_events.strategies.off"] = "kong/cluster_events/strategies/off.lua", + + ["kong.templates.nginx"] = "kong/templates/nginx.lua", + ["kong.templates.nginx_kong"] = "kong/templates/nginx_kong.lua", + ["kong.templates.nginx_kong_gui_include"] = "kong/templates/nginx_kong_gui_include.lua", + ["kong.templates.nginx_kong_stream"] = "kong/templates/nginx_kong_stream.lua", + ["kong.templates.kong_defaults"] = "kong/templates/kong_defaults.lua", + ["kong.templates.nginx_inject"] = "kong/templates/nginx_inject.lua", + ["kong.templates.nginx_kong_inject"] = "kong/templates/nginx_kong_inject.lua", + ["kong.templates.nginx_kong_stream_inject"] = "kong/templates/nginx_kong_stream_inject.lua", + ["kong.templates.kong_yml"] = "kong/templates/kong_yml.lua", + + ["kong.resty.dns.client"] = "kong/resty/dns/client.lua", + ["kong.resty.dns.utils"] = "kong/resty/dns/utils.lua", + ["kong.resty.ctx"] = "kong/resty/ctx.lua", + + ["kong.resty.mlcache"] = "kong/resty/mlcache/init.lua", + ["kong.resty.mlcache.ipc"] = "kong/resty/mlcache/ipc.lua", + + ["kong.cmd"] = "kong/cmd/init.lua", + ["kong.cmd.roar"] = "kong/cmd/roar.lua", + ["kong.cmd.stop"] = "kong/cmd/stop.lua", + ["kong.cmd.quit"] = "kong/cmd/quit.lua", + ["kong.cmd.start"] = "kong/cmd/start.lua", + ["kong.cmd.check"] = "kong/cmd/check.lua", + ["kong.cmd.config"] = "kong/cmd/config.lua", + ["kong.cmd.reload"] = "kong/cmd/reload.lua", + ["kong.cmd.restart"] = "kong/cmd/restart.lua", + ["kong.cmd.prepare"] = "kong/cmd/prepare.lua", + ["kong.cmd.migrations"] = "kong/cmd/migrations.lua", + ["kong.cmd.health"] = "kong/cmd/health.lua", + ["kong.cmd.vault"] = "kong/cmd/vault.lua", + ["kong.cmd.version"] = "kong/cmd/version.lua", + ["kong.cmd.hybrid"] = "kong/cmd/hybrid.lua", + ["kong.cmd.utils.log"] = "kong/cmd/utils/log.lua", + ["kong.cmd.utils.kill"] = "kong/cmd/utils/kill.lua", + ["kong.cmd.utils.env"] = "kong/cmd/utils/env.lua", + ["kong.cmd.utils.migrations"] = "kong/cmd/utils/migrations.lua", + ["kong.cmd.utils.tty"] = "kong/cmd/utils/tty.lua", + ["kong.cmd.utils.nginx_signals"] = "kong/cmd/utils/nginx_signals.lua", + ["kong.cmd.utils.prefix_handler"] = "kong/cmd/utils/prefix_handler.lua", + ["kong.cmd.utils.process_secrets"] = "kong/cmd/utils/process_secrets.lua", + ["kong.cmd.utils.inject_confs"] = "kong/cmd/utils/inject_confs.lua", + + ["kong.api"] = "kong/api/init.lua", + ["kong.api.api_helpers"] = "kong/api/api_helpers.lua", + ["kong.api.arguments"] = "kong/api/arguments.lua", + ["kong.api.endpoints"] = "kong/api/endpoints.lua", + ["kong.api.routes.cache"] = "kong/api/routes/cache.lua", + ["kong.api.routes.certificates"] = "kong/api/routes/certificates.lua", + ["kong.api.routes.clustering"] = "kong/api/routes/clustering.lua", + ["kong.api.routes.config"] = "kong/api/routes/config.lua", + ["kong.api.routes.consumers"] = "kong/api/routes/consumers.lua", + ["kong.api.routes.debug"] = "kong/api/routes/debug.lua", + ["kong.api.routes.filter_chains"] = "kong/api/routes/filter_chains.lua", + ["kong.api.routes.health"] = "kong/api/routes/health.lua", + ["kong.api.routes.kong"] = "kong/api/routes/kong.lua", + ["kong.api.routes.plugins"] = "kong/api/routes/plugins.lua", + ["kong.api.routes.snis"] = "kong/api/routes/snis.lua", + ["kong.api.routes.tags"] = "kong/api/routes/tags.lua", + ["kong.api.routes.targets"] = "kong/api/routes/targets.lua", + ["kong.api.routes.upstreams"] = "kong/api/routes/upstreams.lua", + + ["kong.admin_gui"] = "kong/admin_gui/init.lua", + ["kong.admin_gui.utils"] = "kong/admin_gui/utils.lua", + + ["kong.status"] = "kong/status/init.lua", + ["kong.status.ready"] = "kong/status/ready.lua", + + ["kong.tools.dns"] = "kong/tools/dns.lua", + ["kong.tools.grpc"] = "kong/tools/grpc.lua", + ["kong.tools.utils"] = "kong/tools/utils.lua", + ["kong.tools.timestamp"] = "kong/tools/timestamp.lua", + ["kong.tools.stream_api"] = "kong/tools/stream_api.lua", + ["kong.tools.queue"] = "kong/tools/queue.lua", + ["kong.tools.queue_schema"] = "kong/tools/queue_schema.lua", + ["kong.tools.sandbox"] = "kong/tools/sandbox.lua", + ["kong.tools.uri"] = "kong/tools/uri.lua", + ["kong.tools.kong-lua-sandbox"] = "kong/tools/kong-lua-sandbox.lua", + ["kong.tools.protobuf"] = "kong/tools/protobuf.lua", + ["kong.tools.mime_type"] = "kong/tools/mime_type.lua", + ["kong.tools.request_aware_table"] = "kong/tools/request_aware_table.lua", + ["kong.tools.gzip"] = "kong/tools/gzip.lua", + ["kong.tools.string"] = "kong/tools/string.lua", + ["kong.tools.table"] = "kong/tools/table.lua", + ["kong.tools.sha256"] = "kong/tools/sha256.lua", + ["kong.tools.yield"] = "kong/tools/yield.lua", + ["kong.tools.uuid"] = "kong/tools/uuid.lua", + ["kong.tools.rand"] = "kong/tools/rand.lua", + ["kong.tools.system"] = "kong/tools/system.lua", + ["kong.tools.time"] = "kong/tools/time.lua", + ["kong.tools.module"] = "kong/tools/module.lua", + ["kong.tools.ip"] = "kong/tools/ip.lua", + ["kong.tools.http"] = "kong/tools/http.lua", + ["kong.tools.cjson"] = "kong/tools/cjson.lua", + ["kong.tools.redis.schema"] = "kong/tools/redis/schema.lua", + + ["kong.runloop.handler"] = "kong/runloop/handler.lua", + ["kong.runloop.events"] = "kong/runloop/events.lua", + ["kong.runloop.log_level"] = "kong/runloop/log_level.lua", + ["kong.runloop.certificate"] = "kong/runloop/certificate.lua", + ["kong.runloop.plugins_iterator"] = "kong/runloop/plugins_iterator.lua", + ["kong.runloop.upstream_ssl"] = "kong/runloop/upstream_ssl.lua", + ["kong.runloop.balancer"] = "kong/runloop/balancer/init.lua", + ["kong.runloop.balancer.balancers"] = "kong/runloop/balancer/balancers.lua", + ["kong.runloop.balancer.consistent_hashing"] = "kong/runloop/balancer/consistent_hashing.lua", + ["kong.runloop.balancer.healthcheckers"] = "kong/runloop/balancer/healthcheckers.lua", + ["kong.runloop.balancer.least_connections"] = "kong/runloop/balancer/least_connections.lua", + ["kong.runloop.balancer.latency"] = "kong/runloop/balancer/latency.lua", + ["kong.runloop.balancer.round_robin"] = "kong/runloop/balancer/round_robin.lua", + ["kong.runloop.balancer.targets"] = "kong/runloop/balancer/targets.lua", + ["kong.runloop.balancer.upstreams"] = "kong/runloop/balancer/upstreams.lua", + ["kong.runloop.plugin_servers"] = "kong/runloop/plugin_servers/init.lua", + ["kong.runloop.plugin_servers.process"] = "kong/runloop/plugin_servers/process.lua", + ["kong.runloop.plugin_servers.mp_rpc"] = "kong/runloop/plugin_servers/mp_rpc.lua", + ["kong.runloop.plugin_servers.pb_rpc"] = "kong/runloop/plugin_servers/pb_rpc.lua", + ["kong.runloop.wasm"] = "kong/runloop/wasm.lua", + ["kong.runloop.wasm.properties"] = "kong/runloop/wasm/properties.lua", + + ["kong.workspaces"] = "kong/workspaces/init.lua", + + ["kong.db"] = "kong/db/init.lua", + ["kong.db.utils"] = "kong/db/utils.lua", + ["kong.db.errors"] = "kong/db/errors.lua", + ["kong.db.iteration"] = "kong/db/iteration.lua", + ["kong.db.dao"] = "kong/db/dao/init.lua", + ["kong.db.dao.certificates"] = "kong/db/dao/certificates.lua", + ["kong.db.dao.snis"] = "kong/db/dao/snis.lua", + ["kong.db.dao.targets"] = "kong/db/dao/targets.lua", + ["kong.db.dao.plugins"] = "kong/db/dao/plugins.lua", + ["kong.db.dao.tags"] = "kong/db/dao/tags.lua", + ["kong.db.dao.vaults"] = "kong/db/dao/vaults.lua", + ["kong.db.dao.workspaces"] = "kong/db/dao/workspaces.lua", + ["kong.db.dao.services"] = "kong/db/dao/services.lua", + ["kong.db.dao.ca_certificates"] = "kong/db/dao/ca_certificates.lua", + ["kong.db.declarative"] = "kong/db/declarative/init.lua", + ["kong.db.declarative.marshaller"] = "kong/db/declarative/marshaller.lua", + ["kong.db.declarative.export"] = "kong/db/declarative/export.lua", + ["kong.db.declarative.import"] = "kong/db/declarative/import.lua", + ["kong.db.schema"] = "kong/db/schema/init.lua", + ["kong.db.dao.keys"] = "kong/db/dao/keys.lua", + ["kong.db.dao.key_sets"] = "kong/db/dao/key_sets.lua", + ["kong.db.schema.entities.keys"] = "kong/db/schema/entities/keys.lua", + ["kong.db.schema.entities.key_sets"] = "kong/db/schema/entities/key_sets.lua", + ["kong.db.schema.entities.consumers"] = "kong/db/schema/entities/consumers.lua", + ["kong.db.schema.entities.routes"] = "kong/db/schema/entities/routes.lua", + ["kong.db.schema.entities.routes_subschemas"] = "kong/db/schema/entities/routes_subschemas.lua", + ["kong.db.schema.entities.services"] = "kong/db/schema/entities/services.lua", + ["kong.db.schema.entities.certificates"] = "kong/db/schema/entities/certificates.lua", + ["kong.db.schema.entities.snis"] = "kong/db/schema/entities/snis.lua", + ["kong.db.schema.entities.upstreams"] = "kong/db/schema/entities/upstreams.lua", + ["kong.db.schema.entities.targets"] = "kong/db/schema/entities/targets.lua", + ["kong.db.schema.entities.plugins"] = "kong/db/schema/entities/plugins.lua", + ["kong.db.schema.entities.tags"] = "kong/db/schema/entities/tags.lua", + ["kong.db.schema.entities.ca_certificates"] = "kong/db/schema/entities/ca_certificates.lua", + ["kong.db.schema.entities.vaults"] = "kong/db/schema/entities/vaults.lua", + ["kong.db.schema.entities.workspaces"] = "kong/db/schema/entities/workspaces.lua", + ["kong.db.schema.entities.clustering_data_planes"] = "kong/db/schema/entities/clustering_data_planes.lua", + ["kong.db.schema.entities.parameters"] = "kong/db/schema/entities/parameters.lua", + ["kong.db.schema.entities.filter_chains"] = "kong/db/schema/entities/filter_chains.lua", + ["kong.db.schema.json"] = "kong/db/schema/json.lua", + ["kong.db.schema.others.migrations"] = "kong/db/schema/others/migrations.lua", + ["kong.db.schema.others.declarative_config"] = "kong/db/schema/others/declarative_config.lua", + ["kong.db.schema.entity"] = "kong/db/schema/entity.lua", + ["kong.db.schema.metaschema"] = "kong/db/schema/metaschema.lua", + ["kong.db.schema.typedefs"] = "kong/db/schema/typedefs.lua", + ["kong.db.schema.plugin_loader"] = "kong/db/schema/plugin_loader.lua", + ["kong.db.schema.vault_loader"] = "kong/db/schema/vault_loader.lua", + ["kong.db.schema.topological_sort"] = "kong/db/schema/topological_sort.lua", + ["kong.db.strategies"] = "kong/db/strategies/init.lua", + ["kong.db.strategies.connector"] = "kong/db/strategies/connector.lua", + ["kong.db.strategies.postgres"] = "kong/db/strategies/postgres/init.lua", + ["kong.db.strategies.postgres.connector"] = "kong/db/strategies/postgres/connector.lua", + ["kong.db.strategies.postgres.tags"] = "kong/db/strategies/postgres/tags.lua", + ["kong.db.strategies.postgres.services"] = "kong/db/strategies/postgres/services.lua", + ["kong.db.strategies.postgres.plugins"] = "kong/db/strategies/postgres/plugins.lua", + ["kong.db.strategies.off"] = "kong/db/strategies/off/init.lua", + ["kong.db.strategies.off.connector"] = "kong/db/strategies/off/connector.lua", + ["kong.db.strategies.off.tags"] = "kong/db/strategies/off/tags.lua", + + ["kong.db.migrations.state"] = "kong/db/migrations/state.lua", + ["kong.db.migrations.subsystems"] = "kong/db/migrations/subsystems.lua", + ["kong.db.migrations.core"] = "kong/db/migrations/core/init.lua", + ["kong.db.migrations.core.000_base"] = "kong/db/migrations/core/000_base.lua", + ["kong.db.migrations.core.003_100_to_110"] = "kong/db/migrations/core/003_100_to_110.lua", + ["kong.db.migrations.core.004_110_to_120"] = "kong/db/migrations/core/004_110_to_120.lua", + ["kong.db.migrations.core.005_120_to_130"] = "kong/db/migrations/core/005_120_to_130.lua", + ["kong.db.migrations.core.006_130_to_140"] = "kong/db/migrations/core/006_130_to_140.lua", + ["kong.db.migrations.core.007_140_to_150"] = "kong/db/migrations/core/007_140_to_150.lua", + ["kong.db.migrations.core.008_150_to_200"] = "kong/db/migrations/core/008_150_to_200.lua", + ["kong.db.migrations.core.009_200_to_210"] = "kong/db/migrations/core/009_200_to_210.lua", + ["kong.db.migrations.core.010_210_to_211"] = "kong/db/migrations/core/010_210_to_211.lua", + ["kong.db.migrations.core.011_212_to_213"] = "kong/db/migrations/core/011_212_to_213.lua", + ["kong.db.migrations.core.012_213_to_220"] = "kong/db/migrations/core/012_213_to_220.lua", + ["kong.db.migrations.core.013_220_to_230"] = "kong/db/migrations/core/013_220_to_230.lua", + ["kong.db.migrations.core.014_230_to_270"] = "kong/db/migrations/core/014_230_to_270.lua", + ["kong.db.migrations.core.015_270_to_280"] = "kong/db/migrations/core/015_270_to_280.lua", + ["kong.db.migrations.core.016_280_to_300"] = "kong/db/migrations/core/016_280_to_300.lua", + ["kong.db.migrations.core.017_300_to_310"] = "kong/db/migrations/core/017_300_to_310.lua", + ["kong.db.migrations.core.018_310_to_320"] = "kong/db/migrations/core/018_310_to_320.lua", + ["kong.db.migrations.core.019_320_to_330"] = "kong/db/migrations/core/019_320_to_330.lua", + ["kong.db.migrations.core.020_330_to_340"] = "kong/db/migrations/core/020_330_to_340.lua", + ["kong.db.migrations.core.021_340_to_350"] = "kong/db/migrations/core/021_340_to_350.lua", + ["kong.db.migrations.core.022_350_to_360"] = "kong/db/migrations/core/022_350_to_360.lua", + ["kong.db.migrations.operations.200_to_210"] = "kong/db/migrations/operations/200_to_210.lua", + ["kong.db.migrations.operations.212_to_213"] = "kong/db/migrations/operations/212_to_213.lua", + ["kong.db.migrations.operations.280_to_300"] = "kong/db/migrations/operations/280_to_300.lua", + ["kong.db.migrations.migrate_path_280_300"] = "kong/db/migrations/migrate_path_280_300.lua", + ["kong.db.declarative.migrations"] = "kong/db/declarative/migrations/init.lua", + ["kong.db.declarative.migrations.route_path"] = "kong/db/declarative/migrations/route_path.lua", + + ["kong.pdk"] = "kong/pdk/init.lua", + ["kong.pdk.private.checks"] = "kong/pdk/private/checks.lua", + ["kong.pdk.private.phases"] = "kong/pdk/private/phases.lua", + ["kong.pdk.private.node"] = "kong/pdk/private/node.lua", + ["kong.pdk.client"] = "kong/pdk/client.lua", + ["kong.pdk.client.tls"] = "kong/pdk/client/tls.lua", + ["kong.pdk.ctx"] = "kong/pdk/ctx.lua", + ["kong.pdk.ip"] = "kong/pdk/ip.lua", + ["kong.pdk.log"] = "kong/pdk/log.lua", + ["kong.pdk.service"] = "kong/pdk/service.lua", + ["kong.pdk.service.request"] = "kong/pdk/service/request.lua", + ["kong.pdk.service.response"] = "kong/pdk/service/response.lua", + ["kong.pdk.router"] = "kong/pdk/router.lua", + ["kong.pdk.request"] = "kong/pdk/request.lua", + ["kong.pdk.response"] = "kong/pdk/response.lua", + ["kong.pdk.table"] = "kong/pdk/table.lua", + ["kong.pdk.node"] = "kong/pdk/node.lua", + ["kong.pdk.nginx"] = "kong/pdk/nginx.lua", + ["kong.pdk.cluster"] = "kong/pdk/cluster.lua", + ["kong.pdk.vault"] = "kong/pdk/vault.lua", + ["kong.pdk.tracing"] = "kong/pdk/tracing.lua", + ["kong.pdk.plugin"] = "kong/pdk/plugin.lua", + + ["kong.plugins.basic-auth.migrations"] = "kong/plugins/basic-auth/migrations/init.lua", + ["kong.plugins.basic-auth.migrations.000_base_basic_auth"] = "kong/plugins/basic-auth/migrations/000_base_basic_auth.lua", + ["kong.plugins.basic-auth.migrations.002_130_to_140"] = "kong/plugins/basic-auth/migrations/002_130_to_140.lua", + ["kong.plugins.basic-auth.migrations.003_200_to_210"] = "kong/plugins/basic-auth/migrations/003_200_to_210.lua", + ["kong.plugins.basic-auth.crypto"] = "kong/plugins/basic-auth/crypto.lua", + ["kong.plugins.basic-auth.handler"] = "kong/plugins/basic-auth/handler.lua", + ["kong.plugins.basic-auth.access"] = "kong/plugins/basic-auth/access.lua", + ["kong.plugins.basic-auth.schema"] = "kong/plugins/basic-auth/schema.lua", + ["kong.plugins.basic-auth.daos"] = "kong/plugins/basic-auth/daos.lua", + + ["kong.plugins.key-auth.migrations"] = "kong/plugins/key-auth/migrations/init.lua", + ["kong.plugins.key-auth.migrations.000_base_key_auth"] = "kong/plugins/key-auth/migrations/000_base_key_auth.lua", + ["kong.plugins.key-auth.migrations.002_130_to_140"] = "kong/plugins/key-auth/migrations/002_130_to_140.lua", + ["kong.plugins.key-auth.migrations.003_200_to_210"] = "kong/plugins/key-auth/migrations/003_200_to_210.lua", + ["kong.plugins.key-auth.migrations.004_320_to_330"] = "kong/plugins/key-auth/migrations/004_320_to_330.lua", + ["kong.plugins.key-auth.handler"] = "kong/plugins/key-auth/handler.lua", + ["kong.plugins.key-auth.schema"] = "kong/plugins/key-auth/schema.lua", + ["kong.plugins.key-auth.daos"] = "kong/plugins/key-auth/daos.lua", + + ["kong.plugins.oauth2.migrations"] = "kong/plugins/oauth2/migrations/init.lua", + ["kong.plugins.oauth2.migrations.000_base_oauth2"] = "kong/plugins/oauth2/migrations/000_base_oauth2.lua", + ["kong.plugins.oauth2.migrations.003_130_to_140"] = "kong/plugins/oauth2/migrations/003_130_to_140.lua", + ["kong.plugins.oauth2.migrations.004_200_to_210"] = "kong/plugins/oauth2/migrations/004_200_to_210.lua", + ["kong.plugins.oauth2.migrations.005_210_to_211"] = "kong/plugins/oauth2/migrations/005_210_to_211.lua", + ["kong.plugins.oauth2.migrations.006_320_to_330"] = "kong/plugins/oauth2/migrations/006_320_to_330.lua", + ["kong.plugins.oauth2.migrations.007_320_to_330"] = "kong/plugins/oauth2/migrations/007_320_to_330.lua", + ["kong.plugins.oauth2.handler"] = "kong/plugins/oauth2/handler.lua", + ["kong.plugins.oauth2.secret"] = "kong/plugins/oauth2/secret.lua", + ["kong.plugins.oauth2.access"] = "kong/plugins/oauth2/access.lua", + ["kong.plugins.oauth2.schema"] = "kong/plugins/oauth2/schema.lua", + ["kong.plugins.oauth2.daos"] = "kong/plugins/oauth2/daos.lua", + ["kong.plugins.oauth2.daos.oauth2_tokens"] = "kong/plugins/oauth2/daos/oauth2_tokens.lua", + + ["kong.plugins.tcp-log.handler"] = "kong/plugins/tcp-log/handler.lua", + ["kong.plugins.tcp-log.schema"] = "kong/plugins/tcp-log/schema.lua", + + ["kong.plugins.udp-log.handler"] = "kong/plugins/udp-log/handler.lua", + ["kong.plugins.udp-log.schema"] = "kong/plugins/udp-log/schema.lua", + + ["kong.plugins.http-log.handler"] = "kong/plugins/http-log/handler.lua", + ["kong.plugins.http-log.schema"] = "kong/plugins/http-log/schema.lua", + ["kong.plugins.http-log.migrations"] = "kong/plugins/http-log/migrations/init.lua", + ["kong.plugins.http-log.migrations.001_280_to_300"] = "kong/plugins/http-log/migrations/001_280_to_300.lua", + + ["kong.plugins.file-log.handler"] = "kong/plugins/file-log/handler.lua", + ["kong.plugins.file-log.schema"] = "kong/plugins/file-log/schema.lua", + + ["kong.plugins.rate-limiting.migrations"] = "kong/plugins/rate-limiting/migrations/init.lua", + ["kong.plugins.rate-limiting.migrations.000_base_rate_limiting"] = "kong/plugins/rate-limiting/migrations/000_base_rate_limiting.lua", + ["kong.plugins.rate-limiting.migrations.003_10_to_112"] = "kong/plugins/rate-limiting/migrations/003_10_to_112.lua", + ["kong.plugins.rate-limiting.migrations.004_200_to_210"] = "kong/plugins/rate-limiting/migrations/004_200_to_210.lua", + ["kong.plugins.rate-limiting.migrations.005_320_to_330"] = "kong/plugins/rate-limiting/migrations/005_320_to_330.lua", + ["kong.plugins.rate-limiting.migrations.006_350_to_360"] = "kong/plugins/rate-limiting/migrations/006_350_to_360.lua", + ["kong.plugins.rate-limiting.expiration"] = "kong/plugins/rate-limiting/expiration.lua", + ["kong.plugins.rate-limiting.handler"] = "kong/plugins/rate-limiting/handler.lua", + ["kong.plugins.rate-limiting.schema"] = "kong/plugins/rate-limiting/schema.lua", + ["kong.plugins.rate-limiting.daos"] = "kong/plugins/rate-limiting/daos.lua", + ["kong.plugins.rate-limiting.policies"] = "kong/plugins/rate-limiting/policies/init.lua", + ["kong.plugins.rate-limiting.policies.cluster"] = "kong/plugins/rate-limiting/policies/cluster.lua", + ["kong.plugins.rate-limiting.clustering.compat.redis_translation"] = "kong/plugins/rate-limiting/clustering/compat/redis_translation.lua", + + ["kong.plugins.response-ratelimiting.migrations"] = "kong/plugins/response-ratelimiting/migrations/init.lua", + ["kong.plugins.response-ratelimiting.migrations.000_base_response_rate_limiting"] = "kong/plugins/response-ratelimiting/migrations/000_base_response_rate_limiting.lua", + ["kong.plugins.response-ratelimiting.migrations.001_350_to_360"] = "kong/plugins/response-ratelimiting/migrations/001_350_to_360.lua", + ["kong.plugins.response-ratelimiting.handler"] = "kong/plugins/response-ratelimiting/handler.lua", + ["kong.plugins.response-ratelimiting.access"] = "kong/plugins/response-ratelimiting/access.lua", + ["kong.plugins.response-ratelimiting.header_filter"] = "kong/plugins/response-ratelimiting/header_filter.lua", + ["kong.plugins.response-ratelimiting.log"] = "kong/plugins/response-ratelimiting/log.lua", + ["kong.plugins.response-ratelimiting.schema"] = "kong/plugins/response-ratelimiting/schema.lua", + ["kong.plugins.response-ratelimiting.policies"] = "kong/plugins/response-ratelimiting/policies/init.lua", + ["kong.plugins.response-ratelimiting.policies.cluster"] = "kong/plugins/response-ratelimiting/policies/cluster.lua", + ["kong.plugins.response-ratelimiting.clustering.compat.redis_translation"] = "kong/plugins/response-ratelimiting/clustering/compat/redis_translation.lua", + + ["kong.plugins.request-size-limiting.handler"] = "kong/plugins/request-size-limiting/handler.lua", + ["kong.plugins.request-size-limiting.schema"] = "kong/plugins/request-size-limiting/schema.lua", + + ["kong.plugins.response-transformer.handler"] = "kong/plugins/response-transformer/handler.lua", + ["kong.plugins.response-transformer.body_transformer"] = "kong/plugins/response-transformer/body_transformer.lua", + ["kong.plugins.response-transformer.header_transformer"] = "kong/plugins/response-transformer/header_transformer.lua", + ["kong.plugins.response-transformer.schema"] = "kong/plugins/response-transformer/schema.lua", + + ["kong.plugins.cors.handler"] = "kong/plugins/cors/handler.lua", + ["kong.plugins.cors.schema"] = "kong/plugins/cors/schema.lua", + + ["kong.plugins.ip-restriction.handler"] = "kong/plugins/ip-restriction/handler.lua", + ["kong.plugins.ip-restriction.schema"] = "kong/plugins/ip-restriction/schema.lua", + ["kong.plugins.ip-restriction.migrations"] = "kong/plugins/ip-restriction/migrations/init.lua", + ["kong.plugins.ip-restriction.migrations.001_200_to_210"] = "kong/plugins/ip-restriction/migrations/001_200_to_210.lua", + + ["kong.plugins.acl.migrations"] = "kong/plugins/acl/migrations/init.lua", + ["kong.plugins.acl.migrations.000_base_acl"] = "kong/plugins/acl/migrations/000_base_acl.lua", + ["kong.plugins.acl.migrations.002_130_to_140"] = "kong/plugins/acl/migrations/002_130_to_140.lua", + ["kong.plugins.acl.migrations.003_200_to_210"] = "kong/plugins/acl/migrations/003_200_to_210.lua", + ["kong.plugins.acl.migrations.004_212_to_213"] = "kong/plugins/acl/migrations/004_212_to_213.lua", + ["kong.plugins.acl.handler"] = "kong/plugins/acl/handler.lua", + ["kong.plugins.acl.schema"] = "kong/plugins/acl/schema.lua", + ["kong.plugins.acl.daos"] = "kong/plugins/acl/daos.lua", + ["kong.plugins.acl.groups"] = "kong/plugins/acl/groups.lua", + ["kong.plugins.acl.acls"] = "kong/plugins/acl/acls.lua", + ["kong.plugins.acl.api"] = "kong/plugins/acl/api.lua", + + ["kong.plugins.correlation-id.handler"] = "kong/plugins/correlation-id/handler.lua", + ["kong.plugins.correlation-id.schema"] = "kong/plugins/correlation-id/schema.lua", + + ["kong.plugins.jwt.migrations"] = "kong/plugins/jwt/migrations/init.lua", + ["kong.plugins.jwt.migrations.000_base_jwt"] = "kong/plugins/jwt/migrations/000_base_jwt.lua", + ["kong.plugins.jwt.migrations.002_130_to_140"] = "kong/plugins/jwt/migrations/002_130_to_140.lua", + ["kong.plugins.jwt.migrations.003_200_to_210"] = "kong/plugins/jwt/migrations/003_200_to_210.lua", + ["kong.plugins.jwt.handler"] = "kong/plugins/jwt/handler.lua", + ["kong.plugins.jwt.schema"] = "kong/plugins/jwt/schema.lua", + ["kong.plugins.jwt.daos"] = "kong/plugins/jwt/daos.lua", + ["kong.plugins.jwt.jwt_parser"] = "kong/plugins/jwt/jwt_parser.lua", + + ["kong.plugins.hmac-auth.migrations"] = "kong/plugins/hmac-auth/migrations/init.lua", + ["kong.plugins.hmac-auth.migrations.000_base_hmac_auth"] = "kong/plugins/hmac-auth/migrations/000_base_hmac_auth.lua", + ["kong.plugins.hmac-auth.migrations.002_130_to_140"] = "kong/plugins/hmac-auth/migrations/002_130_to_140.lua", + ["kong.plugins.hmac-auth.migrations.003_200_to_210"] = "kong/plugins/hmac-auth/migrations/003_200_to_210.lua", + ["kong.plugins.hmac-auth.handler"] = "kong/plugins/hmac-auth/handler.lua", + ["kong.plugins.hmac-auth.access"] = "kong/plugins/hmac-auth/access.lua", + ["kong.plugins.hmac-auth.schema"] = "kong/plugins/hmac-auth/schema.lua", + ["kong.plugins.hmac-auth.daos"] = "kong/plugins/hmac-auth/daos.lua", + + ["kong.plugins.ldap-auth.handler"] = "kong/plugins/ldap-auth/handler.lua", + ["kong.plugins.ldap-auth.access"] = "kong/plugins/ldap-auth/access.lua", + ["kong.plugins.ldap-auth.schema"] = "kong/plugins/ldap-auth/schema.lua", + ["kong.plugins.ldap-auth.ldap"] = "kong/plugins/ldap-auth/ldap.lua", + ["kong.plugins.ldap-auth.asn1"] = "kong/plugins/ldap-auth/asn1.lua", + + ["kong.plugins.syslog.handler"] = "kong/plugins/syslog/handler.lua", + ["kong.plugins.syslog.schema"] = "kong/plugins/syslog/schema.lua", + + ["kong.plugins.loggly.handler"] = "kong/plugins/loggly/handler.lua", + ["kong.plugins.loggly.schema"] = "kong/plugins/loggly/schema.lua", + + ["kong.plugins.datadog.handler"] = "kong/plugins/datadog/handler.lua", + ["kong.plugins.datadog.schema"] = "kong/plugins/datadog/schema.lua", + ["kong.plugins.datadog.statsd_logger"] = "kong/plugins/datadog/statsd_logger.lua", + + ["kong.plugins.statsd.constants"] = "kong/plugins/statsd/constants.lua", + ["kong.plugins.statsd.handler"] = "kong/plugins/statsd/handler.lua", + ["kong.plugins.statsd.log"] = "kong/plugins/statsd/log.lua", + ["kong.plugins.statsd.schema"] = "kong/plugins/statsd/schema.lua", + ["kong.plugins.statsd.statsd_logger"] = "kong/plugins/statsd/statsd_logger.lua", + + ["kong.plugins.bot-detection.handler"] = "kong/plugins/bot-detection/handler.lua", + ["kong.plugins.bot-detection.schema"] = "kong/plugins/bot-detection/schema.lua", + ["kong.plugins.bot-detection.rules"] = "kong/plugins/bot-detection/rules.lua", + ["kong.plugins.bot-detection.migrations"] = "kong/plugins/bot-detection/migrations/init.lua", + ["kong.plugins.bot-detection.migrations.001_200_to_210"] = "kong/plugins/bot-detection/migrations/001_200_to_210.lua", + + ["kong.plugins.request-termination.handler"] = "kong/plugins/request-termination/handler.lua", + ["kong.plugins.request-termination.schema"] = "kong/plugins/request-termination/schema.lua", + + ["kong.plugins.aws-lambda.handler"] = "kong/plugins/aws-lambda/handler.lua", + ["kong.plugins.aws-lambda.schema"] = "kong/plugins/aws-lambda/schema.lua", + ["kong.plugins.aws-lambda.request-util"] = "kong/plugins/aws-lambda/request-util.lua", + + ["kong.plugins.grpc-gateway.deco"] = "kong/plugins/grpc-gateway/deco.lua", + ["kong.plugins.grpc-gateway.handler"] = "kong/plugins/grpc-gateway/handler.lua", + ["kong.plugins.grpc-gateway.schema"] = "kong/plugins/grpc-gateway/schema.lua", + + ["kong.plugins.acme.api"] = "kong/plugins/acme/api.lua", + ["kong.plugins.acme.client"] = "kong/plugins/acme/client.lua", + ["kong.plugins.acme.clustering.compat.redis_translation"] = "kong/plugins/acme/clustering/compat/redis_translation.lua", + ["kong.plugins.acme.daos"] = "kong/plugins/acme/daos.lua", + ["kong.plugins.acme.handler"] = "kong/plugins/acme/handler.lua", + ["kong.plugins.acme.migrations.000_base_acme"] = "kong/plugins/acme/migrations/000_base_acme.lua", + ["kong.plugins.acme.migrations.001_280_to_300"] = "kong/plugins/acme/migrations/001_280_to_300.lua", + ["kong.plugins.acme.migrations.002_320_to_330"] = "kong/plugins/acme/migrations/002_320_to_330.lua", + ["kong.plugins.acme.migrations.003_350_to_360"] = "kong/plugins/acme/migrations/003_350_to_360.lua", + ["kong.plugins.acme.migrations"] = "kong/plugins/acme/migrations/init.lua", + ["kong.plugins.acme.schema"] = "kong/plugins/acme/schema.lua", + ["kong.plugins.acme.storage.kong"] = "kong/plugins/acme/storage/kong.lua", + ["kong.plugins.acme.storage.config_adapters"] = "kong/plugins/acme/storage/config_adapters/init.lua", + ["kong.plugins.acme.storage.config_adapters.redis"] = "kong/plugins/acme/storage/config_adapters/redis.lua", + ["kong.plugins.acme.reserved_words"] = "kong/plugins/acme/reserved_words.lua", + + ["kong.plugins.prometheus.api"] = "kong/plugins/prometheus/api.lua", + ["kong.plugins.prometheus.status_api"] = "kong/plugins/prometheus/status_api.lua", + ["kong.plugins.prometheus.exporter"] = "kong/plugins/prometheus/exporter.lua", + ["kong.plugins.prometheus.handler"] = "kong/plugins/prometheus/handler.lua", + ["kong.plugins.prometheus.prometheus"] = "kong/plugins/prometheus/prometheus.lua", + ["kong.plugins.prometheus.serve"] = "kong/plugins/prometheus/serve.lua", + ["kong.plugins.prometheus.schema"] = "kong/plugins/prometheus/schema.lua", + + ["kong.plugins.session.handler"] = "kong/plugins/session/handler.lua", + ["kong.plugins.session.schema"] = "kong/plugins/session/schema.lua", + ["kong.plugins.session.access"] = "kong/plugins/session/access.lua", + ["kong.plugins.session.header_filter"] = "kong/plugins/session/header_filter.lua", + ["kong.plugins.session.session"] = "kong/plugins/session/session.lua", + ["kong.plugins.session.daos"] = "kong/plugins/session/daos.lua", + ["kong.plugins.session.storage.kong"] = "kong/plugins/session/storage/kong.lua", + ["kong.plugins.session.migrations.000_base_session"] = "kong/plugins/session/migrations/000_base_session.lua", + ["kong.plugins.session.migrations.001_add_ttl_index"] = "kong/plugins/session/migrations/001_add_ttl_index.lua", + ["kong.plugins.session.migrations.002_320_to_330"] = "kong/plugins/session/migrations/002_320_to_330.lua", + ["kong.plugins.session.migrations"] = "kong/plugins/session/migrations/init.lua", + + ["kong.plugins.proxy-cache.handler"] = "kong/plugins/proxy-cache/handler.lua", + ["kong.plugins.proxy-cache.cache_key"] = "kong/plugins/proxy-cache/cache_key.lua", + ["kong.plugins.proxy-cache.schema"] = "kong/plugins/proxy-cache/schema.lua", + ["kong.plugins.proxy-cache.api"] = "kong/plugins/proxy-cache/api.lua", + ["kong.plugins.proxy-cache.strategies"] = "kong/plugins/proxy-cache/strategies/init.lua", + ["kong.plugins.proxy-cache.strategies.memory"] = "kong/plugins/proxy-cache/strategies/memory.lua", + + ["kong.plugins.grpc-web.deco"] = "kong/plugins/grpc-web/deco.lua", + ["kong.plugins.grpc-web.handler"] = "kong/plugins/grpc-web/handler.lua", + ["kong.plugins.grpc-web.schema"] = "kong/plugins/grpc-web/schema.lua", + + ["kong.plugins.pre-function._handler"] = "kong/plugins/pre-function/_handler.lua", + ["kong.plugins.pre-function._schema"] = "kong/plugins/pre-function/_schema.lua", + ["kong.plugins.pre-function.migrations._001_280_to_300"] = "kong/plugins/pre-function/migrations/_001_280_to_300.lua", + + ["kong.plugins.pre-function.handler"] = "kong/plugins/pre-function/handler.lua", + ["kong.plugins.pre-function.schema"] = "kong/plugins/pre-function/schema.lua", + ["kong.plugins.pre-function.migrations"] = "kong/plugins/pre-function/migrations/init.lua", + ["kong.plugins.pre-function.migrations.001_280_to_300"] = "kong/plugins/pre-function/migrations/001_280_to_300.lua", + + ["kong.plugins.post-function.handler"] = "kong/plugins/post-function/handler.lua", + ["kong.plugins.post-function.schema"] = "kong/plugins/post-function/schema.lua", + ["kong.plugins.post-function.migrations"] = "kong/plugins/post-function/migrations/init.lua", + ["kong.plugins.post-function.migrations.001_280_to_300"] = "kong/plugins/post-function/migrations/001_280_to_300.lua", + + ["kong.plugins.zipkin.handler"] = "kong/plugins/zipkin/handler.lua", + ["kong.plugins.zipkin.reporter"] = "kong/plugins/zipkin/reporter.lua", + ["kong.plugins.zipkin.span"] = "kong/plugins/zipkin/span.lua", + ["kong.plugins.zipkin.schema"] = "kong/plugins/zipkin/schema.lua", + ["kong.plugins.zipkin.request_tags"] = "kong/plugins/zipkin/request_tags.lua", + + ["kong.plugins.request-transformer.migrations.postgres"] = "kong/plugins/request-transformer/migrations/postgres.lua", + ["kong.plugins.request-transformer.migrations.common"] = "kong/plugins/request-transformer/migrations/common.lua", + ["kong.plugins.request-transformer.handler"] = "kong/plugins/request-transformer/handler.lua", + ["kong.plugins.request-transformer.access"] = "kong/plugins/request-transformer/access.lua", + ["kong.plugins.request-transformer.schema"] = "kong/plugins/request-transformer/schema.lua", + + ["kong.plugins.azure-functions.handler"] = "kong/plugins/azure-functions/handler.lua", + ["kong.plugins.azure-functions.schema"] = "kong/plugins/azure-functions/schema.lua", + + ["kong.plugins.opentelemetry.handler"] = "kong/plugins/opentelemetry/handler.lua", + ["kong.plugins.opentelemetry.schema"] = "kong/plugins/opentelemetry/schema.lua", + ["kong.plugins.opentelemetry.proto"] = "kong/plugins/opentelemetry/proto.lua", + ["kong.plugins.opentelemetry.otlp"] = "kong/plugins/opentelemetry/otlp.lua", + + ["kong.plugins.ai-proxy.handler"] = "kong/plugins/ai-proxy/handler.lua", + ["kong.plugins.ai-proxy.schema"] = "kong/plugins/ai-proxy/schema.lua", + + ["kong.plugins.ai-request-transformer.handler"] = "kong/plugins/ai-request-transformer/handler.lua", + ["kong.plugins.ai-request-transformer.schema"] = "kong/plugins/ai-request-transformer/schema.lua", + + ["kong.plugins.ai-response-transformer.handler"] = "kong/plugins/ai-response-transformer/handler.lua", + ["kong.plugins.ai-response-transformer.schema"] = "kong/plugins/ai-response-transformer/schema.lua", + + ["kong.llm"] = "kong/llm/init.lua", + ["kong.llm.drivers.shared"] = "kong/llm/drivers/shared.lua", + ["kong.llm.drivers.openai"] = "kong/llm/drivers/openai.lua", + ["kong.llm.drivers.azure"] = "kong/llm/drivers/azure.lua", + ["kong.llm.drivers.cohere"] = "kong/llm/drivers/cohere.lua", + ["kong.llm.drivers.anthropic"] = "kong/llm/drivers/anthropic.lua", + ["kong.llm.drivers.mistral"] = "kong/llm/drivers/mistral.lua", + ["kong.llm.drivers.llama2"] = "kong/llm/drivers/llama2.lua", + + ["kong.plugins.ai-prompt-decorator.handler"] = "kong/plugins/ai-prompt-decorator/handler.lua", + ["kong.plugins.ai-prompt-decorator.schema"] = "kong/plugins/ai-prompt-decorator/schema.lua", + + ["kong.plugins.ai-prompt-template.handler"] = "kong/plugins/ai-prompt-template/handler.lua", + ["kong.plugins.ai-prompt-template.schema"] = "kong/plugins/ai-prompt-template/schema.lua", + ["kong.plugins.ai-prompt-template.templater"] = "kong/plugins/ai-prompt-template/templater.lua", + + ["kong.plugins.ai-prompt-guard.handler"] = "kong/plugins/ai-prompt-guard/handler.lua", + ["kong.plugins.ai-prompt-guard.schema"] = "kong/plugins/ai-prompt-guard/schema.lua", + + ["kong.vaults.env"] = "kong/vaults/env/init.lua", + ["kong.vaults.env.schema"] = "kong/vaults/env/schema.lua", + + ["kong.tracing.instrumentation"] = "kong/tracing/instrumentation.lua", + ["kong.tracing.propagation"] = "kong/tracing/propagation.lua", + ["kong.tracing.request_id"] = "kong/tracing/request_id.lua", + ["kong.tracing.tracing_context"] = "kong/tracing/tracing_context.lua", + + ["kong.timing"] = "kong/timing/init.lua", + ["kong.timing.context"] = "kong/timing/context.lua", + ["kong.timing.hooks"] = "kong/timing/hooks/init.lua", + ["kong.timing.hooks.dns"] = "kong/timing/hooks/dns.lua", + ["kong.timing.hooks.http"] = "kong/timing/hooks/http.lua", + ["kong.timing.hooks.redis"] = "kong/timing/hooks/redis.lua", + ["kong.timing.hooks.socket"] = "kong/timing/hooks/socket.lua", + + ["kong.dynamic_hook"] = "kong/dynamic_hook/init.lua", + ["kong.dynamic_hook.wrap_function_gen"] = "kong/dynamic_hook/wrap_function_gen.lua", + } +} diff --git a/syft/pkg/cataloger/lua/test-fixtures/rockspec/kong-pgmoon-1.16.2-1.rockspec b/syft/pkg/cataloger/lua/test-fixtures/rockspec/kong-pgmoon-1.16.2-1.rockspec new file mode 100644 index 00000000000..647b8960cf5 --- /dev/null +++ b/syft/pkg/cataloger/lua/test-fixtures/rockspec/kong-pgmoon-1.16.2-1.rockspec @@ -0,0 +1,44 @@ +package = "kong-pgmoon" +version = "1.16.2-1" + +source = { + url = "git+https://github.com/kong/pgmoon.git", + tag = "v1.16.2" +} + +description = { + summary = "Postgres driver for OpenResty and Lua", + detailed = [[PostgreSQL driver written in pure Lua for use with OpenResty's cosocket API. Can also be used in regular Lua with LuaSocket and LuaCrypto.]], + homepage = "https://github.com/Kong/pgmoon", + maintainer = "Kong Inc", + license = "MIT" +} + +dependencies = { + "lua >= 5.1", + "lpeg", + + -- "luasocket", + -- "luasec", + -- + -- "cqueues", + -- "luaossl" + -- + -- "lua-resty-openssl", +} + +build = { + type = "builtin", + modules = { + ["pgmoon"] = "pgmoon/init.lua", + ["pgmoon.arrays"] = "pgmoon/arrays.lua", + ["pgmoon.bit"] = "pgmoon/bit.lua", + ["pgmoon.cqueues"] = "pgmoon/cqueues.lua", + ["pgmoon.crypto"] = "pgmoon/crypto.lua", + ["pgmoon.hstore"] = "pgmoon/hstore.lua", + ["pgmoon.json"] = "pgmoon/json.lua", + ["pgmoon.socket"] = "pgmoon/socket.lua", + ["pgmoon.util"] = "pgmoon/util.lua", + }, +} + diff --git a/syft/pkg/cataloger/lua/test-fixtures/rockspec/lpeg-1.0.2-1.rockspec b/syft/pkg/cataloger/lua/test-fixtures/rockspec/lpeg-1.0.2-1.rockspec new file mode 100644 index 00000000000..67ab9276de3 --- /dev/null +++ b/syft/pkg/cataloger/lua/test-fixtures/rockspec/lpeg-1.0.2-1.rockspec @@ -0,0 +1,32 @@ +package = 'LPeg' +version = '1.0.2-1' +source = { + url = 'http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.2.tar.gz', + md5 = 'd342571886f1abcb7afe6a83d024d583', +} +description = { + summary = 'Parsing Expression Grammars For Lua', + detailed = [[ + LPeg is a new pattern-matching library for Lua, based on Parsing + Expression Grammars (PEGs). The nice thing about PEGs is that it + has a formal basis (instead of being an ad-hoc set of features), + allows an efficient and simple implementation, and does most things + we expect from a pattern-matching library (and more, as we can + define entire grammars). + ]], + homepage = 'http://www.inf.puc-rio.br/~roberto/lpeg.html', + maintainer = 'Gary V. Vaughan ', + license = 'MIT/X11' +} +dependencies = { + 'lua >= 5.1' +} +build = { + type = 'builtin', + modules = { + lpeg = { + 'lpcap.c', 'lpcode.c', 'lpprint.c', 'lptree.c', 'lpvm.c' + }, + re = 're.lua' + } +} diff --git a/syft/pkg/language.go b/syft/pkg/language.go index b0e3641fb55..cbde8de350e 100644 --- a/syft/pkg/language.go +++ b/syft/pkg/language.go @@ -21,6 +21,7 @@ const ( Haskell Language = "haskell" Java Language = "java" JavaScript Language = "javascript" + Lua Language = "lua" PHP Language = "php" Python Language = "python" R Language = "R" @@ -40,6 +41,7 @@ var AllLanguages = []Language{ Haskell, Java, JavaScript, + Lua, PHP, Python, R, @@ -72,6 +74,8 @@ func LanguageByName(name string) Language { return Go case packageurl.TypeNPM, string(JavaScript), "nodejs", "node.js": return JavaScript + case packageurl.TypeLuaRocks, string(Lua): + return Lua case packageurl.TypePyPi, string(Python): return Python case packageurl.TypeGem, string(Ruby): diff --git a/syft/pkg/language_test.go b/syft/pkg/language_test.go index 147df054953..9504c0a55d0 100644 --- a/syft/pkg/language_test.go +++ b/syft/pkg/language_test.go @@ -78,6 +78,10 @@ func TestLanguageFromPURL(t *testing.T) { purl: "pkg:swift/github.com/apple/swift-numerics/swift-numerics@1.0.2", want: Swift, }, + { + purl: "pkg:luarocks/kong@3.7.0", + want: Lua, + }, } var languages = strset.New() diff --git a/syft/pkg/rockspec.go b/syft/pkg/rockspec.go new file mode 100644 index 00000000000..05ca74f7ca8 --- /dev/null +++ b/syft/pkg/rockspec.go @@ -0,0 +1,11 @@ +package pkg + +type LuaRocksPackage struct { + Name string `json:"name"` + Version string `json:"version"` + License string `json:"license"` + Homepage string `json:"homepage"` + Description string `json:"description"` + URL string `json:"url"` + Dependencies map[string]string `json:"dependencies"` +} diff --git a/syft/pkg/type.go b/syft/pkg/type.go index badf1793e70..8b01af08bce 100644 --- a/syft/pkg/type.go +++ b/syft/pkg/type.go @@ -38,6 +38,7 @@ const ( PortagePkg Type = "portage" PythonPkg Type = "python" Rpkg Type = "R-package" + LuaRocksPkg Type = "lua-rocks" RpmPkg Type = "rpm" RustPkg Type = "rust-crate" SwiftPkg Type = "swift" @@ -73,6 +74,7 @@ var AllPkgs = []Type{ PortagePkg, PythonPkg, Rpkg, + LuaRocksPkg, RpmPkg, RustPkg, SwiftPkg, @@ -131,6 +133,8 @@ func (t Type) PackageURLType() string { return packageurl.TypeNPM case Rpkg: return packageurl.TypeCran + case LuaRocksPkg: + return packageurl.TypeLuaRocks case RpmPkg: return packageurl.TypeRPM case RustPkg: @@ -165,6 +169,8 @@ func TypeByName(name string) Type { return DebPkg case packageurl.TypeRPM: return RpmPkg + case packageurl.TypeLuaRocks: + return LuaRocksPkg case "alpm": return AlpmPkg case packageurl.TypeAlpine, "alpine": diff --git a/syft/pkg/type_test.go b/syft/pkg/type_test.go index 3f456f6d39a..f1e7b275b4e 100644 --- a/syft/pkg/type_test.go +++ b/syft/pkg/type_test.go @@ -103,6 +103,10 @@ func TestTypeFromPURL(t *testing.T) { purl: "pkg:cran/base@4.3.0", expected: Rpkg, }, + { + purl: "pkg:luarocks/kong@3.7.0", + expected: LuaRocksPkg, + }, { purl: "pkg:swift/github.com/apple/swift-numerics/swift-numerics@1.0.2", expected: SwiftPkg, diff --git a/test/cli/scan_cmd_test.go b/test/cli/scan_cmd_test.go index a35f4d99c58..555f0856b61 100644 --- a/test/cli/scan_cmd_test.go +++ b/test/cli/scan_cmd_test.go @@ -9,7 +9,7 @@ import ( const ( // this is the number of packages that should be found in the image-pkg-coverage fixture image // when analyzed with the squashed scope. - coverageImageSquashedPackageCount = 29 + coverageImageSquashedPackageCount = 30 ) func TestPackagesCmdFlags(t *testing.T) {