feat: replace GitLab webhook properties with GitHub webhook config
Replace GitLabWebhookProperties with GitHubWebhookProperties (secret, allowed-users). Update WebhookProperties and WebhookManager to use GitHub-only configuration. Add app.webhook.github defaults to application.yaml.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.onixbyte.deltaforceguide.manager;
|
||||
|
||||
import com.onixbyte.deltaforceguide.properties.GitLabWebhookProperties;
|
||||
import com.onixbyte.deltaforceguide.properties.GitHubWebhookProperties;
|
||||
import com.onixbyte.deltaforceguide.properties.WebhookProperties;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -15,7 +15,7 @@ public class WebhookManager {
|
||||
this.webhookProperties = webhookProperties;
|
||||
}
|
||||
|
||||
public GitLabWebhookProperties getGitLabWebhookProperties() {
|
||||
return webhookProperties.gitlab();
|
||||
public GitHubWebhookProperties github() {
|
||||
return webhookProperties.github();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.onixbyte.deltaforceguide.properties;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record GitHubWebhookProperties(
|
||||
String secret,
|
||||
List<String> allowedUsers
|
||||
) {
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.onixbyte.deltaforceguide.properties;
|
||||
|
||||
public record GitLabWebhookProperties(
|
||||
String signingToken
|
||||
) {
|
||||
}
|
||||
@@ -4,6 +4,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties(prefix = "app.webhook")
|
||||
public record WebhookProperties(
|
||||
GitLabWebhookProperties gitlab
|
||||
GitHubWebhookProperties github
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -39,6 +39,12 @@ mybatis:
|
||||
type-handlers-package: com.onixbyte.deltaforceguide.mapper.handler
|
||||
mapper-locations: classpath:/mapper/*.xml
|
||||
|
||||
app:
|
||||
webhook:
|
||||
github:
|
||||
secret: ${GITHUB_WEBHOOK_SECRET:}
|
||||
allowed-users: []
|
||||
|
||||
logging:
|
||||
level:
|
||||
org.hibernate:
|
||||
|
||||
Reference in New Issue
Block a user