
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Kopyt is a Kotlin programming language parser in pure Python, inspired by javalang library.
pip install -U kopyt
from kopyt import Parser, node
code = """\
package main
import a.b
import x.y.z.*
fun main() {
println("Hello, world!")
}
"""
parser = Parser(code)
result = parser.parse()
assert result.package is not None
assert result.package.name == "main"
assert len(result.imports) == 2
assert result.imports[0].name == "a.b"
assert result.imports[1].name == "x.y.z"
assert result.imports[1].wildcard
assert len(result.declarations) == 1
assert isinstance(result.declarations[0], node.FunctionDeclaration)
assert result.declarations[0].name == "main"
assert result.declarations[0].position.line == 6
print(result) # this will output a string similar to the original code
All nodes and its members can be found on kopyt/node.py.
It is possible to parse partial Kotlin code, for example you want to parse a function declaration:
from kopyt import Parser, node
code = "fun plusOne(x: Int) = x + 1"
parser = Parser(code)
result = parser.parse_function_declaration()
assert result.name == "plusOne"
assert len(result.parameters) == 1
assert result.parameters[0].name == "x"
All parse functions can be found on kopyt/parser.py.
FAQs
Kotlin parser in pure Python
We found that kopyt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.