mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-05-05 00:01:30 +08:00
[fix][auth]Fix user registration and resetPassword issue.
This commit is contained in:
@@ -7,6 +7,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import static dev.langchain4j.opensearch.spring.Properties.PREFIX;
|
||||
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(dev.langchain4j.opensearch.spring.Properties.class)
|
||||
public class OpenSearchAutoConfig {
|
||||
|
||||
@@ -11,11 +11,12 @@ import org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider;
|
||||
import org.apache.hc.core5.http.HttpHost;
|
||||
import org.opensearch.client.transport.aws.AwsSdk2TransportOptions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
||||
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
||||
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
|
||||
|
||||
/**
|
||||
* @author zyc
|
||||
*/
|
||||
@@ -42,18 +43,16 @@ public class OpenSearchEmbeddingStoreFactory extends BaseEmbeddingStoreFactory {
|
||||
|
||||
@Override
|
||||
public EmbeddingStore<TextSegment> createEmbeddingStore(String collectionName) {
|
||||
final AwsSdk2TransportOptions options = AwsSdk2TransportOptions.builder()
|
||||
.setCredentials(StaticCredentialsProvider.create(AwsBasicCredentials.create(storeProperties.getUser(), storeProperties.getPassword())))
|
||||
.build();
|
||||
final AwsSdk2TransportOptions options =
|
||||
AwsSdk2TransportOptions.builder()
|
||||
.setCredentials(StaticCredentialsProvider.create(AwsBasicCredentials
|
||||
.create(storeProperties.getUser(), storeProperties.getPassword())))
|
||||
.build();
|
||||
final String indexName = storeProperties.getDatabaseName() + "_" + collectionName;
|
||||
return OpenSearchEmbeddingStore.builder().serviceName(storeProperties.getServiceName())
|
||||
.serverUrl(storeProperties.getUri())
|
||||
.region(storeProperties.getRegion())
|
||||
.indexName(indexName)
|
||||
.userName(storeProperties.getUser())
|
||||
.password(storeProperties.getPassword())
|
||||
.apiKey(storeProperties.getToken())
|
||||
.options(options)
|
||||
.build();
|
||||
.serverUrl(storeProperties.getUri()).region(storeProperties.getRegion())
|
||||
.indexName(indexName).userName(storeProperties.getUser())
|
||||
.password(storeProperties.getPassword()).apiKey(storeProperties.getToken())
|
||||
.options(options).build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user