
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
io.github.willena:influxql
Advanced tools
Java library inspired from the official influxql and influxqb go package.
Building strongly typed and secure InfluxQL queries from string is not always an easy task You have to take care of the sanitization, keep the distinction between function, identifier, numbers and string literals to build a valid query.
The influxQL parser contains all the required types to manually build a query from scratch. More importantly it also contains String() method on each type and statement. The parse r then take care of escaping character, putting quotes or not, ...
The implementation is based on types from the go parser AST.
Once a statement object is built the properly formated and escaped InfluxQL statement can be obtained by
calling toString()
Relases can be found from Maven and as github artifacts.
<dependency>
<groupId>io.github.willena</groupId>
<artifactId>influxql</artifactId>
<version>${version}</version>
</dependency>
See the list of statements and their builder
All functions are an instance of the Call
class.
The FunctionFactory
class defines a lot of static methods for known
functions: See JavaDoc page
import io.github.willena.influxql.ast.expr.Dimension;
import io.github.willena.influxql.ast.expr.VarRef;
import io.github.willena.influxql.ast.field.Field;
import io.github.willena.influxql.ast.source.Measurement;
import io.github.willena.influxql.ast.statement.AlterRetentionPolicyStatement;
import io.github.willena.influxql.ast.statement.SelectStatement;
import io.github.willena.influxql.ast.extra.FunctionFactory.Aggregations.mean;
import io.github.willena.influxql.ast.source.Measurement.measurement;
import io.github.willena.influxql.ast.expr.Dimension.sampledBy;
import java.time.Duration;
public static void main(String[] args) {
AlterRetentionPolicyStatement stm = new AlterRetentionPolicyStatement.Builder()
.on("DB")
.policyName("Policy")
.build();
System.out.println(stm);
// Prints 'ALTER RETENTION POLICY Policy ON "DB"'
SelectStatement select = new SelectStatement.Builder()
.select(Field.of(mean(VarRef.of("field"))))
.from(measurement("meas"))
.groupBy(sampledBy(Duration.ofDays(1)))
.build();
System.out.println(select);
// Prints 'SELECT MEAN(field) FROM meas GROUP BY time(1d)'
}
import io.github.willena.influxql.ast.Query;
import io.github.willena.influxql.ast.statement.SelectStatement;
public static void main(String[] args) {
Query st = Query.parse("CREATE DATABASE dbName; SELECT * FROM dbname WHERE time > '2020-01-01T00:00:00.000Z' and time < '2021-01-01T00:00:00.000Z'");
}
import io.github.willena.influxql.ast.Query;
import io.github.willena.influxql.ast.statement.SelectStatement;
public static void main(String[] args) {
Query st = Query.parse("SELECT * FROM dbname WHERE time > '2020-01-01T00:00:00.000Z' and time < '2021-01-01T00:00:00.000Z'");
}
import io.github.willena.influxql.ast.statement.SelectStatement;
public static void main(String[] args) {
SelectStatement st = SelectStatement.parse("SELECT * FROM dbname WHERE time > '2020-01-01T00:00:00.000Z' and time < '2021-01-01T00:00:00.000Z'");
}
InfluxQL Java package
Copyright 2024 Guillaume VILLENA aka "Willena"
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
FAQs
Unknown package
We found that io.github.willena:influxql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.