Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
517e6a5
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 20, 2026
f285dd5
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 20, 2026
6c3d0c9
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 20, 2026
1aabcf2
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 20, 2026
975414f
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 20, 2026
fb6b6d5
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 20, 2026
6c935a5
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 20, 2026
ba36961
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 20, 2026
bc32355
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 20, 2026
f9af93b
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 20, 2026
44b19c1
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 20, 2026
a06aff9
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 21, 2026
984d154
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 21, 2026
03055c6
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 21, 2026
9d4bc97
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 21, 2026
c6d1736
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 21, 2026
eec09b6
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 21, 2026
7e68739
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 21, 2026
fb98ddf
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 21, 2026
e8753ee
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 21, 2026
21c236a
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 21, 2026
427bb90
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 21, 2026
1befcf5
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 23, 2026
c7897f8
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 23, 2026
904f879
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 23, 2026
617f9b1
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 23, 2026
7b42c2a
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 25, 2026
9e61243
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 25, 2026
4781094
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 25, 2026
9f54075
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 26, 2026
cae2de7
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 29, 2026
63391db
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 29, 2026
f16ccda
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 29, 2026
6d813c4
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 29, 2026
c176333
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 29, 2026
0e8d1ff
CE-132 oap-sso: user: replace PK: email -> id
nofateg Jan 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ private static void loadOnlyMainModuleAndDependsOn( ModuleItemTree modules,

modules.remove( module );

loadOnlyMainModuleAndDependsOn( modules, moduleItem.module.dependsOn, loaded );
if( !moduleItem.module.dependsOn.isEmpty() ) {
log.debug( "[loadOnlyMainModuleAndDependsOn] module {} -> dependsOn {}", moduleItem.getName(), moduleItem.module.dependsOn );
loadOnlyMainModuleAndDependsOn( modules, moduleItem.module.dependsOn, loaded );
}
}
}
}
Expand Down
373 changes: 326 additions & 47 deletions oap-http/oap-http-test/src/main/java/oap/http/test/HttpAsserts.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

package oap.http.server.nio.health;

//import oap.application.module.Module;
//import oap.application.testng.KernelFixture;

import oap.http.server.nio.NioHttpServer;
import oap.http.test.HttpAsserts;
import oap.testng.Fixtures;
Expand All @@ -40,16 +37,6 @@
import static oap.http.test.HttpAsserts.assertGet;

