[#XX] provide naming conventions

Signed-off-by: Ori Bruk <o.bruk@yadro.com>
This commit is contained in:
Ori Bruk 2024-07-23 22:24:17 +03:00
parent ff5b007780
commit f415b3063a
103 changed files with 416 additions and 417 deletions

View file

@ -21,12 +21,12 @@ neo-go wallet export -w <path_to_your_wallet> -d <address_from_p1>
### Container ### Container
```java ```java
import info.FrostFS.sdk.dto.container.Container; import info.frostfs.sdk.dto.container.Container;
import info.FrostFS.sdk.dto.netmap.PlacementPolicy; import info.frostfs.sdk.dto.netmap.PlacementPolicy;
import info.FrostFS.sdk.dto.netmap.Replica; import info.frostfs.sdk.dto.netmap.Replica;
import info.FrostFS.sdk.enums.BasicAcl; import info.frostfs.sdk.enums.BasicAcl;
import info.FrostFS.sdk.jdo.ClientSettings; import info.frostfs.sdk.jdo.ClientSettings;
import info.FrostFS.sdk.services.FrostFSClient; import info.frostfs.sdk.services.FrostFSClient;
public class ContainerExample { public class ContainerExample {
@ -53,13 +53,13 @@ public class ContainerExample {
### Object ### Object
```java ```java
import info.FrostFS.sdk.enums.ObjectType; import info.frostfs.sdk.enums.ObjectType;
import info.FrostFS.sdk.dto.container.ContainerId; import info.frostfs.sdk.dto.container.ContainerId;
import info.FrostFS.sdk.dto.object.ObjectAttribute; import info.frostfs.sdk.dto.object.ObjectAttribute;
import info.FrostFS.sdk.dto.object.ObjectFilter; import info.frostfs.sdk.dto.object.ObjectFilter;
import info.FrostFS.sdk.dto.object.ObjectHeader; import info.frostfs.sdk.dto.object.ObjectHeader;
import info.FrostFS.sdk.jdo.PutObjectParameters; import info.frostfs.sdk.jdo.PutObjectParameters;
import info.FrostFS.sdk.services.FrostFSClient; import info.frostfs.sdk.services.FrostFSClient;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
@ -71,7 +71,7 @@ public class ObjectExample {
FrostFSClient frostFSClient = new FrostFSClient(clientSettings); FrostFSClient frostFSClient = new FrostFSClient(clientSettings);
// Put object // Put object
info.FrostFS.sdk.dto.object.ObjectId objectId; info.frostfs.sdk.dto.object.ObjectId objectId;
try (FileInputStream fis = new FileInputStream("cat.jpg")) { try (FileInputStream fis = new FileInputStream("cat.jpg")) {
var cat = new ObjectHeader( var cat = new ObjectHeader(
containerId, ObjectType.REGULAR, new ObjectAttribute[]{new ObjectAttribute("Filename", "cat.jpg")} containerId, ObjectType.REGULAR, new ObjectAttribute[]{new ObjectAttribute("Filename", "cat.jpg")}

View file

@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>info.FrostFS.sdk</groupId> <groupId>info.frostfs.sdk</groupId>
<artifactId>FrostFS-sdk-java</artifactId> <artifactId>frostfs-sdk-java</artifactId>
<version>0.1.0</version> <version>0.1.0</version>
</parent> </parent>
@ -19,12 +19,12 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>info.FrostFS.sdk</groupId> <groupId>info.frostfs.sdk</groupId>
<artifactId>cryptography</artifactId> <artifactId>cryptography</artifactId>
<version>0.1.0</version> <version>0.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>info.FrostFS.sdk</groupId> <groupId>info.frostfs.sdk</groupId>
<artifactId>models</artifactId> <artifactId>models</artifactId>
<version>0.1.0</version> <version>0.1.0</version>
</dependency> </dependency>

View file

@ -1,13 +0,0 @@
package info.FrostFS.sdk.services;
import info.FrostFS.sdk.dto.netmap.NetmapSnapshot;
import info.FrostFS.sdk.dto.netmap.NodeInfo;
import info.FrostFS.sdk.jdo.NetworkSettings;
public interface NetmapClient {
NetmapSnapshot getNetmapSnapshot();
NodeInfo getLocalNodeInfo();
NetworkSettings getNetworkSettings();
}

View file

@ -1,8 +0,0 @@
package info.FrostFS.sdk.services;
import info.FrostFS.sdk.dto.object.ObjectHeader;
import info.FrostFS.sdk.dto.object.ObjectId;
public interface ToolsClient {
ObjectId calculateObjectId(ObjectHeader header);
}

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.constants; package info.frostfs.sdk.constants;
public class CryptoConst { public class CryptoConst {
public static final String SIGNATURE_ALGORITHM = "NONEwithECDSAinP1363Format"; public static final String SIGNATURE_ALGORITHM = "NONEwithECDSAinP1363Format";

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.jdo; package info.frostfs.sdk.jdo;
import info.FrostFS.sdk.dto.OwnerId; import info.frostfs.sdk.dto.OwnerId;
import info.FrostFS.sdk.dto.Version; import info.frostfs.sdk.dto.Version;
import info.FrostFS.sdk.services.FrostFSClient; import info.frostfs.sdk.services.FrostFSClient;
import io.grpc.Channel; import io.grpc.Channel;
public class ClientEnvironment { public class ClientEnvironment {

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.jdo; package info.frostfs.sdk.jdo;
import io.grpc.ChannelCredentials; import io.grpc.ChannelCredentials;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.jdo; package info.frostfs.sdk.jdo;
import java.security.PrivateKey; import java.security.PrivateKey;
import static info.FrostFS.sdk.KeyExtension.*; import static info.frostfs.sdk.KeyExtension.*;
public class ECDsa { public class ECDsa {
private final byte[] publicKeyByte; private final byte[] publicKeyByte;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.jdo; package info.frostfs.sdk.jdo;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;

View file

@ -1,6 +1,6 @@
package info.FrostFS.sdk.jdo; package info.frostfs.sdk.jdo;
import info.FrostFS.sdk.dto.object.ObjectHeader; import info.frostfs.sdk.dto.object.ObjectHeader;
import java.io.FileInputStream; import java.io.FileInputStream;

View file

@ -1,7 +1,7 @@
package info.FrostFS.sdk.services; package info.frostfs.sdk.services;
import info.FrostFS.sdk.dto.container.Container; import info.frostfs.sdk.dto.container.Container;
import info.FrostFS.sdk.dto.container.ContainerId; import info.frostfs.sdk.dto.container.ContainerId;
import java.util.List; import java.util.List;

View file

@ -1,6 +1,6 @@
package info.FrostFS.sdk.services; package info.frostfs.sdk.services;
import info.FrostFS.sdk.jdo.ClientEnvironment; import info.frostfs.sdk.jdo.ClientEnvironment;
public class ContextAccessor { public class ContextAccessor {
private final ClientEnvironment context; private final ClientEnvironment context;

View file

@ -1,26 +1,26 @@
package info.FrostFS.sdk.services; package info.frostfs.sdk.services;
import frostFS.session.Types; import frostfs.session.Types;
import info.FrostFS.sdk.dto.SessionToken; import info.frostfs.sdk.dto.SessionToken;
import info.FrostFS.sdk.dto.Version; import info.frostfs.sdk.dto.Version;
import info.FrostFS.sdk.dto.container.Container; import info.frostfs.sdk.dto.container.Container;
import info.FrostFS.sdk.dto.container.ContainerId; import info.frostfs.sdk.dto.container.ContainerId;
import info.FrostFS.sdk.dto.netmap.NetmapSnapshot; import info.frostfs.sdk.dto.netmap.NetmapSnapshot;
import info.FrostFS.sdk.dto.netmap.NodeInfo; import info.frostfs.sdk.dto.netmap.NodeInfo;
import info.FrostFS.sdk.dto.object.ObjectFilter; import info.frostfs.sdk.dto.object.ObjectFilter;
import info.FrostFS.sdk.dto.object.ObjectFrostFS; import info.frostfs.sdk.dto.object.ObjectFrostFS;
import info.FrostFS.sdk.dto.object.ObjectHeader; import info.frostfs.sdk.dto.object.ObjectHeader;
import info.FrostFS.sdk.dto.object.ObjectId; import info.frostfs.sdk.dto.object.ObjectId;
import info.FrostFS.sdk.jdo.ClientEnvironment; import info.frostfs.sdk.jdo.ClientEnvironment;
import info.FrostFS.sdk.jdo.ClientSettings; import info.frostfs.sdk.jdo.ClientSettings;
import info.FrostFS.sdk.jdo.NetworkSettings; import info.frostfs.sdk.jdo.NetworkSettings;
import info.FrostFS.sdk.jdo.PutObjectParameters; import info.frostfs.sdk.jdo.PutObjectParameters;
import info.FrostFS.sdk.services.impl.*; import info.frostfs.sdk.services.impl.*;
import io.grpc.Channel; import io.grpc.Channel;
import java.util.List; import java.util.List;
import static info.FrostFS.sdk.tools.GrpcClient.initGrpcChannel; import static info.frostfs.sdk.tools.GrpcClient.initGrpcChannel;
import static java.util.Objects.isNull; import static java.util.Objects.isNull;
public class FrostFSClient implements ContainerClient, ObjectClient, NetmapClient, SessionClient, ToolsClient { public class FrostFSClient implements ContainerClient, ObjectClient, NetmapClient, SessionClient, ToolsClient {

View file

@ -0,0 +1,13 @@
package info.frostfs.sdk.services;
import info.frostfs.sdk.dto.netmap.NetmapSnapshot;
import info.frostfs.sdk.dto.netmap.NodeInfo;
import info.frostfs.sdk.jdo.NetworkSettings;
public interface NetmapClient {
NetmapSnapshot getNetmapSnapshot();
NodeInfo getLocalNodeInfo();
NetworkSettings getNetworkSettings();
}

View file

@ -1,11 +1,11 @@
package info.FrostFS.sdk.services; package info.frostfs.sdk.services;
import info.FrostFS.sdk.dto.container.ContainerId; import info.frostfs.sdk.dto.container.ContainerId;
import info.FrostFS.sdk.dto.object.ObjectFilter; import info.frostfs.sdk.dto.object.ObjectFilter;
import info.FrostFS.sdk.dto.object.ObjectFrostFS; import info.frostfs.sdk.dto.object.ObjectFrostFS;
import info.FrostFS.sdk.dto.object.ObjectHeader; import info.frostfs.sdk.dto.object.ObjectHeader;
import info.FrostFS.sdk.dto.object.ObjectId; import info.frostfs.sdk.dto.object.ObjectId;
import info.FrostFS.sdk.jdo.PutObjectParameters; import info.frostfs.sdk.jdo.PutObjectParameters;
public interface ObjectClient { public interface ObjectClient {
ObjectHeader getObjectHead(ContainerId containerId, ObjectId objectId); ObjectHeader getObjectHead(ContainerId containerId, ObjectId objectId);

View file

@ -1,6 +1,6 @@
package info.FrostFS.sdk.services; package info.frostfs.sdk.services;
import info.FrostFS.sdk.dto.SessionToken; import info.frostfs.sdk.dto.SessionToken;
public interface SessionClient { public interface SessionClient {
SessionToken createSession(long expiration); SessionToken createSession(long expiration);

View file

@ -0,0 +1,8 @@
package info.frostfs.sdk.services;
import info.frostfs.sdk.dto.object.ObjectHeader;
import info.frostfs.sdk.dto.object.ObjectId;
public interface ToolsClient {
ObjectId calculateObjectId(ObjectHeader header);
}

View file

@ -1,24 +1,25 @@
package info.FrostFS.sdk.services.impl; package info.frostfs.sdk.services.impl;
import frostFS.container.ContainerServiceGrpc; import frostfs.container.ContainerServiceGrpc;
import frostFS.container.Service; import frostfs.container.Service;
import info.FrostFS.sdk.dto.container.Container; import info.frostfs.sdk.dto.container.Container;
import info.FrostFS.sdk.dto.container.ContainerId; import info.frostfs.sdk.dto.container.ContainerId;
import info.FrostFS.sdk.jdo.ClientEnvironment; import info.frostfs.sdk.jdo.ClientEnvironment;
import info.FrostFS.sdk.mappers.OwnerIdMapper; import info.frostfs.sdk.mappers.OwnerIdMapper;
import info.FrostFS.sdk.mappers.VersionMapper; import info.frostfs.sdk.mappers.VersionMapper;
import info.FrostFS.sdk.mappers.container.ContainerIdMapper; import info.frostfs.sdk.mappers.container.ContainerIdMapper;
import info.FrostFS.sdk.mappers.container.ContainerMapper; import info.frostfs.sdk.mappers.container.ContainerMapper;
import info.FrostFS.sdk.services.ContainerClient; import info.frostfs.sdk.services.ContainerClient;
import info.FrostFS.sdk.services.ContextAccessor; import info.frostfs.sdk.services.ContextAccessor;
import info.FrostFS.sdk.tools.Verifier; import info.frostfs.sdk.tools.Verifier;
import info.frostfs.sdk.tools.RequestConstructor;
import info.frostfs.sdk.tools.RequestSigner;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static info.FrostFS.sdk.tools.RequestConstructor.addMetaHeader; import static info.frostfs.sdk.tools.RequestConstructor.addMetaHeader;
import static info.FrostFS.sdk.tools.RequestSigner.sign; import static info.frostfs.sdk.tools.RequestSigner.signRFC6979;
import static info.FrostFS.sdk.tools.RequestSigner.signRFC6979;
public class ContainerService extends ContextAccessor implements ContainerClient { public class ContainerService extends ContextAccessor implements ContainerClient {
private final ContainerServiceGrpc.ContainerServiceBlockingStub serviceBlockingStub; private final ContainerServiceGrpc.ContainerServiceBlockingStub serviceBlockingStub;
@ -36,8 +37,8 @@ public class ContainerService extends ContextAccessor implements ContainerClient
.build() .build()
); );
addMetaHeader(request); RequestConstructor.addMetaHeader(request);
sign(request, getContext().getKey()); RequestSigner.sign(request, getContext().getKey());
var response = serviceBlockingStub.get(request.build()); var response = serviceBlockingStub.get(request.build());
@ -53,8 +54,8 @@ public class ContainerService extends ContextAccessor implements ContainerClient
.build() .build()
); );
addMetaHeader(request); RequestConstructor.addMetaHeader(request);
sign(request, getContext().getKey()); RequestSigner.sign(request, getContext().getKey());
var response = serviceBlockingStub.list(request.build()); var response = serviceBlockingStub.list(request.build());
@ -78,13 +79,13 @@ public class ContainerService extends ContextAccessor implements ContainerClient
Service.PutRequest.Body.newBuilder() Service.PutRequest.Body.newBuilder()
.setContainer(grpcContainer) .setContainer(grpcContainer)
.setSignature( .setSignature(
signRFC6979(getContext().getKey(), grpcContainer) RequestSigner.signRFC6979(getContext().getKey(), grpcContainer)
) )
.build() .build()
); );
addMetaHeader(request); RequestConstructor.addMetaHeader(request);
sign(request, getContext().getKey()); RequestSigner.sign(request, getContext().getKey());
var response = serviceBlockingStub.put(request.build()); var response = serviceBlockingStub.put(request.build());
@ -99,14 +100,14 @@ public class ContainerService extends ContextAccessor implements ContainerClient
.setBody( .setBody(
Service.DeleteRequest.Body.newBuilder() Service.DeleteRequest.Body.newBuilder()
.setContainerId(grpcContainerId) .setContainerId(grpcContainerId)
.setSignature(signRFC6979( .setSignature(RequestSigner.signRFC6979(
getContext().getKey(), grpcContainerId.getValue() getContext().getKey(), grpcContainerId.getValue()
)) ))
.build() .build()
); );
addMetaHeader(request); RequestConstructor.addMetaHeader(request);
sign(request, getContext().getKey()); RequestSigner.sign(request, getContext().getKey());
var response = serviceBlockingStub.delete(request.build()); var response = serviceBlockingStub.delete(request.build());

View file

@ -1,22 +1,22 @@
package info.FrostFS.sdk.services.impl; package info.frostfs.sdk.services.impl;
import frostFS.netmap.NetmapServiceGrpc; import frostfs.netmap.NetmapServiceGrpc;
import frostFS.netmap.Service; import frostfs.netmap.Service;
import frostFS.netmap.Types; import frostfs.netmap.Types;
import info.FrostFS.sdk.dto.netmap.NetmapSnapshot; import info.frostfs.sdk.dto.netmap.NetmapSnapshot;
import info.FrostFS.sdk.dto.netmap.NodeInfo; import info.frostfs.sdk.dto.netmap.NodeInfo;
import info.FrostFS.sdk.jdo.ClientEnvironment; import info.frostfs.sdk.jdo.ClientEnvironment;
import info.FrostFS.sdk.jdo.NetworkSettings; import info.frostfs.sdk.jdo.NetworkSettings;
import info.FrostFS.sdk.mappers.netmap.NetmapSnapshotMapper; import info.frostfs.sdk.mappers.netmap.NetmapSnapshotMapper;
import info.FrostFS.sdk.mappers.netmap.NodeInfoMapper; import info.frostfs.sdk.mappers.netmap.NodeInfoMapper;
import info.FrostFS.sdk.services.ContextAccessor; import info.frostfs.sdk.services.ContextAccessor;
import info.FrostFS.sdk.services.NetmapClient; import info.frostfs.sdk.services.NetmapClient;
import info.FrostFS.sdk.tools.Verifier; import info.frostfs.sdk.tools.Verifier;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import static info.FrostFS.sdk.tools.RequestConstructor.addMetaHeader; import static info.frostfs.sdk.tools.RequestConstructor.addMetaHeader;
import static info.FrostFS.sdk.tools.RequestSigner.sign; import static info.frostfs.sdk.tools.RequestSigner.sign;
import static java.util.Objects.nonNull; import static java.util.Objects.nonNull;
public class NetmapService extends ContextAccessor implements NetmapClient { public class NetmapService extends ContextAccessor implements NetmapClient {

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.services.impl; package info.frostfs.sdk.services.impl;
import frostFS.object.Service; import frostfs.object.Service;
import frostFS.object.Types; import frostfs.object.Types;
import info.FrostFS.sdk.tools.Verifier; import info.frostfs.sdk.tools.Verifier;
import java.util.Iterator; import java.util.Iterator;

View file

@ -1,26 +1,26 @@
package info.FrostFS.sdk.services.impl; package info.frostfs.sdk.services.impl;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import frostFS.object.ObjectServiceGrpc; import frostfs.object.ObjectServiceGrpc;
import frostFS.object.Service; import frostfs.object.Service;
import frostFS.refs.Types; import frostfs.refs.Types;
import info.FrostFS.sdk.constants.AppConst; import info.frostfs.sdk.constants.AppConst;
import info.FrostFS.sdk.dto.Split; import info.frostfs.sdk.dto.Split;
import info.FrostFS.sdk.dto.container.ContainerId; import info.frostfs.sdk.dto.container.ContainerId;
import info.FrostFS.sdk.dto.object.*; import info.frostfs.sdk.dto.object.*;
import info.FrostFS.sdk.jdo.ClientEnvironment; import info.frostfs.sdk.jdo.ClientEnvironment;
import info.FrostFS.sdk.jdo.PutObjectParameters; import info.frostfs.sdk.jdo.PutObjectParameters;
import info.FrostFS.sdk.mappers.OwnerIdMapper; import info.frostfs.sdk.mappers.OwnerIdMapper;
import info.FrostFS.sdk.mappers.VersionMapper; import info.frostfs.sdk.mappers.VersionMapper;
import info.FrostFS.sdk.mappers.container.ContainerIdMapper; import info.frostfs.sdk.mappers.container.ContainerIdMapper;
import info.FrostFS.sdk.mappers.object.ObjectFilterMapper; import info.frostfs.sdk.mappers.object.ObjectFilterMapper;
import info.FrostFS.sdk.mappers.object.ObjectFrostFSMapper; import info.frostfs.sdk.mappers.object.ObjectFrostFSMapper;
import info.FrostFS.sdk.mappers.object.ObjectHeaderMapper; import info.frostfs.sdk.mappers.object.ObjectHeaderMapper;
import info.FrostFS.sdk.mappers.object.ObjectIdMapper; import info.frostfs.sdk.mappers.object.ObjectIdMapper;
import info.FrostFS.sdk.services.ContextAccessor; import info.frostfs.sdk.services.ContextAccessor;
import info.FrostFS.sdk.services.ObjectClient; import info.frostfs.sdk.services.ObjectClient;
import info.FrostFS.sdk.tools.Verifier; import info.frostfs.sdk.tools.Verifier;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import java.io.FileInputStream; import java.io.FileInputStream;
@ -29,10 +29,10 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import static info.FrostFS.sdk.Helper.getSha256; import static info.frostfs.sdk.Helper.getSha256;
import static info.FrostFS.sdk.tools.RequestConstructor.addMetaHeader; import static info.frostfs.sdk.tools.RequestConstructor.addMetaHeader;
import static info.FrostFS.sdk.tools.RequestConstructor.addObjectSessionToken; import static info.frostfs.sdk.tools.RequestConstructor.addObjectSessionToken;
import static info.FrostFS.sdk.tools.RequestSigner.sign; import static info.frostfs.sdk.tools.RequestSigner.sign;
import static java.util.Objects.nonNull; import static java.util.Objects.nonNull;
public class ObjectService extends ContextAccessor implements ObjectClient { public class ObjectService extends ContextAccessor implements ObjectClient {
@ -90,7 +90,7 @@ public class ObjectService extends ContextAccessor implements ObjectClient {
addMetaHeader(request); addMetaHeader(request);
addObjectSessionToken( addObjectSessionToken(
request, sessionToken, ContainerIdMapper.toGrpcMessage(cid), ObjectIdMapper.toGrpcMessage(oid), request, sessionToken, ContainerIdMapper.toGrpcMessage(cid), ObjectIdMapper.toGrpcMessage(oid),
frostFS.session.Types.ObjectSessionContext.Verb.GET, getContext().getKey() frostfs.session.Types.ObjectSessionContext.Verb.GET, getContext().getKey()
); );
sign(request, getContext().getKey()); sign(request, getContext().getKey());
@ -159,7 +159,7 @@ public class ObjectService extends ContextAccessor implements ObjectClient {
addMetaHeader(request); addMetaHeader(request);
addObjectSessionToken( addObjectSessionToken(
request, sessionToken, grpcObject.getHeader().getContainerId(), grpcObject.getObjectId(), request, sessionToken, grpcObject.getHeader().getContainerId(), grpcObject.getObjectId(),
frostFS.session.Types.ObjectSessionContext.Verb.PUT, getContext().getKey() frostfs.session.Types.ObjectSessionContext.Verb.PUT, getContext().getKey()
); );
sign(request, getContext().getKey()); sign(request, getContext().getKey());
@ -170,7 +170,7 @@ public class ObjectService extends ContextAccessor implements ObjectClient {
return ObjectId.fromHash(grpcObject.getObjectId().getValue().toByteArray()); return ObjectId.fromHash(grpcObject.getObjectId().getValue().toByteArray());
} }
private frostFS.object.Types.Object getObject(Service.GetRequest request) { private frostfs.object.Types.Object getObject(Service.GetRequest request) {
var iterator = getObjectInit(request); var iterator = getObjectInit(request);
var obj = iterator.readHeader(); var obj = iterator.readHeader();
var payload = new byte[Math.toIntExact(obj.getHeader().getPayloadLength())]; var payload = new byte[Math.toIntExact(obj.getHeader().getPayloadLength())];
@ -218,7 +218,7 @@ public class ObjectService extends ContextAccessor implements ObjectClient {
addMetaHeader(initRequest); addMetaHeader(initRequest);
addObjectSessionToken( addObjectSessionToken(
initRequest, sessionToken, hdr.getContainerId(), oid, initRequest, sessionToken, hdr.getContainerId(), oid,
frostFS.session.Types.ObjectSessionContext.Verb.PUT, getContext().getKey() frostfs.session.Types.ObjectSessionContext.Verb.PUT, getContext().getKey()
); );
sign(initRequest, getContext().getKey()); sign(initRequest, getContext().getKey());

View file

@ -1,21 +1,21 @@
package info.FrostFS.sdk.services.impl; package info.frostfs.sdk.services.impl;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import frostFS.object.Types; import frostfs.object.Types;
import info.FrostFS.sdk.dto.object.ObjectFrostFS; import info.frostfs.sdk.dto.object.ObjectFrostFS;
import info.FrostFS.sdk.dto.object.ObjectHeader; import info.frostfs.sdk.dto.object.ObjectHeader;
import info.FrostFS.sdk.dto.object.ObjectId; import info.frostfs.sdk.dto.object.ObjectId;
import info.FrostFS.sdk.jdo.ClientEnvironment; import info.frostfs.sdk.jdo.ClientEnvironment;
import info.FrostFS.sdk.mappers.OwnerIdMapper; import info.frostfs.sdk.mappers.OwnerIdMapper;
import info.FrostFS.sdk.mappers.VersionMapper; import info.frostfs.sdk.mappers.VersionMapper;
import info.FrostFS.sdk.mappers.object.ObjectHeaderMapper; import info.frostfs.sdk.mappers.object.ObjectHeaderMapper;
import info.FrostFS.sdk.mappers.object.ObjectIdMapper; import info.frostfs.sdk.mappers.object.ObjectIdMapper;
import info.FrostFS.sdk.services.ContextAccessor; import info.frostfs.sdk.services.ContextAccessor;
import info.FrostFS.sdk.services.ToolsClient; import info.frostfs.sdk.services.ToolsClient;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import static info.FrostFS.sdk.Helper.getSha256; import static info.frostfs.sdk.Helper.getSha256;
import static info.FrostFS.sdk.tools.RequestSigner.signData; import static info.frostfs.sdk.tools.RequestSigner.signData;
import static java.util.Objects.nonNull; import static java.util.Objects.nonNull;
public class ObjectTools extends ContextAccessor implements ToolsClient { public class ObjectTools extends ContextAccessor implements ToolsClient {
@ -23,9 +23,9 @@ public class ObjectTools extends ContextAccessor implements ToolsClient {
super(context); super(context);
} }
private static frostFS.refs.Types.Checksum sha256Checksum(byte[] data) { private static frostfs.refs.Types.Checksum sha256Checksum(byte[] data) {
return frostFS.refs.Types.Checksum.newBuilder() return frostfs.refs.Types.Checksum.newBuilder()
.setType(frostFS.refs.Types.ChecksumType.SHA256) .setType(frostfs.refs.Types.ChecksumType.SHA256)
.setSum(ByteString.copyFrom(getSha256(data))) .setSum(ByteString.copyFrom(getSha256(data)))
.build(); .build();
} }
@ -35,7 +35,7 @@ public class ObjectTools extends ContextAccessor implements ToolsClient {
var grpcHeader = createHeader(header, new byte[]{}); var grpcHeader = createHeader(header, new byte[]{});
return ObjectIdMapper.toModel( return ObjectIdMapper.toModel(
frostFS.refs.Types.ObjectID.newBuilder().setValue(getSha256(grpcHeader)).build() frostfs.refs.Types.ObjectID.newBuilder().setValue(getSha256(grpcHeader)).build()
); );
} }
@ -58,13 +58,13 @@ public class ObjectTools extends ContextAccessor implements ToolsClient {
if (nonNull(split.getParentHeader())) { if (nonNull(split.getParentHeader())) {
var grpcParentHeader = createHeader(split.getParentHeader(), new byte[]{}); var grpcParentHeader = createHeader(split.getParentHeader(), new byte[]{});
var parent = frostFS.refs.Types.ObjectID.newBuilder().setValue(getSha256(grpcParentHeader)).build(); var parent = frostfs.refs.Types.ObjectID.newBuilder().setValue(getSha256(grpcParentHeader)).build();
splitGrpc splitGrpc
.setParent(parent) .setParent(parent)
.setParentHeader(grpcParentHeader) .setParentHeader(grpcParentHeader)
.setParentSignature( .setParentSignature(
frostFS.refs.Types.Signature.newBuilder() frostfs.refs.Types.Signature.newBuilder()
.setKey(ByteString.copyFrom(getContext().getKey().getPublicKeyByte())) .setKey(ByteString.copyFrom(getContext().getKey().getPublicKeyByte()))
.setSign(ByteString.copyFrom(signData(getContext().getKey(), parent.toByteArray()))) .setSign(ByteString.copyFrom(signData(getContext().getKey(), parent.toByteArray())))
); );
@ -78,13 +78,13 @@ public class ObjectTools extends ContextAccessor implements ToolsClient {
} }
var grpcHeader = grpcHeaderBuilder.build(); var grpcHeader = grpcHeaderBuilder.build();
var objectId = frostFS.refs.Types.ObjectID.newBuilder().setValue(getSha256(grpcHeader)).build(); var objectId = frostfs.refs.Types.ObjectID.newBuilder().setValue(getSha256(grpcHeader)).build();
return Types.Object.newBuilder() return Types.Object.newBuilder()
.setHeader(grpcHeader) .setHeader(grpcHeader)
.setObjectId(objectId) .setObjectId(objectId)
.setPayload(ByteString.copyFrom(objectFrostFs.getPayload())) .setPayload(ByteString.copyFrom(objectFrostFs.getPayload()))
.setSignature( .setSignature(
frostFS.refs.Types.Signature.newBuilder() frostfs.refs.Types.Signature.newBuilder()
.setKey(ByteString.copyFrom(getContext().getKey().getPublicKeyByte())) .setKey(ByteString.copyFrom(getContext().getKey().getPublicKeyByte()))
.setSign(ByteString.copyFrom(signData(getContext().getKey(), objectId.toByteArray()))) .setSign(ByteString.copyFrom(signData(getContext().getKey(), objectId.toByteArray())))
) )

View file

@ -1,7 +1,7 @@
package info.FrostFS.sdk.services.impl; package info.frostfs.sdk.services.impl;
import frostFS.object.ObjectServiceGrpc; import frostfs.object.ObjectServiceGrpc;
import frostFS.object.Service; import frostfs.object.Service;
import io.grpc.stub.StreamObserver; import io.grpc.stub.StreamObserver;
import static java.util.Objects.isNull; import static java.util.Objects.isNull;

View file

@ -1,7 +1,7 @@
package info.FrostFS.sdk.services.impl; package info.frostfs.sdk.services.impl;
import frostFS.object.Service; import frostfs.object.Service;
import info.FrostFS.sdk.tools.Verifier; import info.frostfs.sdk.tools.Verifier;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -13,7 +13,7 @@ public class SearchReader {
this.call = call; this.call = call;
} }
public List<frostFS.refs.Types.ObjectID> read() { public List<frostfs.refs.Types.ObjectID> read() {
if (!call.hasNext()) { if (!call.hasNext()) {
return null; return null;
} }

View file

@ -1,17 +1,18 @@
package info.FrostFS.sdk.services.impl; package info.frostfs.sdk.services.impl;
import frostFS.session.Service; import frostfs.session.Service;
import frostFS.session.SessionServiceGrpc; import frostfs.session.SessionServiceGrpc;
import frostFS.session.Types; import frostfs.session.Types;
import info.FrostFS.sdk.dto.SessionToken; import info.frostfs.sdk.dto.SessionToken;
import info.FrostFS.sdk.jdo.ClientEnvironment; import info.frostfs.sdk.jdo.ClientEnvironment;
import info.FrostFS.sdk.mappers.OwnerIdMapper; import info.frostfs.sdk.mappers.OwnerIdMapper;
import info.FrostFS.sdk.mappers.SessionMapper; import info.frostfs.sdk.mappers.SessionMapper;
import info.FrostFS.sdk.services.ContextAccessor; import info.frostfs.sdk.services.ContextAccessor;
import info.FrostFS.sdk.services.SessionClient; import info.frostfs.sdk.services.SessionClient;
import info.frostfs.sdk.tools.RequestConstructor;
import static info.FrostFS.sdk.tools.RequestConstructor.addMetaHeader; import static info.frostfs.sdk.tools.RequestConstructor.addMetaHeader;
import static info.FrostFS.sdk.tools.RequestSigner.sign; import static info.frostfs.sdk.tools.RequestSigner.sign;
public class SessionService extends ContextAccessor implements SessionClient { public class SessionService extends ContextAccessor implements SessionClient {
private final SessionServiceGrpc.SessionServiceBlockingStub serviceBlockingStub; private final SessionServiceGrpc.SessionServiceBlockingStub serviceBlockingStub;
@ -36,7 +37,7 @@ public class SessionService extends ContextAccessor implements SessionClient {
.setExpiration(expiration).build() .setExpiration(expiration).build()
); );
addMetaHeader(request); RequestConstructor.addMetaHeader(request);
sign(request, getContext().getKey()); sign(request, getContext().getKey());
return createSession(request.build()); return createSession(request.build());

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.tools; package info.frostfs.sdk.tools;
import io.grpc.Channel; import io.grpc.Channel;
import io.grpc.ChannelCredentials; import io.grpc.ChannelCredentials;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.tools; package info.frostfs.sdk.tools;
import com.google.protobuf.Message; import com.google.protobuf.Message;
import com.google.protobuf.MessageOrBuilder; import com.google.protobuf.MessageOrBuilder;

View file

@ -1,15 +1,15 @@
package info.FrostFS.sdk.tools; package info.frostfs.sdk.tools;
import com.google.protobuf.Message; import com.google.protobuf.Message;
import frostFS.session.Types; import frostfs.session.Types;
import info.FrostFS.sdk.dto.MetaHeader; import info.frostfs.sdk.dto.MetaHeader;
import info.FrostFS.sdk.jdo.ECDsa; import info.frostfs.sdk.jdo.ECDsa;
import info.FrostFS.sdk.mappers.MetaHeaderMapper; import info.frostfs.sdk.mappers.MetaHeaderMapper;
import static info.FrostFS.sdk.constants.FieldConst.META_HEADER_FIELD_NAME; import static info.frostfs.sdk.constants.FieldConst.META_HEADER_FIELD_NAME;
import static info.FrostFS.sdk.tools.MessageHelper.getField; import static info.frostfs.sdk.tools.MessageHelper.getField;
import static info.FrostFS.sdk.tools.MessageHelper.setField; import static info.frostfs.sdk.tools.MessageHelper.setField;
import static info.FrostFS.sdk.tools.RequestSigner.signMessagePart; import static info.frostfs.sdk.tools.RequestSigner.signMessagePart;
import static java.util.Objects.isNull; import static java.util.Objects.isNull;
public class RequestConstructor { public class RequestConstructor {
@ -27,8 +27,8 @@ public class RequestConstructor {
public static void addObjectSessionToken(Message.Builder request, public static void addObjectSessionToken(Message.Builder request,
Types.SessionToken sessionToken, Types.SessionToken sessionToken,
frostFS.refs.Types.ContainerID cid, frostfs.refs.Types.ContainerID cid,
frostFS.refs.Types.ObjectID oid, frostfs.refs.Types.ObjectID oid,
Types.ObjectSessionContext.Verb verb, Types.ObjectSessionContext.Verb verb,
ECDsa key) { ECDsa key) {
var header = (Types.RequestMetaHeader) getField(request, META_HEADER_FIELD_NAME); var header = (Types.RequestMetaHeader) getField(request, META_HEADER_FIELD_NAME);

View file

@ -1,9 +1,10 @@
package info.FrostFS.sdk.tools; package info.frostfs.sdk.tools;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import com.google.protobuf.Message; import com.google.protobuf.Message;
import frostFS.session.Types; import frostfs.session.Types;
import info.FrostFS.sdk.jdo.ECDsa; import info.frostfs.sdk.jdo.ECDsa;
import info.frostfs.sdk.constants.CryptoConst;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.bouncycastle.asn1.sec.SECNamedCurves; import org.bouncycastle.asn1.sec.SECNamedCurves;
import org.bouncycastle.asn1.sec.SECObjectIdentifiers; import org.bouncycastle.asn1.sec.SECObjectIdentifiers;
@ -15,10 +16,7 @@ import org.bouncycastle.crypto.signers.HMacDSAKCalculator;
import java.math.BigInteger; import java.math.BigInteger;
import java.security.Signature; import java.security.Signature;
import static info.FrostFS.sdk.constants.CryptoConst.SIGNATURE_ALGORITHM; import static info.frostfs.sdk.constants.FieldConst.*;
import static info.FrostFS.sdk.constants.FieldConst.*;
import static info.FrostFS.sdk.tools.MessageHelper.getField;
import static info.FrostFS.sdk.tools.MessageHelper.setField;
import static org.bouncycastle.crypto.util.DigestFactory.createSHA256; import static org.bouncycastle.crypto.util.DigestFactory.createSHA256;
import static org.bouncycastle.util.BigIntegers.asUnsignedByteArray; import static org.bouncycastle.util.BigIntegers.asUnsignedByteArray;
@ -30,7 +28,7 @@ public class RequestSigner {
var hash = new byte[65]; var hash = new byte[65];
hash[0] = 0x04; hash[0] = 0x04;
try { try {
Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); Signature signature = Signature.getInstance(CryptoConst.SIGNATURE_ALGORITHM);
signature.initSign(key.getPrivateKey()); signature.initSign(key.getPrivateKey());
signature.update(DigestUtils.sha512(data)); signature.update(DigestUtils.sha512(data));
byte[] sig = signature.sign(); byte[] sig = signature.sign();
@ -67,33 +65,33 @@ public class RequestSigner {
return signature; return signature;
} }
public static frostFS.refs.Types.SignatureRFC6979 signRFC6979(ECDsa key, Message message) { public static frostfs.refs.Types.SignatureRFC6979 signRFC6979(ECDsa key, Message message) {
return frostFS.refs.Types.SignatureRFC6979.newBuilder() return frostfs.refs.Types.SignatureRFC6979.newBuilder()
.setKey(ByteString.copyFrom(key.getPublicKeyByte())) .setKey(ByteString.copyFrom(key.getPublicKeyByte()))
.setSign(ByteString.copyFrom(signRFC6979(key, message.toByteArray()))) .setSign(ByteString.copyFrom(signRFC6979(key, message.toByteArray())))
.build(); .build();
} }
public static frostFS.refs.Types.SignatureRFC6979 signRFC6979(ECDsa key, ByteString data) { public static frostfs.refs.Types.SignatureRFC6979 signRFC6979(ECDsa key, ByteString data) {
return frostFS.refs.Types.SignatureRFC6979.newBuilder() return frostfs.refs.Types.SignatureRFC6979.newBuilder()
.setKey(ByteString.copyFrom(key.getPublicKeyByte())) .setKey(ByteString.copyFrom(key.getPublicKeyByte()))
.setSign(ByteString.copyFrom(signRFC6979(key, data.toByteArray()))) .setSign(ByteString.copyFrom(signRFC6979(key, data.toByteArray())))
.build(); .build();
} }
public static frostFS.refs.Types.Signature signMessagePart(ECDsa key, Message data) { public static frostfs.refs.Types.Signature signMessagePart(ECDsa key, Message data) {
var data2Sign = data.getSerializedSize() == 0 ? new byte[]{} : data.toByteArray(); var data2Sign = data.getSerializedSize() == 0 ? new byte[]{} : data.toByteArray();
return frostFS.refs.Types.Signature.newBuilder() return frostfs.refs.Types.Signature.newBuilder()
.setKey(ByteString.copyFrom(key.getPublicKeyByte())) .setKey(ByteString.copyFrom(key.getPublicKeyByte()))
.setSign(ByteString.copyFrom(signData(key, data2Sign))) .setSign(ByteString.copyFrom(signData(key, data2Sign)))
.build(); .build();
} }
public static void sign(Message.Builder request, ECDsa key) { public static void sign(Message.Builder request, ECDsa key) {
var meta = getField(request, META_HEADER_FIELD_NAME); var meta = MessageHelper.getField(request, META_HEADER_FIELD_NAME);
var body = getField(request, BODY_FIELD_NAME); var body = MessageHelper.getField(request, BODY_FIELD_NAME);
var verify = getField(request, VERIFY_HEADER_FIELD_NAME); var verify = MessageHelper.getField(request, VERIFY_HEADER_FIELD_NAME);
var verifyOrigin = getField(verify, ORIGIN_FIELD_NAME); var verifyOrigin = MessageHelper.getField(verify, ORIGIN_FIELD_NAME);
Message.Builder verifyBuilder; Message.Builder verifyBuilder;
if (verify instanceof Types.RequestVerificationHeader) { if (verify instanceof Types.RequestVerificationHeader) {
@ -107,14 +105,14 @@ public class RequestSigner {
} }
if (verifyOrigin.getSerializedSize() == 0) { if (verifyOrigin.getSerializedSize() == 0) {
setField(verifyBuilder, BODY_SIGNATURE_FIELD_NAME, signMessagePart(key, body)); MessageHelper.setField(verifyBuilder, BODY_SIGNATURE_FIELD_NAME, signMessagePart(key, body));
} else { } else {
setField(verifyBuilder, ORIGIN_FIELD_NAME, verifyOrigin); MessageHelper.setField(verifyBuilder, ORIGIN_FIELD_NAME, verifyOrigin);
} }
setField(verifyBuilder, META_SIGNATURE_FIELD_NAME, signMessagePart(key, meta)); MessageHelper.setField(verifyBuilder, META_SIGNATURE_FIELD_NAME, signMessagePart(key, meta));
setField(verifyBuilder, ORIGIN_SIGNATURE_FIELD_NAME, signMessagePart(key, verifyOrigin)); MessageHelper.setField(verifyBuilder, ORIGIN_SIGNATURE_FIELD_NAME, signMessagePart(key, verifyOrigin));
setField(request, VERIFY_HEADER_FIELD_NAME, verifyBuilder.build()); MessageHelper.setField(request, VERIFY_HEADER_FIELD_NAME, verifyBuilder.build());
} }
} }

View file

@ -1,8 +1,9 @@
package info.FrostFS.sdk.tools; package info.frostfs.sdk.tools;
import com.google.protobuf.Message; import com.google.protobuf.Message;
import frostFS.session.Types; import frostfs.session.Types;
import info.FrostFS.sdk.mappers.StatusMapper; import info.frostfs.sdk.mappers.StatusMapper;
import info.frostfs.sdk.constants.CryptoConst;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.bouncycastle.asn1.sec.SECNamedCurves; import org.bouncycastle.asn1.sec.SECNamedCurves;
import org.bouncycastle.asn1.sec.SECObjectIdentifiers; import org.bouncycastle.asn1.sec.SECObjectIdentifiers;
@ -16,10 +17,8 @@ import java.security.PublicKey;
import java.security.Signature; import java.security.Signature;
import java.util.Arrays; import java.util.Arrays;
import static info.FrostFS.sdk.KeyExtension.getPublicKeyFromBytes; import static info.frostfs.sdk.KeyExtension.getPublicKeyFromBytes;
import static info.FrostFS.sdk.constants.CryptoConst.SIGNATURE_ALGORITHM; import static info.frostfs.sdk.constants.FieldConst.*;
import static info.FrostFS.sdk.constants.FieldConst.*;
import static info.FrostFS.sdk.tools.MessageHelper.getField;
import static java.util.Objects.isNull; import static java.util.Objects.isNull;
import static org.bouncycastle.crypto.util.DigestFactory.createSHA256; import static org.bouncycastle.crypto.util.DigestFactory.createSHA256;
import static org.bouncycastle.util.BigIntegers.fromUnsignedByteArray; import static org.bouncycastle.util.BigIntegers.fromUnsignedByteArray;
@ -29,7 +28,7 @@ public class Verifier {
public static final String ERROR_INVALID_RESPONSE = "Invalid response"; public static final String ERROR_INVALID_RESPONSE = "Invalid response";
public static final int RFC6979_SIG_SIZE = 64; public static final int RFC6979_SIG_SIZE = 64;
public static boolean verifyRFC6979(frostFS.refs.Types.SignatureRFC6979 signature, Message data) { public static boolean verifyRFC6979(frostfs.refs.Types.SignatureRFC6979 signature, Message data) {
return verifyRFC6979(signature.getKey().toByteArray(), data.toByteArray(), signature.getSign().toByteArray()); return verifyRFC6979(signature.getKey().toByteArray(), data.toByteArray(), signature.getSign().toByteArray());
} }
@ -68,7 +67,7 @@ public class Verifier {
throw new IllegalArgumentException(ERROR_INVALID_RESPONSE); throw new IllegalArgumentException(ERROR_INVALID_RESPONSE);
} }
var metaHeader = (Types.ResponseMetaHeader) getField(response, META_HEADER_FIELD_NAME); var metaHeader = (Types.ResponseMetaHeader) MessageHelper.getField(response, META_HEADER_FIELD_NAME);
var status = StatusMapper.toModel(metaHeader.getStatus()); var status = StatusMapper.toModel(metaHeader.getStatus());
if (!status.isSuccess()) { if (!status.isSuccess()) {
throw new IllegalArgumentException(status.toString()); throw new IllegalArgumentException(status.toString());
@ -76,16 +75,16 @@ public class Verifier {
} }
public static boolean verify(Message response) { public static boolean verify(Message response) {
var body = getField(response, BODY_FIELD_NAME); var body = MessageHelper.getField(response, BODY_FIELD_NAME);
var metaHeader = (Types.ResponseMetaHeader) getField(response, META_HEADER_FIELD_NAME); var metaHeader = (Types.ResponseMetaHeader) MessageHelper.getField(response, META_HEADER_FIELD_NAME);
var verifyHeader = (Types.ResponseVerificationHeader) getField(response, VERIFY_HEADER_FIELD_NAME); var verifyHeader = (Types.ResponseVerificationHeader) MessageHelper.getField(response, VERIFY_HEADER_FIELD_NAME);
return verifyMatryoshkaLevel(body, metaHeader, verifyHeader); return verifyMatryoshkaLevel(body, metaHeader, verifyHeader);
} }
public static boolean verifyMatryoshkaLevel(Message data, public static boolean verifyMatryoshkaLevel(Message data,
frostFS.session.Types.ResponseMetaHeader meta, frostfs.session.Types.ResponseMetaHeader meta,
frostFS.session.Types.ResponseVerificationHeader verification) { frostfs.session.Types.ResponseVerificationHeader verification) {
if (!verifyMessagePart(verification.getMetaSignature(), meta)) return false; if (!verifyMessagePart(verification.getMetaSignature(), meta)) return false;
var origin = verification.getOrigin(); var origin = verification.getOrigin();
if (!verifyMessagePart(verification.getOriginSignature(), origin)) return false; if (!verifyMessagePart(verification.getOriginSignature(), origin)) return false;
@ -96,7 +95,7 @@ public class Verifier {
&& verifyMatryoshkaLevel(data, meta.getOrigin(), origin); && verifyMatryoshkaLevel(data, meta.getOrigin(), origin);
} }
public static boolean verifyMessagePart(frostFS.refs.Types.Signature sig, Message data) { public static boolean verifyMessagePart(frostfs.refs.Types.Signature sig, Message data) {
if (sig.getSerializedSize() == 0 || sig.getKey().isEmpty() || sig.getSign().isEmpty()) return false; if (sig.getSerializedSize() == 0 || sig.getKey().isEmpty() || sig.getSign().isEmpty()) return false;
var publicKey = getPublicKeyFromBytes(sig.getKey().toByteArray()); var publicKey = getPublicKeyFromBytes(sig.getKey().toByteArray());
@ -107,7 +106,7 @@ public class Verifier {
public static boolean verifyData(PublicKey publicKey, byte[] data, byte[] sig) { public static boolean verifyData(PublicKey publicKey, byte[] data, byte[] sig) {
try { try {
Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); Signature signature = Signature.getInstance(CryptoConst.SIGNATURE_ALGORITHM);
signature.initVerify(publicKey); signature.initVerify(publicKey);
signature.update(DigestUtils.sha512(data)); signature.update(DigestUtils.sha512(data));
return signature.verify(Arrays.copyOfRange(sig, 1, sig.length)); return signature.verify(Arrays.copyOfRange(sig, 1, sig.length));

View file

@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>info.FrostFS.sdk</groupId> <groupId>info.frostfs.sdk</groupId>
<artifactId>FrostFS-sdk-java</artifactId> <artifactId>frostfs-sdk-java</artifactId>
<version>0.1.0</version> <version>0.1.0</version>
</parent> </parent>

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk; package info.frostfs.sdk;
public class ArrayHelper { public class ArrayHelper {

View file

@ -1,9 +1,9 @@
package info.FrostFS.sdk; package info.frostfs.sdk;
import java.util.Arrays; import java.util.Arrays;
import static info.FrostFS.sdk.ArrayHelper.concat; import static info.frostfs.sdk.ArrayHelper.concat;
import static info.FrostFS.sdk.Helper.getSha256; import static info.frostfs.sdk.Helper.getSha256;
import static java.util.Objects.isNull; import static java.util.Objects.isNull;
public class Base58 { public class Base58 {

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk; package info.frostfs.sdk;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import com.google.protobuf.Message; import com.google.protobuf.Message;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk; package info.frostfs.sdk;
import org.bouncycastle.asn1.sec.SECNamedCurves; import org.bouncycastle.asn1.sec.SECNamedCurves;
import org.bouncycastle.asn1.sec.SECObjectIdentifiers; import org.bouncycastle.asn1.sec.SECObjectIdentifiers;
@ -23,8 +23,8 @@ import java.security.spec.ECPublicKeySpec;
import java.security.spec.InvalidKeySpecException; import java.security.spec.InvalidKeySpecException;
import java.util.Arrays; import java.util.Arrays;
import static info.FrostFS.sdk.Helper.getRIPEMD160; import static info.frostfs.sdk.Helper.getRIPEMD160;
import static info.FrostFS.sdk.Helper.getSha256; import static info.frostfs.sdk.Helper.getSha256;
import static org.bouncycastle.util.BigIntegers.fromUnsignedByteArray; import static org.bouncycastle.util.BigIntegers.fromUnsignedByteArray;
public class KeyExtension { public class KeyExtension {

View file

@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>info.FrostFS.sdk</groupId> <groupId>info.frostfs.sdk</groupId>
<artifactId>FrostFS-sdk-java</artifactId> <artifactId>frostfs-sdk-java</artifactId>
<version>0.1.0</version> <version>0.1.0</version>
</parent> </parent>
@ -24,12 +24,12 @@
<version>3.14.0</version> <version>3.14.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>info.FrostFS.sdk</groupId> <groupId>info.frostfs.sdk</groupId>
<artifactId>cryptography</artifactId> <artifactId>cryptography</artifactId>
<version>0.1.0</version> <version>0.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>info.FrostFS.sdk</groupId> <groupId>info.frostfs.sdk</groupId>
<artifactId>protos</artifactId> <artifactId>protos</artifactId>
<version>0.1.0</version> <version>0.1.0</version>
</dependency> </dependency>

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk; package info.frostfs.sdk;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.UUID; import java.util.UUID;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.constants; package info.frostfs.sdk.constants;
public class AppConst { public class AppConst {
public static final int OBJECT_CHUNK_SIZE = 3 * (1 << 20); public static final int OBJECT_CHUNK_SIZE = 3 * (1 << 20);

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.constants; package info.frostfs.sdk.constants;
public class FieldConst { public class FieldConst {
public static final String META_HEADER_FIELD_NAME = "meta_header"; public static final String META_HEADER_FIELD_NAME = "meta_header";

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.constants; package info.frostfs.sdk.constants;
public class XHeaderConst { public class XHeaderConst {
public static final String RESERVED_XHEADER_PREFIX = "__SYSTEM__"; public static final String RESERVED_XHEADER_PREFIX = "__SYSTEM__";

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.dto; package info.frostfs.sdk.dto;
public class MetaHeader { public class MetaHeader {
private Version version; private Version version;

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.dto; package info.frostfs.sdk.dto;
import info.FrostFS.sdk.Base58; import info.frostfs.sdk.Base58;
import static info.FrostFS.sdk.KeyExtension.publicKeyToAddress; import static info.frostfs.sdk.KeyExtension.publicKeyToAddress;
public class OwnerId { public class OwnerId {
private final String value; private final String value;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.dto; package info.frostfs.sdk.dto;
public class SessionToken { public class SessionToken {
private final byte[] id; private final byte[] id;

View file

@ -1,6 +1,6 @@
package info.FrostFS.sdk.dto; package info.frostfs.sdk.dto;
import info.FrostFS.sdk.enums.SignatureScheme; import info.frostfs.sdk.enums.SignatureScheme;
public class Signature { public class Signature {
private byte[] key; private byte[] key;

View file

@ -1,7 +1,7 @@
package info.FrostFS.sdk.dto; package info.frostfs.sdk.dto;
import info.FrostFS.sdk.dto.object.ObjectHeader; import info.frostfs.sdk.dto.object.ObjectHeader;
import info.FrostFS.sdk.dto.object.ObjectId; import info.frostfs.sdk.dto.object.ObjectId;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View file

@ -1,9 +1,9 @@
package info.FrostFS.sdk.dto; package info.frostfs.sdk.dto;
import java.util.UUID; import java.util.UUID;
import static info.FrostFS.sdk.UUIDExtension.asBytes; import static info.frostfs.sdk.UUIDExtension.asBytes;
import static info.FrostFS.sdk.UUIDExtension.asUuid; import static info.frostfs.sdk.UUIDExtension.asUuid;
import static java.util.Objects.isNull; import static java.util.Objects.isNull;
public class SplitId { public class SplitId {

View file

@ -1,6 +1,6 @@
package info.FrostFS.sdk.dto; package info.frostfs.sdk.dto;
import info.FrostFS.sdk.enums.StatusCode; import info.frostfs.sdk.enums.StatusCode;
import static java.util.Objects.isNull; import static java.util.Objects.isNull;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.dto; package info.frostfs.sdk.dto;
public class Version { public class Version {
private int major; private int major;

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.dto.container; package info.frostfs.sdk.dto.container;
import info.FrostFS.sdk.dto.Version; import info.frostfs.sdk.dto.Version;
import info.FrostFS.sdk.dto.netmap.PlacementPolicy; import info.frostfs.sdk.dto.netmap.PlacementPolicy;
import info.FrostFS.sdk.enums.BasicAcl; import info.frostfs.sdk.enums.BasicAcl;
import java.util.UUID; import java.util.UUID;

View file

@ -1,7 +1,7 @@
package info.FrostFS.sdk.dto.container; package info.frostfs.sdk.dto.container;
import info.FrostFS.sdk.Base58; import info.frostfs.sdk.Base58;
import info.FrostFS.sdk.constants.AppConst; import info.frostfs.sdk.constants.AppConst;
public class ContainerId { public class ContainerId {
private String value; private String value;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.dto.netmap; package info.frostfs.sdk.dto.netmap;
import java.util.List; import java.util.List;

View file

@ -1,7 +1,7 @@
package info.FrostFS.sdk.dto.netmap; package info.frostfs.sdk.dto.netmap;
import info.FrostFS.sdk.dto.Version; import info.frostfs.sdk.dto.Version;
import info.FrostFS.sdk.enums.NodeState; import info.frostfs.sdk.enums.NodeState;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.dto.netmap; package info.frostfs.sdk.dto.netmap;
public class PlacementPolicy { public class PlacementPolicy {
private final Replica[] replicas; private final Replica[] replicas;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.dto.netmap; package info.frostfs.sdk.dto.netmap;
import static java.util.Objects.isNull; import static java.util.Objects.isNull;

View file

@ -1,10 +1,10 @@
package info.FrostFS.sdk.dto.object; package info.frostfs.sdk.dto.object;
import info.FrostFS.sdk.dto.container.ContainerId; import info.frostfs.sdk.dto.container.ContainerId;
import java.security.MessageDigest; import java.security.MessageDigest;
import static info.FrostFS.sdk.Helper.getSha256Instance; import static info.frostfs.sdk.Helper.getSha256Instance;
public class LargeObject extends ObjectFrostFS { public class LargeObject extends ObjectFrostFS {
private final MessageDigest payloadHash; private final MessageDigest payloadHash;

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.dto.object; package info.frostfs.sdk.dto.object;
import info.FrostFS.sdk.dto.Split; import info.frostfs.sdk.dto.Split;
import info.FrostFS.sdk.dto.SplitId; import info.frostfs.sdk.dto.SplitId;
import info.FrostFS.sdk.dto.container.ContainerId; import info.frostfs.sdk.dto.container.ContainerId;
import java.util.List; import java.util.List;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.dto.object; package info.frostfs.sdk.dto.object;
public class ObjectAttribute { public class ObjectAttribute {
private String key; private String key;

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.dto.object; package info.frostfs.sdk.dto.object;
import info.FrostFS.sdk.dto.OwnerId; import info.frostfs.sdk.dto.OwnerId;
import info.FrostFS.sdk.dto.Version; import info.frostfs.sdk.dto.Version;
import info.FrostFS.sdk.enums.ObjectMatchType; import info.frostfs.sdk.enums.ObjectMatchType;
public class ObjectFilter { public class ObjectFilter {
private static final String HEADER_PREFIX = "$Object:"; private static final String HEADER_PREFIX = "$Object:";

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.dto.object; package info.frostfs.sdk.dto.object;
import info.FrostFS.sdk.dto.Split; import info.frostfs.sdk.dto.Split;
import info.FrostFS.sdk.dto.container.ContainerId; import info.frostfs.sdk.dto.container.ContainerId;
import info.FrostFS.sdk.enums.ObjectType; import info.frostfs.sdk.enums.ObjectType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View file

@ -1,10 +1,10 @@
package info.FrostFS.sdk.dto.object; package info.frostfs.sdk.dto.object;
import info.FrostFS.sdk.dto.OwnerId; import info.frostfs.sdk.dto.OwnerId;
import info.FrostFS.sdk.dto.Split; import info.frostfs.sdk.dto.Split;
import info.FrostFS.sdk.dto.Version; import info.frostfs.sdk.dto.Version;
import info.FrostFS.sdk.dto.container.ContainerId; import info.frostfs.sdk.dto.container.ContainerId;
import info.FrostFS.sdk.enums.ObjectType; import info.frostfs.sdk.enums.ObjectType;
import java.util.List; import java.util.List;

View file

@ -1,7 +1,7 @@
package info.FrostFS.sdk.dto.object; package info.frostfs.sdk.dto.object;
import info.FrostFS.sdk.Base58; import info.frostfs.sdk.Base58;
import info.FrostFS.sdk.constants.AppConst; import info.frostfs.sdk.constants.AppConst;
public class ObjectId { public class ObjectId {
private final String value; private final String value;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.enums; package info.frostfs.sdk.enums;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.enums; package info.frostfs.sdk.enums;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.enums; package info.frostfs.sdk.enums;
public enum ObjectMatchType { public enum ObjectMatchType {
UNSPECIFIED(0), UNSPECIFIED(0),

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.enums; package info.frostfs.sdk.enums;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.enums; package info.frostfs.sdk.enums;
public enum SignatureScheme { public enum SignatureScheme {
ECDSA_SHA512(0), ECDSA_SHA512(0),

View file

@ -1,4 +1,4 @@
package info.FrostFS.sdk.enums; package info.frostfs.sdk.enums;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;

View file

@ -1,7 +1,7 @@
package info.FrostFS.sdk.mappers; package info.frostfs.sdk.mappers;
import frostFS.session.Types; import frostfs.session.Types;
import info.FrostFS.sdk.dto.MetaHeader; import info.frostfs.sdk.dto.MetaHeader;
public class MetaHeaderMapper { public class MetaHeaderMapper {

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.mappers; package info.frostfs.sdk.mappers;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import frostFS.refs.Types; import frostfs.refs.Types;
import info.FrostFS.sdk.dto.OwnerId; import info.frostfs.sdk.dto.OwnerId;
public class OwnerIdMapper { public class OwnerIdMapper {

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.mappers; package info.frostfs.sdk.mappers;
import com.google.protobuf.CodedOutputStream; import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
import frostFS.session.Types; import frostfs.session.Types;
import java.io.IOException; import java.io.IOException;

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.mappers; package info.frostfs.sdk.mappers;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import frostFS.refs.Types; import frostfs.refs.Types;
import info.FrostFS.sdk.dto.Signature; import info.frostfs.sdk.dto.Signature;
import static java.util.Objects.isNull; import static java.util.Objects.isNull;

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.mappers; package info.frostfs.sdk.mappers;
import frostFS.status.Types; import frostfs.status.Types;
import info.FrostFS.sdk.dto.Status; import info.frostfs.sdk.dto.Status;
import info.FrostFS.sdk.enums.StatusCode; import info.frostfs.sdk.enums.StatusCode;
import static java.util.Objects.isNull; import static java.util.Objects.isNull;

View file

@ -1,7 +1,7 @@
package info.FrostFS.sdk.mappers; package info.frostfs.sdk.mappers;
import frostFS.refs.Types; import frostfs.refs.Types;
import info.FrostFS.sdk.dto.Version; import info.frostfs.sdk.dto.Version;
public class VersionMapper { public class VersionMapper {

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.mappers.container; package info.frostfs.sdk.mappers.container;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import frostFS.refs.Types; import frostfs.refs.Types;
import info.FrostFS.sdk.dto.container.ContainerId; import info.frostfs.sdk.dto.container.ContainerId;
public class ContainerIdMapper { public class ContainerIdMapper {

View file

@ -1,14 +1,14 @@
package info.FrostFS.sdk.mappers.container; package info.frostfs.sdk.mappers.container;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import frostFS.container.Types; import frostfs.container.Types;
import info.FrostFS.sdk.dto.container.Container; import info.frostfs.sdk.dto.container.Container;
import info.FrostFS.sdk.enums.BasicAcl; import info.frostfs.sdk.enums.BasicAcl;
import info.FrostFS.sdk.mappers.VersionMapper; import info.frostfs.sdk.mappers.VersionMapper;
import info.FrostFS.sdk.mappers.netmap.PlacementPolicyMapper; import info.frostfs.sdk.mappers.netmap.PlacementPolicyMapper;
import static info.FrostFS.sdk.UUIDExtension.asBytes; import static info.frostfs.sdk.UUIDExtension.asBytes;
import static info.FrostFS.sdk.UUIDExtension.asUuid; import static info.frostfs.sdk.UUIDExtension.asUuid;
import static java.util.Objects.isNull; import static java.util.Objects.isNull;
public class ContainerMapper { public class ContainerMapper {

View file

@ -1,7 +1,7 @@
package info.FrostFS.sdk.mappers.netmap; package info.frostfs.sdk.mappers.netmap;
import frostFS.netmap.Service; import frostfs.netmap.Service;
import info.FrostFS.sdk.dto.netmap.NetmapSnapshot; import info.frostfs.sdk.dto.netmap.NetmapSnapshot;
import java.util.stream.Collectors; import java.util.stream.Collectors;

View file

@ -1,11 +1,11 @@
package info.FrostFS.sdk.mappers.netmap; package info.frostfs.sdk.mappers.netmap;
import frostFS.netmap.Service; import frostfs.netmap.Service;
import frostFS.netmap.Types.NodeInfo.Attribute; import frostfs.netmap.Types.NodeInfo.Attribute;
import frostFS.refs.Types; import frostfs.refs.Types;
import info.FrostFS.sdk.dto.netmap.NodeInfo; import info.frostfs.sdk.dto.netmap.NodeInfo;
import info.FrostFS.sdk.enums.NodeState; import info.frostfs.sdk.enums.NodeState;
import info.FrostFS.sdk.mappers.VersionMapper; import info.frostfs.sdk.mappers.VersionMapper;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -17,7 +17,7 @@ public class NodeInfoMapper {
return toModel(nodeInfo.getNodeInfo(), nodeInfo.getVersion()); return toModel(nodeInfo.getNodeInfo(), nodeInfo.getVersion());
} }
public static NodeInfo toModel(frostFS.netmap.Types.NodeInfo nodeInfo, Types.Version version) { public static NodeInfo toModel(frostfs.netmap.Types.NodeInfo nodeInfo, Types.Version version) {
NodeState nodeState = NodeState.get(nodeInfo.getState().getNumber()); NodeState nodeState = NodeState.get(nodeInfo.getState().getNumber());
if (isNull(nodeState)) { if (isNull(nodeState)) {
throw new IllegalArgumentException( throw new IllegalArgumentException(

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.mappers.netmap; package info.frostfs.sdk.mappers.netmap;
import frostFS.netmap.Types; import frostfs.netmap.Types;
import info.FrostFS.sdk.dto.netmap.PlacementPolicy; import info.frostfs.sdk.dto.netmap.PlacementPolicy;
import info.FrostFS.sdk.dto.netmap.Replica; import info.frostfs.sdk.dto.netmap.Replica;
public class PlacementPolicyMapper { public class PlacementPolicyMapper {

View file

@ -1,7 +1,7 @@
package info.FrostFS.sdk.mappers.netmap; package info.frostfs.sdk.mappers.netmap;
import frostFS.netmap.Types; import frostfs.netmap.Types;
import info.FrostFS.sdk.dto.netmap.Replica; import info.frostfs.sdk.dto.netmap.Replica;
public class ReplicaMapper { public class ReplicaMapper {

View file

@ -1,7 +1,7 @@
package info.FrostFS.sdk.mappers.object; package info.frostfs.sdk.mappers.object;
import frostFS.object.Types; import frostfs.object.Types;
import info.FrostFS.sdk.dto.object.ObjectAttribute; import info.frostfs.sdk.dto.object.ObjectAttribute;
public class ObjectAttributeMapper { public class ObjectAttributeMapper {

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.mappers.object; package info.frostfs.sdk.mappers.object;
import frostFS.object.Service; import frostfs.object.Service;
import frostFS.object.Types; import frostfs.object.Types;
import info.FrostFS.sdk.dto.object.ObjectFilter; import info.frostfs.sdk.dto.object.ObjectFilter;
import static java.util.Objects.isNull; import static java.util.Objects.isNull;

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.mappers.object; package info.frostfs.sdk.mappers.object;
import frostFS.object.Types; import frostfs.object.Types;
import info.FrostFS.sdk.dto.object.ObjectFrostFS; import info.frostfs.sdk.dto.object.ObjectFrostFS;
import info.FrostFS.sdk.dto.object.ObjectId; import info.frostfs.sdk.dto.object.ObjectId;
public class ObjectFrostFSMapper { public class ObjectFrostFSMapper {

View file

@ -1,12 +1,12 @@
package info.FrostFS.sdk.mappers.object; package info.frostfs.sdk.mappers.object;
import frostFS.object.Types; import frostfs.object.Types;
import info.FrostFS.sdk.dto.container.ContainerId; import info.frostfs.sdk.dto.container.ContainerId;
import info.FrostFS.sdk.dto.object.ObjectAttribute; import info.frostfs.sdk.dto.object.ObjectAttribute;
import info.FrostFS.sdk.dto.object.ObjectHeader; import info.frostfs.sdk.dto.object.ObjectHeader;
import info.FrostFS.sdk.enums.ObjectType; import info.frostfs.sdk.enums.ObjectType;
import info.FrostFS.sdk.mappers.VersionMapper; import info.frostfs.sdk.mappers.VersionMapper;
import info.FrostFS.sdk.mappers.container.ContainerIdMapper; import info.frostfs.sdk.mappers.container.ContainerIdMapper;
import java.util.stream.Collectors; import java.util.stream.Collectors;

View file

@ -1,8 +1,8 @@
package info.FrostFS.sdk.mappers.object; package info.frostfs.sdk.mappers.object;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import frostFS.refs.Types; import frostfs.refs.Types;
import info.FrostFS.sdk.dto.object.ObjectId; import info.frostfs.sdk.dto.object.ObjectId;
public class ObjectIdMapper { public class ObjectIdMapper {

View file

@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>info.FrostFS.sdk</groupId> <groupId>info.frostfs.sdk</groupId>
<artifactId>FrostFS-sdk-java</artifactId> <artifactId>frostfs-sdk-java</artifactId>
<version>0.1.0</version> <version>0.1.0</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>

View file

@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>info.FrostFS.sdk</groupId> <groupId>info.frostfs.sdk</groupId>
<artifactId>FrostFS-sdk-java</artifactId> <artifactId>frostfs-sdk-java</artifactId>
<version>0.1.0</version> <version>0.1.0</version>
</parent> </parent>

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package neo.fs.v2.accounting; package neo.fs.v2.accounting;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc;accounting"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc;accounting";
option java_package = "frostFS.accounting"; option java_package = "frostfs.accounting";
import "accounting/types.proto"; import "accounting/types.proto";
import "refs/types.proto"; import "refs/types.proto";

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package neo.fs.v2.accounting; package neo.fs.v2.accounting;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc;accounting"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc;accounting";
option java_package = "frostFS.accounting"; option java_package = "frostfs.accounting";
// Standard floating point data type can't be used in NeoFS due to inexactness // Standard floating point data type can't be used in NeoFS due to inexactness
// of the result when doing lots of small number operations. To solve the lost // of the result when doing lots of small number operations. To solve the lost

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package neo.fs.v2.acl; package neo.fs.v2.acl;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc;acl"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc;acl";
option java_package = "frostFS.acl"; option java_package = "frostfs.acl";
import "refs/types.proto"; import "refs/types.proto";

View file

@ -6,7 +6,7 @@ import "apemanager/types.proto";
import "session/types.proto"; import "session/types.proto";
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc;apemanager"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc;apemanager";
option java_package = "frostFS.apemanager"; option java_package = "frostfs.apemanager";
// `APEManagerService` provides API to manage rule chains within sidechain's // `APEManagerService` provides API to manage rule chains within sidechain's
// `Policy` smart contract. // `Policy` smart contract.

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package frostfs.v2.apemanager; package frostfs.v2.apemanager;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc;apemanager"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc;apemanager";
option java_package = "frostFS.apemanager"; option java_package = "frostfs.apemanager";
// TargetType is a type target to which a rule chain is defined. // TargetType is a type target to which a rule chain is defined.
enum TargetType { enum TargetType {

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package neo.fs.v2.container; package neo.fs.v2.container;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc;container"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc;container";
option java_package = "frostFS.container"; option java_package = "frostfs.container";
import "acl/types.proto"; import "acl/types.proto";
import "container/types.proto"; import "container/types.proto";

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package neo.fs.v2.container; package neo.fs.v2.container;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc;container"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc;container";
option java_package = "frostFS.container"; option java_package = "frostfs.container";
import "netmap/types.proto"; import "netmap/types.proto";
import "refs/types.proto"; import "refs/types.proto";

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package neo.fs.v2.lock; package neo.fs.v2.lock;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/lock/grpc;lock"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/lock/grpc;lock";
option java_package = "frostFS.lock"; option java_package = "frostfs.lock";
import "refs/types.proto"; import "refs/types.proto";

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package neo.fs.v2.netmap; package neo.fs.v2.netmap;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc;netmap"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc;netmap";
option java_package = "frostFS.netmap"; option java_package = "frostfs.netmap";
import "netmap/types.proto"; import "netmap/types.proto";
import "refs/types.proto"; import "refs/types.proto";

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package neo.fs.v2.netmap; package neo.fs.v2.netmap;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc;netmap"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc;netmap";
option java_package = "frostFS.netmap"; option java_package = "frostfs.netmap";
// Operations on filters // Operations on filters
enum Operation { enum Operation {

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package neo.fs.v2.object; package neo.fs.v2.object;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc;object"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc;object";
option java_package = "frostFS.object"; option java_package = "frostfs.object";
import "object/types.proto"; import "object/types.proto";
import "refs/types.proto"; import "refs/types.proto";

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package neo.fs.v2.object; package neo.fs.v2.object;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc;object"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc;object";
option java_package = "frostFS.object"; option java_package = "frostfs.object";
import "refs/types.proto"; import "refs/types.proto";
import "session/types.proto"; import "session/types.proto";

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package neo.fs.v2.refs; package neo.fs.v2.refs;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc;refs"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc;refs";
option java_package = "frostFS.refs"; option java_package = "frostfs.refs";
// Objects in NeoFS are addressed by their ContainerID and ObjectID. // Objects in NeoFS are addressed by their ContainerID and ObjectID.
// //

View file

@ -3,7 +3,7 @@ syntax = "proto3";
package neo.fs.v2.session; package neo.fs.v2.session;
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc;session"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc;session";
option java_package = "frostFS.session"; option java_package = "frostfs.session";
import "refs/types.proto"; import "refs/types.proto";
import "session/types.proto"; import "session/types.proto";

Some files were not shown because too many files have changed in this diff Show more