adding dokploy client
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.abnov.infisicalbridge.dokploy;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import com.abnov.infisicalbridge.dto.DokployComposeUpdateRequest;
|
||||
|
||||
@FeignClient(name = "dokployClient", url = "${dokploy.api-url}", configuration = DokployFeignConfig.class)
|
||||
public interface DokployClient {
|
||||
|
||||
@PostMapping("/compose.update")
|
||||
void updateCompose(@RequestBody DokployComposeUpdateRequest request);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.abnov.infisicalbridge.dokploy;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class DokployFeignConfig {
|
||||
|
||||
private final DokployProperties properties;
|
||||
|
||||
@Bean
|
||||
public RequestInterceptor dokployRequestInterceptor() {
|
||||
return requestTemplate -> {
|
||||
// Add API key to every request
|
||||
requestTemplate.header("x-api-key", properties.getApiKey());
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.abnov.infisicalbridge.dto;
|
||||
|
||||
public record DokployComposeUpdateRequest(
|
||||
String composeId,
|
||||
String env) {
|
||||
}
|
||||
Reference in New Issue
Block a user