public class HealthHttpHandlerTest extends Fixtures {
public HealthHttpHandlerTest() {
// fixture( new KernelFixture(
// urlOfTestResource( getClass(), "application.test.conf" ),
// Lists.concat(
// List.of( urlOfTestResource( getClass(), "oap-module.oap" ) ),
// Module.CONFIGURATION.urlsFromClassPath()
// )
// ) );
}

@Test
public void health() throws IOException {
int httpPort = Ports.getFreePort( getClass() );
Expand Down
7 changes: 4 additions & 3 deletions oap-http/oap-http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-jvm</artifactId>
<!-- Remove after OkHttp 5.3.0 with updated BOM. -->
<version>5.1.0</version>
</dependency>

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-java-net-cookiejar</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
14 changes: 9 additions & 5 deletions oap-http/oap-http/src/main/java/oap/http/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -441,17 +441,18 @@ private CompletableFuture<Response> execute( HttpUriRequest request, Map<String,
ThrowingRunnable asyncRunnable ) {
headers.forEach( ( name, value ) -> request.setHeader( name, value == null ? "" : value.toString() ) );

var completableFuture = new CompletableFuture<Response>();
CompletableFuture<Response> completableFuture = new CompletableFuture<Response>();

client.execute( request, new FutureCallback<>() {
@Override
public void completed( HttpResponse response ) {
try {
var responseHeaders = headers( response );
List<Pair<String, String>> responseHeaders = headers( response );
Response result;
if( response.getEntity() != null ) {
var entity = response.getEntity();
result = new Response(
request.getURI().toString(),
response.getStatusLine().getStatusCode(),
response.getStatusLine().getReasonPhrase(),
responseHeaders,
Expand All @@ -461,6 +462,7 @@ public void completed( HttpResponse response ) {
entity.getContent()
);
} else result = new Response(
request.getURI().toString(),
response.getStatusLine().getStatusCode(),
response.getStatusLine().getReasonPhrase(),
responseHeaders
Expand Down Expand Up @@ -560,23 +562,25 @@ public void close() {

@ToString( exclude = { "inputStream", "content" }, doNotUseGetters = true )
public static class Response implements Closeable, AutoCloseable {
public final String url;
public final int code;
public final String reasonPhrase;
public final String contentType;
public final List<Pair<String, String>> headers;
private InputStream inputStream;
private volatile byte[] content = null;

public Response( int code, String reasonPhrase, List<Pair<String, String>> headers, @Nonnull String contentType, InputStream inputStream ) {
public Response( String url, int code, String reasonPhrase, List<Pair<String, String>> headers, @Nonnull String contentType, InputStream inputStream ) {
this.url = url;
this.code = code;
this.reasonPhrase = reasonPhrase;
this.headers = headers;
this.contentType = Objects.requireNonNull( contentType );
this.inputStream = inputStream;
}

public Response( int code, String reasonPhrase, List<Pair<String, String>> headers ) {
this( code, reasonPhrase, headers, BiStream.of( headers )
public Response( String url, int code, String reasonPhrase, List<Pair<String, String>> headers ) {
this( url, code, reasonPhrase, headers, BiStream.of( headers )
.filter( ( name, value ) -> "Content-type".equalsIgnoreCase( name ) )
.mapToObj( ( name, value ) -> value )
.findAny()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package oap.http;

import okhttp3.MediaType;
import okhttp3.RequestBody;
import okio.BufferedSink;
import okio.Okio;
import okio.Source;

import java.io.IOException;
import java.io.InputStream;

public class InputStreamRequestBody extends RequestBody {
private final MediaType mediaType;
private final InputStream inputStream;

public InputStreamRequestBody( MediaType mediaType, InputStream inputStream ) {
this.mediaType = mediaType;
this.inputStream = inputStream;
}

@Override
public MediaType contentType() {
return mediaType;
}

// You can override contentLength() if you know the length in advance for better performance/features (e.g., S3 uploads).
// If you don't override it, OkHttp will use chunked transfer encoding for large bodies.

@Override
public void writeTo( BufferedSink sink ) throws IOException {
try( Source source = Okio.source( inputStream ) ) {
sink.writeAll( source );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,26 @@

import javax.annotation.concurrent.NotThreadSafe;
import java.io.OutputStream;
import java.nio.ByteBuffer;

import static java.nio.charset.StandardCharsets.UTF_8;

@NotThreadSafe
public class PnioResponseBuffer {
public int length;
byte[] buffer;
public byte[] buffer;

public PnioResponseBuffer( int capacity ) {
this.buffer = new byte[capacity];
this.length = 0;
}

public String string() {
return new String( buffer, 0, length );
return new String( buffer, 0, length, UTF_8 );
}

public ByteBuffer byteBuffer() {
return ByteBuffer.wrap( buffer, 0, length );
}

public boolean isEmpty() {
Expand Down
2 changes: 1 addition & 1 deletion oap-jpath/src/main/java/oap/jpath/JPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void evaluate( String expression, Map<String, Object> variables, J
}

public void evaluate( String expression, JPathOutput output ) {
var jPathParser = new JPathParser( new BufferedTokenStream( new JPathLexer( new ANTLRInputStream( expression ) ) ) );
JPathParser jPathParser = new JPathParser( new BufferedTokenStream( new JPathLexer( new ANTLRInputStream( expression ) ) ) );

jPathParser.expr().expression.evaluate( variables, output );
}
Expand Down
2 changes: 1 addition & 1 deletion oap-jpath/src/main/java/oap/jpath/MapPointer.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public MapPointer( Map<Object, Object> map ) {
@Override
public Pointer resolve( AbstractPathNode n ) {
if( n.type == PathType.FIELD ) {
var ret = v.get( n.name );
Object ret = v.get( n.name );
return ret != null ? Pointer.get( ret ) : NullPointer.INSTANCE;
}
return super.resolve( n );
Expand Down
2 changes: 1 addition & 1 deletion oap-jpath/src/main/java/oap/jpath/PathExpression.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void add( AbstractPathNode path ) {
@SuppressWarnings( "unchecked" )
public void evaluate( Map<String, Object> variables, JPathOutput output ) {
Pointer pointer = new MapPointer( ( Map<Object, Object> ) ( Object ) variables );
for( var n : list ) pointer = pointer.resolve( n );
for( AbstractPathNode n : list ) pointer = pointer.resolve( n );
output.write( pointer );
}
}
10 changes: 5 additions & 5 deletions oap-stdlib-test/src/main/java/oap/json/testng/JsonAsserts.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
import static oap.io.content.ContentReader.ofJson;
import static oap.io.content.ContentReader.ofString;
import static oap.json.Binder.json;
import static oap.testng.Asserts.assertString;
import static oap.testng.Asserts.contentOfTestResource;
import static oap.util.Pair.__;
import static org.assertj.core.api.Assertions.assertThat;

public class JsonAsserts {
@Deprecated
Expand Down Expand Up @@ -143,7 +143,7 @@ public JsonAssertion isEqualTo( String expected, Map<String, Object> substitutio
.map( JsonAssertion::deepSort, JsonAssertion::deepSort )
.map( e -> json.marshal( e.isLeft() ? e.leftValue : e.rightValue, true ) );

assertThat( actualJson ).isEqualTo( expectedJson );
assertString( actualJson ).isEqualTo( expectedJson );

return this;
}
Expand All @@ -167,7 +167,7 @@ public JsonAssertion isEqualTo( String expected, Function<String, String> substi
.map( JsonAssertion::deepSort, JsonAssertion::deepSort )
.map( e -> json.marshal( e.isLeft() ? e.leftValue : e.rightValue, true ) );

assertThat( actualJson ).isEqualTo( expectedJson );
assertString( actualJson ).isEqualTo( expectedJson );

return this;
}
Expand All @@ -189,13 +189,13 @@ public JsonAssertion isStructurallyEqualToResource( Class<?> contextClass, Strin
}

private JsonAssertion isEqualCanonically( Class<?> clazz, String actual, String expected ) {
assertThat( json.canonicalizeWithDefaultPrettyPrinter( clazz, actual ) )
assertString( json.canonicalizeWithDefaultPrettyPrinter( clazz, actual ) )
.isEqualTo( json.canonicalizeWithDefaultPrettyPrinter( clazz, expected ) );
return this;
}

private JsonAssertion isEqualCanonically( TypeRef<?> typeRef, String actual, String expected ) {
assertThat( json.canonicalizeWithDefaultPrettyPrinter( typeRef, actual ) )
assertString( json.canonicalizeWithDefaultPrettyPrinter( typeRef, actual ) )
.isEqualTo( json.canonicalizeWithDefaultPrettyPrinter( typeRef, expected ) );
return this;
}
Expand Down
21 changes: 21 additions & 0 deletions oap-stdlib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,5 +305,26 @@
<artifactId>spotbugs-annotations</artifactId>
<version>${oap.deps.spotbugs}</version>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<version>${oap.deps.netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>${oap.deps.netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>${oap.deps.netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>${oap.deps.netty.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@
import de.bwaldvogel.mongo.backend.memory.MemoryBackend;
import lombok.extern.slf4j.Slf4j;
import oap.testng.AbstractFixture;
import oap.util.Lists;
import org.bson.Document;
import org.jetbrains.annotations.NotNull;

import java.net.InetSocketAddress;
import java.util.List;
import java.util.Map;

import static oap.testng.Asserts.contentOfTestResource;
Expand Down Expand Up @@ -71,7 +74,7 @@ protected void before() {

this.server = createMongoServer();
log.info( "mongo port = {}", port );
this.server.bind( HOST, port );
this.server.bind( new InetSocketAddress( port ) );
this.mongoClient = createMongoClient();
}

Expand All @@ -81,8 +84,8 @@ public MongoClient createMongoClient() {
}

@NotNull
public MongoClient createMongoClient( String migrationPackage ) {
return new MongoClient( getConnectionString(), migrationPackage );
public MongoClient createMongoClient( String migrationPackage, String... migrationPackages ) {
return new MongoClient( getConnectionString(), Lists.concat( List.of( migrationPackage ), List.of( migrationPackages ) ) );
}

@NotNull
Expand All @@ -97,7 +100,7 @@ public String getConnectionString( String database ) {

@NotNull
protected MongoServer createMongoServer() {
return new MongoServer( new MemoryBackend().version( ServerVersion.MONGO_4_0 ) );
return new MongoServer( new MemoryBackend().version( ServerVersion.MONGO_5_0 ) );
}

@Override
Expand Down
17 changes: 7 additions & 10 deletions oap-storage/oap-storage-mongo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<version>${oap.deps.netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>${oap.deps.netty.version}</version>
</dependency>
<dependency>
<groupId>io.mongock</groupId>
<artifactId>mongock-standalone</artifactId>
Expand All @@ -77,6 +67,13 @@
<version>${oap.deps.mongock.version}</version>
</dependency>

<dependency>
<groupId>oap</groupId>
<artifactId>oap-stdlib-test</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected void processRecords( CountDownLatch cdl ) {
@Override
protected void load() {
log.debug( "loading data from {}", collection.getNamespace() );
Consumer<Metadata<T>> cons = metadata -> storage.memory.put( storage.identifier.get( metadata.object ), metadata );
Consumer<Metadata<T>> cons = metadata -> storage.memory.put( storage.identifier.getOrInit( metadata.object, _ -> false ), metadata );
log.info( "Loading documents from [{}] MongoDB table", collection.getNamespace() );
collection.find().forEach( cons );
log.info( storage.size() + " object(s) loaded." );
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package oap.storage.mongo;

import org.apache.commons.lang3.StringUtils;
import org.bson.Document;

public class MigrationUtils {
public static String getString( Document document, String key ) {
String[] keys = StringUtils.split( key, "." );

Document current = document;
Object lastValue = null;

for( String field : keys ) {
if( lastValue != null ) {
if( lastValue instanceof Document doc ) {
current = doc;
} else {
return null;
}
}

lastValue = current.get( field );
}

return ( String ) lastValue;
}
}
Loading