-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into bugfix/MARP-1629-Fix-AI-Assistant-release…
…-on-MP
- Loading branch information
Showing
67 changed files
with
2,501 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
marketplace-service/src/main/java/com/axonivy/market/config/RestTemplateConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.axonivy.market.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.client.RestTemplate; | ||
|
||
@Configuration | ||
public class RestTemplateConfig { | ||
|
||
@Bean | ||
public RestTemplate restTemplate() { | ||
return new RestTemplate(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
marketplace-service/src/main/java/com/axonivy/market/constants/LoggingConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.axonivy.market.constants; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class LoggingConstants { | ||
|
||
public static final String ENTRY_FORMAT = " <%s>%s</%s>%n"; | ||
public static final String ENTRY_START = " <LogEntry>\n"; | ||
public static final String ENTRY_END = " </LogEntry>\n"; | ||
public static final String DATE_FORMAT = "yyyy-MM-dd"; | ||
public static final String TIMESTAMP_FORMAT = "yyyy-MM-dd HH:mm:ss"; | ||
public static final String LOG_START = "<Logs>\n"; | ||
public static final String LOG_END = "</Logs>"; | ||
public static final String METHOD = "method"; | ||
public static final String ARGUMENTS = "arguments"; | ||
public static final String TIMESTAMP = "timestamp"; | ||
public static final String NO_ARGUMENTS = "No arguments"; | ||
public static final String MARKET_WEBSITE = "marketplace-website"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...tplace-service/src/main/java/com/axonivy/market/controller/SecurityMonitorController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.axonivy.market.controller; | ||
|
||
import com.axonivy.market.constants.GitHubConstants; | ||
import com.axonivy.market.github.service.GitHubService; | ||
import com.axonivy.market.github.model.ProductSecurityInfo; | ||
import com.axonivy.market.util.AuthorizationUtils; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.AllArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
|
||
import static com.axonivy.market.constants.RequestMappingConstants.SECURITY_MONITOR; | ||
import static org.springframework.http.HttpHeaders.AUTHORIZATION; | ||
|
||
@RestController | ||
@RequestMapping(SECURITY_MONITOR) | ||
@Tag(name = "Security Monitor Controllers", description = "API collection to get Github Marketplace security's detail.") | ||
@AllArgsConstructor | ||
public class SecurityMonitorController { | ||
private final GitHubService gitHubService; | ||
|
||
@GetMapping | ||
@Operation(hidden = true) | ||
public ResponseEntity<Object> getGitHubMarketplaceSecurity( | ||
@RequestHeader(value = AUTHORIZATION) String authorizationHeader) { | ||
String token = AuthorizationUtils.getBearerToken(authorizationHeader); | ||
gitHubService.validateUserInOrganizationAndTeam(token, GitHubConstants.AXONIVY_MARKET_ORGANIZATION_NAME, | ||
GitHubConstants.AXONIVY_MARKET_TEAM_NAME); | ||
List<ProductSecurityInfo> securityInfoList = gitHubService.getSecurityDetailsForAllProducts(token, | ||
GitHubConstants.AXONIVY_MARKET_ORGANIZATION_NAME); | ||
return ResponseEntity.ok(securityInfoList); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
marketplace-service/src/main/java/com/axonivy/market/enums/AccessLevel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.axonivy.market.enums; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum AccessLevel { | ||
NO_PERMISSION, ENABLED, DISABLED | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
marketplace-service/src/main/java/com/axonivy/market/github/model/CodeScanning.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.axonivy.market.github.model; | ||
|
||
import com.axonivy.market.enums.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.util.Map; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class CodeScanning { | ||
private Map<String, Integer> alerts; | ||
private AccessLevel status; | ||
} |
16 changes: 16 additions & 0 deletions
16
marketplace-service/src/main/java/com/axonivy/market/github/model/Dependabot.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.axonivy.market.github.model; | ||
|
||
import com.axonivy.market.enums.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.util.Map; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class Dependabot { | ||
private Map<String, Integer> alerts; | ||
private AccessLevel status; | ||
} |
24 changes: 24 additions & 0 deletions
24
marketplace-service/src/main/java/com/axonivy/market/github/model/ProductSecurityInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.axonivy.market.github.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.util.Date; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ProductSecurityInfo { | ||
private String repoName; | ||
private boolean isArchived; | ||
private String visibility; | ||
private boolean branchProtectionEnabled; | ||
private Date lastCommitDate; | ||
private String latestCommitSHA; | ||
private Dependabot dependabot; | ||
private SecretScanning secretScanning; | ||
private CodeScanning codeScanning; | ||
} |
14 changes: 14 additions & 0 deletions
14
marketplace-service/src/main/java/com/axonivy/market/github/model/SecretScanning.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.axonivy.market.github.model; | ||
|
||
import com.axonivy.market.enums.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class SecretScanning { | ||
private Integer numberOfAlerts; | ||
private AccessLevel status; | ||
} |
Oops, something went wrong.