diff --git a/backend-services/user-verification-service/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java b/backend-services/user-verification-service/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java index 8754c1cf2..7336f27bc 100644 --- a/backend-services/user-verification-service/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java +++ b/backend-services/user-verification-service/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java @@ -18,7 +18,9 @@ public WebMvcConfigurer corsConfigurer() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/api/**") - .allowedOrigins(allowedOrigins.split(",")); + .allowedOrigins(allowedOrigins.split(",")) + .allowedMethods("GET", "HEAD", "POST", "PUT") + .allowedHeaders("*"); } }; } diff --git a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/config/SpringSecurityConfiguration.java b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/config/SpringSecurityConfiguration.java index 479ca08df..6b7215536 100644 --- a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/config/SpringSecurityConfiguration.java +++ b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/config/SpringSecurityConfiguration.java @@ -73,8 +73,11 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { .formLogin(AbstractHttpConfigurer::disable) .authorizeHttpRequests(requests -> { + requests // SECURED by JWT auth - requests.requestMatchers(new AntPathRequestMatcher("/api/vote/receipt/**", GET.name())).authenticated() + .requestMatchers(new AntPathRequestMatcher("/api/vote/voted-on/**", GET.name())).authenticated() + // SECURED by JWT auth + .requestMatchers(new AntPathRequestMatcher("/api/vote/receipt/**", GET.name())).authenticated() // SECURED by Web3 auth .requestMatchers(new AntPathRequestMatcher("/api/vote/receipt", GET.name())).authenticated() // SECURED by Web3 auth diff --git a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java index 66751a641..348721949 100644 --- a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java +++ b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java @@ -18,7 +18,9 @@ public WebMvcConfigurer corsConfigurer() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/api/**") - .allowedOrigins(allowedOrigins.split(",")); + .allowedOrigins(allowedOrigins.split(",")) + .allowedMethods("GET", "HEAD", "POST") + .allowedHeaders("*"); } }; } diff --git a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/domain/CategoryProposalPair.java b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/domain/CategoryProposalPair.java deleted file mode 100644 index 882a9ea1e..000000000 --- a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/domain/CategoryProposalPair.java +++ /dev/null @@ -1,4 +0,0 @@ -package org.cardano.foundation.voting.domain; - -public record CategoryProposalPair(String categoryId, String proposalId) { -} diff --git a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/repository/VoteRepository.java b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/repository/VoteRepository.java index ce46897b0..a071fed83 100644 --- a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/repository/VoteRepository.java +++ b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/repository/VoteRepository.java @@ -13,11 +13,10 @@ @Repository public interface VoteRepository extends JpaRepository { - @Query("SELECT v.categoryId as categoryId, v.proposalId as proposalId FROM Vote v WHERE v.eventId = :eventId AND v.stakeAddress = :stakeAddress ORDER BY v.votedAtSlot, v.idNumericHash ASC") + @Query("SELECT v.categoryId as categoryId, v.proposalId as proposalId FROM Vote v WHERE v.eventId = :eventId AND v.voterStakingAddress = :stakeAddress ORDER BY v.votedAtSlot, v.idNumericHash ASC") List getVotedOn(@Param("eventId") String eventId, @Param("stakeAddress") String stakeAddress); @Query("SELECT v FROM Vote v WHERE v.eventId = :eventId ORDER BY v.votedAtSlot, v.idNumericHash ASC") - List findAllCompactVotesByEventId(@Param("eventId") String eventId); Optional findByEventIdAndCategoryIdAndVoterStakingAddress(String eventId, String categoryId, String voterStakeAddress); diff --git a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/auth/jwt/JwtFilter.java b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/auth/jwt/JwtFilter.java index ab99d6e93..40e56f852 100644 --- a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/auth/jwt/JwtFilter.java +++ b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/auth/jwt/JwtFilter.java @@ -91,8 +91,8 @@ protected void doFilterInternal(HttpServletRequest request, var maybeEventDetails = eventDetailsE.get(); if (maybeEventDetails.isEmpty()) { var problem = Problem.builder() - .withTitle("EVENT_NOT_FOUND") - .withDetail("Event not found, id:" + eventId) + .withTitle("UNRECOGNISED_EVENT") + .withDetail("Event not found, id: " + eventId) .withStatus(BAD_REQUEST) .build(); diff --git a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/auth/web3/Web3Filter.java b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/auth/web3/Web3Filter.java index c1da390a7..2ececd1a4 100644 --- a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/auth/web3/Web3Filter.java +++ b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/auth/web3/Web3Filter.java @@ -254,7 +254,7 @@ protected void doFilterInternal(HttpServletRequest request, if (maybeEventDetails.isEmpty()) { var problem = Problem.builder() .withTitle("UNRECOGNISED_EVENT") - .withDetail("Unrecognised event, event:" + eventId) + .withDetail("Event not found, id: " + eventId) .withStatus(BAD_REQUEST) .build(); diff --git a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/vote/DefaultVoteService.java b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/vote/DefaultVoteService.java index 49ef2c514..0c6fc819c 100644 --- a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/vote/DefaultVoteService.java +++ b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/vote/DefaultVoteService.java @@ -6,7 +6,6 @@ import lombok.extern.slf4j.Slf4j; import org.cardano.foundation.voting.client.ChainFollowerClient; import org.cardano.foundation.voting.client.UserVerificationClient; -import org.cardano.foundation.voting.domain.CategoryProposalPair; import org.cardano.foundation.voting.domain.VoteReceipt; import org.cardano.foundation.voting.domain.entity.Vote; import org.cardano.foundation.voting.domain.entity.VoteMerkleProof; @@ -55,7 +54,7 @@ public class DefaultVoteService implements VoteService { @Override @Transactional(readOnly = true) @Timed(value = "service.vote.getVotedOn", histogram = true) - public Either> getVotedOn(JwtAuthenticationToken auth) { + public Either> getVotedOn(JwtAuthenticationToken auth) { var jwtEventId = auth.eventDetails().id(); var jwtStakeAddress = auth.getStakeAddress(); @@ -67,10 +66,7 @@ public Either> getVotedOn(JwtAuthenticationT .build()); } - var votedOn = voteRepository.getVotedOn(jwtEventId, jwtStakeAddress).stream() - .map(r -> new CategoryProposalPair(r.getCategoryId(), r.getCategoryId())).toList(); - - return Either.right(votedOn); + return Either.right(voteRepository.getVotedOn(jwtEventId, jwtStakeAddress)); } @Override diff --git a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/vote/VoteService.java b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/vote/VoteService.java index 7c9334ae7..9dda95d56 100644 --- a/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/vote/VoteService.java +++ b/backend-services/voting-app/src/main/java/org/cardano/foundation/voting/service/vote/VoteService.java @@ -1,7 +1,6 @@ package org.cardano.foundation.voting.service.vote; import io.vavr.control.Either; -import org.cardano.foundation.voting.domain.CategoryProposalPair; import org.cardano.foundation.voting.domain.VoteReceipt; import org.cardano.foundation.voting.domain.entity.Vote; import org.cardano.foundation.voting.repository.VoteRepository; @@ -15,7 +14,7 @@ public interface VoteService { List findAllCompactVotesByEventId(String eventId); - Either> getVotedOn(JwtAuthenticationToken auth); + Either> getVotedOn(JwtAuthenticationToken auth); Either isVoteChangingPossible(String voteId, JwtAuthenticationToken auth); diff --git a/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/VotingLedgerFollowerApp.java b/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/VotingLedgerFollowerApp.java index 085ee8bd5..ece09d507 100644 --- a/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/VotingLedgerFollowerApp.java +++ b/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/VotingLedgerFollowerApp.java @@ -11,6 +11,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @@ -22,7 +23,7 @@ import static org.springframework.aot.hint.ExecutableMode.INVOKE; -@SpringBootApplication(exclude = { SecurityAutoConfiguration.class, ErrorMvcAutoConfiguration.class }) +@SpringBootApplication(exclude = { SecurityAutoConfiguration.class, ErrorMvcAutoConfiguration.class, UserDetailsServiceAutoConfiguration.class }) @EnableJpaRepositories("org.cardano.foundation.voting.repository") @EntityScan(basePackages = "org.cardano.foundation.voting.domain.entity") @ComponentScan(basePackages = { @@ -47,7 +48,7 @@ public static void main(String[] args) { @Bean public CommandLineRunner onStart() { return (args) -> { - log.info("Voting Ledger Follower App started."); + log.info("Voting Ledger follower App started."); }; } diff --git a/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java b/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java index 8754c1cf2..3557375b8 100644 --- a/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java +++ b/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java @@ -15,10 +15,13 @@ public class SpringWebConfig { @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurer() { + @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/api/**") - .allowedOrigins(allowedOrigins.split(",")); + .allowedOrigins(allowedOrigins.split(",")) + .allowedMethods("GET") + .allowedHeaders("*"); } }; } diff --git a/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/AccountResource.java b/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/AccountResource.java index a1d25c654..40b3f61c7 100644 --- a/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/AccountResource.java +++ b/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/AccountResource.java @@ -9,8 +9,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.Objects; - import static org.springframework.web.bind.annotation.RequestMethod.GET; @RestController @@ -23,17 +21,22 @@ public class AccountResource { @RequestMapping(value = "/{eventId}/{stakeAddress}", method = GET, produces = "application/json") @Timed(value = "resource.account.find", histogram = true) - public ResponseEntity findAccount(@PathVariable("eventId") String eventId, @PathVariable String stakeAddress) { + public ResponseEntity findAccount(@PathVariable("eventId") String eventId, + @PathVariable String stakeAddress) { return accountService.findAccount(eventId, stakeAddress) .fold(problem -> { - return ResponseEntity.status(Objects.requireNonNull(problem.getStatus()).getStatusCode()).body(problem); + return ResponseEntity + .status(problem.getStatus().getStatusCode()) + .body(problem); }, maybeAccount -> { if (maybeAccount.isEmpty()) { return ResponseEntity.notFound().build(); } - return ResponseEntity.ok().body(maybeAccount.orElseThrow()); + var account = maybeAccount.orElseThrow(); + + return ResponseEntity.ok().body(account); }); } diff --git a/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/BlockchainDataResource.java b/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/BlockchainDataResource.java index 5d5beef5c..eb3cc7453 100644 --- a/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/BlockchainDataResource.java +++ b/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/BlockchainDataResource.java @@ -28,15 +28,27 @@ public class BlockchainDataResource { @Timed(value = "resource.blockchain.tip", histogram = true) public ResponseEntity tip() { return blockchainDataChainTipService.getChainTip() - .fold(problem -> ResponseEntity.status(problem.getStatus().getStatusCode()).body(problem), - chainTip -> ResponseEntity.ok().body(chainTip)); + .fold(problem -> { + return ResponseEntity + .status(problem.getStatus().getStatusCode()) + .body(problem); + }, + chainTip -> { + return ResponseEntity + .ok() + .body(chainTip); + }); } @RequestMapping(value = "/tx-details/{txHash}", method = GET, produces = "application/json") @Timed(value = "resource.tx-details", histogram = true) public ResponseEntity txDetails(@PathVariable String txHash) { return blockchainDataTransactionDetailsService.getTransactionDetails(txHash) - .fold(problem -> ResponseEntity.status(Objects.requireNonNull(problem.getStatus()).getStatusCode()).body(problem), + .fold(problem -> { + return ResponseEntity + .status(problem.getStatus().getStatusCode()) + .body(problem); + }, maybeTxDetails -> { if (maybeTxDetails.isEmpty()) { return ResponseEntity.notFound().build(); diff --git a/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/MerkleRootHashResource.java b/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/MerkleRootHashResource.java index 0b0ce4225..680e2ecbf 100644 --- a/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/MerkleRootHashResource.java +++ b/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/MerkleRootHashResource.java @@ -9,8 +9,6 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; -import java.util.Objects; - import static org.springframework.web.bind.annotation.RequestMethod.GET; @Controller @@ -26,8 +24,14 @@ public class MerkleRootHashResource { public ResponseEntity isValidMerkleRootHash(@PathVariable("eventId") String eventId, @PathVariable("merkleRootHashHex") String merkleRootHashHex) { return merkleRootHashService.isPresent(eventId, merkleRootHashHex) - .fold(problem -> ResponseEntity.status(Objects.requireNonNull(problem.getStatus()).getStatusCode()).body(problem), - isMerkleRootPresentResult -> ResponseEntity.ok().body(isMerkleRootPresentResult) + .fold(problem -> { + return ResponseEntity + .status(problem.getStatus().getStatusCode()) + .body(problem); + }, + isMerkleRootPresentResult -> { + return ResponseEntity.ok().body(isMerkleRootPresentResult); + } ); } diff --git a/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/ReferenceDataResource.java b/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/ReferenceDataResource.java index 3085e6ade..b479d7e96 100644 --- a/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/ReferenceDataResource.java +++ b/backend-services/voting-ledger-follower-app/src/main/java/org/cardano/foundation/voting/resource/ReferenceDataResource.java @@ -3,7 +3,6 @@ import io.micrometer.core.annotation.Timed; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.cardano.foundation.voting.domain.presentation.EventPresentation; import org.cardano.foundation.voting.service.reference_data.ReferencePresentationService; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; @@ -24,7 +23,9 @@ public class ReferenceDataResource { @Timed(value = "resource.reference.event", histogram = true) public ResponseEntity getEventByName(@PathVariable("eventId") String eventId) { return referencePresentationService.findEventReference(eventId) - .fold(problem -> ResponseEntity.status(problem.getStatus().getStatusCode()).body(problem), + .fold(problem -> { + return ResponseEntity.status(problem.getStatus().getStatusCode()).body(problem); + }, maybeEventPresentation -> { if (maybeEventPresentation.isEmpty()) { return ResponseEntity.notFound().build(); @@ -41,8 +42,12 @@ public ResponseEntity getEventByName(@PathVariable("eventId") String eventId) @Timed(value = "resource.reference.events", histogram = true) public ResponseEntity events() { return referencePresentationService.eventsSummaries() - .fold(problem -> ResponseEntity.status(problem.getStatus().getStatusCode()).body(problem), - eventSummaries -> ResponseEntity.ok().body(eventSummaries) + .fold(problem -> { + return ResponseEntity.status(problem.getStatus().getStatusCode()).body(problem); + }, + eventSummaries -> { + return ResponseEntity.ok().body(eventSummaries); + } ); } diff --git a/backend-services/voting-verification-app/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java b/backend-services/voting-verification-app/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java index 8754c1cf2..5c349cac9 100644 --- a/backend-services/voting-verification-app/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java +++ b/backend-services/voting-verification-app/src/main/java/org/cardano/foundation/voting/config/SpringWebConfig.java @@ -18,7 +18,9 @@ public WebMvcConfigurer corsConfigurer() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/api/**") - .allowedOrigins(allowedOrigins.split(",")); + .allowedOrigins(allowedOrigins.split(",")) + .allowedMethods("POST") + .allowedHeaders("*"); } }; } diff --git a/backend-services/voting-verification-app/src/main/java/org/cardano/foundation/voting/resource/VerificationResource.java b/backend-services/voting-verification-app/src/main/java/org/cardano/foundation/voting/resource/VerificationResource.java index 938fd9612..385aa747a 100644 --- a/backend-services/voting-verification-app/src/main/java/org/cardano/foundation/voting/resource/VerificationResource.java +++ b/backend-services/voting-verification-app/src/main/java/org/cardano/foundation/voting/resource/VerificationResource.java @@ -11,8 +11,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.Objects; - import static org.springframework.web.bind.annotation.RequestMethod.POST; @RestController @@ -29,8 +27,16 @@ public ResponseEntity verifyVote(@RequestBody @Valid VoteVerificationRequest log.info("Received vote verification request: {}", voteVerificationRequest); return voteVerificationService.verifyVoteProof(voteVerificationRequest) - .fold(problem -> ResponseEntity.status(Objects.requireNonNull(problem.getStatus()).getStatusCode()).body(problem), - voteVerificationResult -> ResponseEntity.ok().body(voteVerificationResult) + .fold(problem -> { + return ResponseEntity + .status(problem.getStatus().getStatusCode()) + .body(problem); + }, + voteVerificationResult -> { + return ResponseEntity + .ok() + .body(voteVerificationResult); + } ); } diff --git a/scripts/cip_30_sign.sc b/scripts/cip_30_sign.sc index a4805d545..d73912105 100644 --- a/scripts/cip_30_sign.sc +++ b/scripts/cip_30_sign.sc @@ -48,7 +48,7 @@ def signCIP30LoginEnvelope(): Unit = { "slot": "${lastSlot}", "data": { "address": "${stakeAddress}", - "event": "CIP-1694_Pre_Ratification_4619", + "event": "CIP-1694_Pre_Ratification_3316", "network": "PREPROD", "role": "VOTER" } @@ -89,15 +89,15 @@ def signCIP30VoteCastEnvelope(): Unit = { { "uri": "https://evoting.cardano.org/voltaire", "action": "CAST_VOTE", - "actionText": "Vote", + "actionText": "Cast Vote", "slot": "${lastSlot}", "data": { "id": "${voteId}", "address": "${stakeAddress}", - "event": "CF_SUMMIT_2023_24DC", - "category": "BEST_DEX", - "proposal": "be79ce1f-3cf1-4335-bd07-98f6f24f0f12", - "votingPower": "9997463457", + "event": "CIP-1694_Pre_Ratification_3316", + "category": "MIN_VIABLE_GOV_STRUCTURE", + "proposal": "ABSTAIN", + "votingPower": "9980230980", "network": "PREPROD", "votedAt": "${lastSlot}" } @@ -143,8 +143,8 @@ def signCIP30ViewVoteReceiptEnvelope(): Unit = { "data": { "id": "${voteId}", "address": "${stakeAddress}", - "event": "CF_SUMMIT_2023_24DC", - "category": "BEST_DEX", + "event": "CIP-1694_Pre_Ratification_3316", + "category": "CHANGE_GOV_STRUCTURE", "network": "PREPROD" } } @@ -188,6 +188,6 @@ def latestAbsoluteSlot(mapper: ObjectMapper): Long = { @main def main() = { //signCIP30LoginEnvelope() - //signCIP30VoteCastEnvelope() - signCIP30ViewVoteReceiptEnvelope() + signCIP30VoteCastEnvelope() + //signCIP30ViewVoteReceiptEnvelope() } diff --git a/ui/summit-2023/src/types/user-verification-app-types.ts b/ui/summit-2023/src/types/user-verification-app-types.ts index 4830e12ab..3cf3b0b1a 100644 --- a/ui/summit-2023/src/types/user-verification-app-types.ts +++ b/ui/summit-2023/src/types/user-verification-app-types.ts @@ -1,6 +1,6 @@ /* tslint:disable */ /* eslint-disable */ -// Generated using typescript-generator version 3.2.1263 on 2023-09-12 11:55:43. +// Generated using typescript-generator version 3.2.1263 on 2023-09-18 21:29:17. export interface Either extends Value, Serializable { left: L; @@ -8,9 +8,26 @@ export interface Either extends Value, Serializable { orNull: R; } +export interface IsVerifiedRequest { + eventId: string; + stakeAddress: string; +} + +export interface IsVerifiedRequestBuilder { +} + +export interface IsVerifiedResponse { + verified: boolean; +} + +export interface SaltHolder { + salt: string; +} + export interface DiscordCheckVerificationRequest { - secret: string; + eventId: string; stakeAddress: string; + secret: string; coseSignature: string; cosePublicKey?: string; } @@ -19,23 +36,60 @@ export interface DiscordCheckVerificationRequestBuilder { } export interface DiscordStartVerificationRequest { + discordIdHash: string; secret: string; - hashedDiscordId: string; } export interface DiscordStartVerificationRequestBuilder { } -export interface IsVerifiedRequest { +export interface DiscordStartVerificationResponse { + eventId: string; + discordIdHash: string; + status: VerificationStatus; +} + +export interface DiscordStartVerificationResponseBuilder { +} + +export interface AbstractTimestampEntity { + createdAt: Date; + updatedAt: Date; +} + +export interface AbstractTimestampEntityBuilder { +} + +export interface DiscordUserVerification extends AbstractTimestampEntity { + discordIdHash: string; + eventId: string; + stakeAddress?: string; + secretCode: string; + status: VerificationStatus; + expiresAt: Date; +} + +export interface DiscordUserVerificationBuilder extends AbstractTimestampEntityBuilder { +} + +export interface DiscordUserVerificationBuilderImpl extends DiscordUserVerificationBuilder { +} + +export interface SMSUserVerification extends AbstractTimestampEntity { + id: string; stakeAddress: string; eventId: string; + verificationCode: string; + requestId: string; + phoneNumberHash: string; + status: VerificationStatus; + expiresAt: Date; } -export interface IsVerifiedRequestBuilder { +export interface SMSUserVerificationBuilder extends AbstractTimestampEntityBuilder { } -export interface IsVerifiedResponse { - verified: boolean; +export interface SMSUserVerificationBuilderImpl extends SMSUserVerificationBuilder { } export interface SMSCheckVerificationRequest { @@ -67,35 +121,25 @@ export interface SMSStartVerificationResponse { expiresAt: Date; } -export interface SaltHolder { - salt: string; +export interface DefaultUserVerificationService extends UserVerificationService { } -export interface AbstractTimestampEntity { - createdAt: Date; - updatedAt: Date; +export interface DefaultUserVerificationService__BeanDefinitions { } -export interface AbstractTimestampEntityBuilder { +export interface UserVerificationService { } -export interface UserVerification extends AbstractTimestampEntity { - id: string; - stakeAddress: string; - eventId: string; - verificationCode: string; - requestId: string; - phoneNumberHash: string; - status: Status; - provider: Provider; - channel: Channel; - expiresAt: Date; +export interface DefaultDiscordUserVerificationService extends DiscordUserVerificationService { } -export interface UserVerificationBuilder extends AbstractTimestampEntityBuilder { +export interface DefaultDiscordUserVerificationService__Autowiring { } -export interface UserVerificationBuilderImpl extends UserVerificationBuilder { +export interface DefaultDiscordUserVerificationService__BeanDefinitions { +} + +export interface DiscordUserVerificationService { } export interface CodeGenService { @@ -107,13 +151,6 @@ export interface CodeGenService__BeanDefinitions { export interface AWSSNSService extends SMSService { } -export interface SMSService { -} - -export interface SMSVerificationResponse { - requestId: string; -} - export interface DefaultSMSSMSUserVerificationService extends SMSUserVerificationService { } @@ -123,9 +160,16 @@ export interface DefaultSMSSMSUserVerificationService__Autowiring { export interface DefaultSMSSMSUserVerificationService__BeanDefinitions { } +export interface SMSService { +} + export interface SMSUserVerificationService { } +export interface SMSVerificationResponse { + requestId: string; +} + export interface Problem { instance: URI; type: URI; @@ -168,8 +212,4 @@ export interface Iterable { export type CardanoNetwork = "MAIN" | "PREPROD" | "PREVIEW" | "DEV"; -export type Channel = "SMS"; - -export type Provider = "TWILIO" | "AWS_SNS"; - -export type Status = "NOT_REQUESTED" | "PENDING" | "VERIFIED"; +export type VerificationStatus = "PENDING" | "VERIFIED"; diff --git a/ui/summit-2023/src/types/voting-app-types.ts b/ui/summit-2023/src/types/voting-app-types.ts index c54df5221..23b645f2e 100644 --- a/ui/summit-2023/src/types/voting-app-types.ts +++ b/ui/summit-2023/src/types/voting-app-types.ts @@ -1,6 +1,6 @@ /* tslint:disable */ /* eslint-disable */ -// Generated using typescript-generator version 3.2.1263 on 2023-09-12 11:56:10. +// Generated using typescript-generator version 3.2.1263 on 2023-09-18 21:28:15. export interface Either extends Value, Serializable { left: L; @@ -9,8 +9,8 @@ export interface Either extends Value, Serializable { } export interface L1MerkleCommitment { - votes: Vote[]; - root: MerkleElement; + signedVotes: CompactVote[]; + root: MerkleElement; eventId: string; } @@ -67,6 +67,9 @@ export interface Votes { votingPower: string; } +export interface VotesBuilder { +} + export interface LoginResult { accessToken: string; expiresAt: Date; @@ -113,6 +116,9 @@ export interface MerkleProofItemBuilder { export interface VoteReceiptBuilder { } +export interface VoteSerialisations { +} + export interface WellKnownPointWithProtocolMagic { wellKnownPointForNetwork?: Point; protocolMagic: number; @@ -125,6 +131,7 @@ export interface AbstractTimestampEntity { export interface Vote extends AbstractTimestampEntity { id: string; + idNumericHash: number; eventId: string; categoryId: string; proposalId: string; @@ -140,6 +147,7 @@ export interface VoteBuilder { export interface VoteMerkleProof extends AbstractTimestampEntity { voteId: string; + voteIdNumericHash: number; eventId: string; rootHash: string; l1TransactionHash: string; @@ -157,12 +165,14 @@ export interface CIP93Envelope { actionText: string; slot: string; data: T; + slotAsLong: number; + actionAsEnum?: Web3Action; } export interface CIP93EnvelopeBuilder { } -export interface LoginEnvelope { +export interface JwtLoginEnvelope { event: string; address: string; network: string; @@ -194,6 +204,7 @@ export interface VoteEnvelope { network: string; votedAt: string; votingPower?: string; + votedAtSlot: number; } export interface VoteEnvelopeBuilder { @@ -202,13 +213,20 @@ export interface VoteEnvelopeBuilder { export interface DefaultLoginService extends LoginService { } -export interface DefaultLoginService__Autowiring { +export interface DefaultLoginService__BeanDefinitions { +} + +export interface LoginService { } -export interface DefaultLoginService__BeanDefinitions { +export interface LoginSystemDetector { +} + +export interface LoginSystemDetector__BeanDefinitions { } export interface JwtAuthenticationToken extends AbstractAuthenticationToken { + stakeAddress: string; } export interface JwtFilter extends OncePerRequestFilter { @@ -216,9 +234,6 @@ export interface JwtFilter extends OncePerRequestFilter { servletContext: ServletContext; } -export interface JwtFilter__Autowiring { -} - export interface JwtFilter__BeanDefinitions { } @@ -235,7 +250,29 @@ export interface JwtService__Autowiring { export interface JwtService__BeanDefinitions { } -export interface LoginService { +export interface Web3AuthenticationToken extends AbstractAuthenticationToken { + details: Web3Details; +} + +export interface Web3Details { + stakeAddress: string; + event: EventDetailsResponse; + action: Web3Action; + network: CardanoNetwork; + cip30VerificationResult: Cip30VerificationResult; + envelope: CIP93Envelope<{ [index: string]: any }>; + signedWeb3Request: SignedWeb3Request; +} + +export interface Web3DetailsBuilder { +} + +export interface Web3Filter extends OncePerRequestFilter { + beanName: string; + servletContext: ServletContext; +} + +export interface Web3Filter__BeanDefinitions { } export interface BackendServiceBlockchainTransactionSubmissionService extends BlockchainTransactionSubmissionService { @@ -271,9 +308,6 @@ export interface JsonService__BeanDefinitions { export interface DefaultLeaderBoardService extends LeaderBoardService { } -export interface DefaultLeaderBoardService__Autowiring { -} - export interface DefaultLeaderBoardService__BeanDefinitions { } @@ -292,18 +326,12 @@ export interface MerkleProofSerdeService__BeanDefinitions { export interface VoteCommitmentService { } -export interface VoteCommitmentService__Autowiring { -} - export interface VoteCommitmentService__BeanDefinitions { } export interface VoteMerkleProofService { } -export interface VoteMerkleProofService__Autowiring { -} - export interface VoteMerkleProofService__BeanDefinitions { } @@ -346,9 +374,6 @@ export interface TransactionSubmissionService { export interface DefaultVoteService extends VoteService { } -export interface DefaultVoteService__Autowiring { -} - export interface DefaultVoteService__BeanDefinitions { } @@ -376,6 +401,11 @@ export interface Problem { export interface Serializable { } +export interface CompactVote { + coseSignature: string; + cosePublicKey?: string; +} + export interface MerkleElement { empty: boolean; } @@ -398,8 +428,8 @@ export interface Environment extends PropertyResolver { } export interface FilterConfig { - servletContext: ServletContext; filterName: string; + servletContext: ServletContext; initParameterNames: Enumeration; } @@ -407,31 +437,31 @@ export interface ServletContext { classLoader: ClassLoader; majorVersion: number; minorVersion: number; + defaultSessionTrackingModes: SessionTrackingMode[]; + effectiveSessionTrackingModes: SessionTrackingMode[]; + requestCharacterEncoding: string; + responseCharacterEncoding: string; contextPath: string; - effectiveMajorVersion: number; - effectiveMinorVersion: number; + sessionTimeout: number; + virtualServerName: string; + jspConfigDescriptor: JspConfigDescriptor; + sessionCookieConfig: SessionCookieConfig; + filterRegistrations: { [index: string]: FilterRegistration }; + servletRegistrations: { [index: string]: ServletRegistration }; + servletContextName: string; + initParameterNames: Enumeration; + serverInfo: string; /** * @deprecated */ - servlets: Enumeration; + servletNames: Enumeration; /** * @deprecated */ - servletNames: Enumeration; - serverInfo: string; - initParameterNames: Enumeration; - servletContextName: string; - servletRegistrations: { [index: string]: ServletRegistration }; - filterRegistrations: { [index: string]: FilterRegistration }; - sessionCookieConfig: SessionCookieConfig; - jspConfigDescriptor: JspConfigDescriptor; - virtualServerName: string; - sessionTimeout: number; + servlets: Enumeration; + effectiveMinorVersion: number; + effectiveMajorVersion: number; attributeNames: Enumeration; - responseCharacterEncoding: string; - effectiveSessionTrackingModes: SessionTrackingMode[]; - defaultSessionTrackingModes: SessionTrackingMode[]; - requestCharacterEncoding: string; } export interface OncePerRequestFilter extends GenericFilterBean { @@ -449,6 +479,31 @@ export interface AuthenticatedPrincipal { name: string; } +export interface EventDetailsResponse { + id: string; + finished: boolean; + notStarted: boolean; + active: boolean; + proposalsReveal: boolean; + allowVoteChanging: boolean; + highLevelEventResultsWhileVoting: boolean; + highLevelCategoryResultsWhileVoting: boolean; + categoryResultsWhileVoting: boolean; + votingEventType: VotingEventType; + categories: CategoryDetailsResponse[]; + eventInactive: boolean; +} + +export interface Cip30VerificationResult { + validationError?: ValidationError; + address?: any; + ed25519PublicKey: any; + ed25519Signature: any; + message: any; + cosePayload: any; + valid: boolean; +} + export interface URI extends Comparable, Serializable { } @@ -469,8 +524,8 @@ export interface Authentication extends Principal, Serializable { authenticated: boolean; authorities: GrantedAuthority[]; principal: any; - details: any; credentials: any; + details: any; } export interface CredentialsContainer { @@ -485,34 +540,34 @@ export interface Enumeration { export interface ClassLoader { } -export interface Servlet { - servletConfig: ServletConfig; - servletInfo: string; -} - -export interface ServletRegistration extends Registration { - mappings: string[]; - runAsRole: string; -} - -export interface FilterRegistration extends Registration { - servletNameMappings: string[]; - urlPatternMappings: string[]; +export interface JspConfigDescriptor { + jspPropertyGroups: JspPropertyGroupDescriptor[]; + taglibs: TaglibDescriptor[]; } export interface SessionCookieConfig { - domain: string; name: string; path: string; comment: string; httpOnly: boolean; secure: boolean; + domain: string; maxAge: number; } -export interface JspConfigDescriptor { - jspPropertyGroups: JspPropertyGroupDescriptor[]; - taglibs: TaglibDescriptor[]; +export interface FilterRegistration extends Registration { + urlPatternMappings: string[]; + servletNameMappings: string[]; +} + +export interface ServletRegistration extends Registration { + mappings: string[]; + runAsRole: string; +} + +export interface Servlet { + servletInfo: string; + servletConfig: ServletConfig; } export interface GenericFilterBean extends Filter, BeanNameAware, EnvironmentAware, EnvironmentCapable, ServletContextAware, InitializingBean, DisposableBean { @@ -527,19 +582,19 @@ export interface Base64URL extends Base64 { } export interface JWSHeader extends CommonSEHeader { - algorithm: JWSAlgorithm; base64URLEncodePayload: boolean; + algorithm: JWSAlgorithm; } export interface JWTClaimsSet extends Serializable { claims: { [index: string]: any }; - expirationTime: Date; - notBeforeTime: Date; issueTime: Date; + notBeforeTime: Date; + expirationTime: Date; audience: string[]; subject: string; - issuer: string; jwtid: string; + issuer: string; } export interface JWSObject extends JOSEObject { @@ -552,24 +607,21 @@ export interface JWSObject extends JOSEObject { export interface JWT extends Serializable { header: Header; jwtclaimsSet: JWTClaimsSet; - parsedParts: Base64URL[]; parsedString: string; + parsedParts: Base64URL[]; } -export interface ServletConfig { - servletContext: ServletContext; - initParameterNames: Enumeration; - servletName: string; -} - -export interface Registration { - name: string; - className: string; - initParameters: { [index: string]: string }; +export interface CategoryDetailsResponse { + id: string; + gdprProtection: boolean; + proposals: ProposalDetailsResponse[]; } export interface JspPropertyGroupDescriptor { buffer: string; + deferredSyntaxAllowedAsLiteral: string; + trimDirectiveWhitespaces: string; + errorOnUndeclaredNamespace: string; urlPatterns: string[]; elIgnored: string; pageEncoding: string; @@ -577,9 +629,6 @@ export interface JspPropertyGroupDescriptor { includePreludes: string[]; includeCodas: string[]; defaultContentType: string; - deferredSyntaxAllowedAsLiteral: string; - trimDirectiveWhitespaces: string; - errorOnUndeclaredNamespace: string; isXml: string; } @@ -588,6 +637,18 @@ export interface TaglibDescriptor { taglibLocation: string; } +export interface Registration { + name: string; + className: string; + initParameters: { [index: string]: string }; +} + +export interface ServletConfig { + servletContext: ServletContext; + initParameterNames: Enumeration; + servletName: string; +} + export interface Filter { } @@ -615,24 +676,24 @@ export interface Base64 extends Serializable { export interface JWK extends Serializable { keyStore: KeyStore; - algorithm: Algorithm; private: boolean; + x509CertSHA256Thumbprint: Base64URL; requiredParams: { [index: string]: any }; - keyOperations: KeyOperation[]; - x509CertURL: URI; + issueTime: Date; + notBeforeTime: Date; + expirationTime: Date; + x509CertChain: Base64[]; /** * @deprecated */ x509CertThumbprint: Base64URL; - x509CertChain: Base64[]; - expirationTime: Date; - notBeforeTime: Date; - issueTime: Date; + x509CertURL: URI; + keyOperations: KeyOperation[]; parsedX509CertChain: X509Certificate[]; - x509CertSHA256Thumbprint: Base64URL; keyType: KeyType; - keyID: string; keyUse: KeyUse; + keyID: string; + algorithm: Algorithm; } export interface JWSAlgorithm extends Algorithm { @@ -644,15 +705,15 @@ export interface JOSEObjectType extends Serializable { export interface CommonSEHeader extends Header { jwk: JWK; - x509CertURL: URI; + x509CertSHA256Thumbprint: Base64URL; + x509CertChain: Base64[]; /** * @deprecated */ x509CertThumbprint: Base64URL; - x509CertChain: Base64[]; - x509CertSHA256Thumbprint: Base64URL; - keyID: string; + x509CertURL: URI; jwkurl: URI; + keyID: string; } export interface JOSEObject extends Serializable { @@ -665,11 +726,16 @@ export interface JOSEObject extends Serializable { export interface Header extends Serializable { customParams: { [index: string]: any }; parsedBase64URL: Base64URL; - algorithm: Algorithm; - contentType: string; type: JOSEObjectType; - criticalParams: string[]; includedParams: string[]; + criticalParams: string[]; + algorithm: Algorithm; + contentType: string; +} + +export interface ProposalDetailsResponse { + id: string; + name: string; } export interface Comparable { @@ -686,14 +752,17 @@ export interface KeyStore { provider: { [index: string]: any }; } -export interface Algorithm extends Serializable { - name: string; - requirement: Requirement; -} - export interface X509Certificate extends Certificate, X509Extension { - subjectX500Principal: X500Principal; + signature: any; + basicConstraints: number; + version: number; issuerX500Principal: X500Principal; + subjectX500Principal: X500Principal; + keyUsage: boolean[]; + subjectAlternativeNames: any[][]; + notBefore: Date; + serialNumber: number; + notAfter: Date; extendedKeyUsage: string[]; issuerAlternativeNames: any[][]; sigAlgName: string; @@ -710,14 +779,6 @@ export interface X509Certificate extends Certificate, X509Extension { sigAlgOID: string; issuerUniqueID: boolean[]; subjectUniqueID: boolean[]; - signature: any; - basicConstraints: number; - version: number; - serialNumber: number; - notAfter: Date; - notBefore: Date; - keyUsage: boolean[]; - subjectAlternativeNames: any[][]; } export interface KeyType extends Serializable { @@ -729,6 +790,11 @@ export interface KeyUse extends Serializable { value: string; } +export interface Algorithm extends Serializable { + name: string; + requirement: Requirement; +} + export interface X500Principal extends Principal, Serializable { encoded: any; } @@ -748,9 +814,9 @@ export interface X509Extension { } export interface Key extends Serializable { - algorithm: string; encoded: any; format: string; + algorithm: string; } export type CardanoNetwork = "MAIN" | "PREPROD" | "PREVIEW" | "DEV"; @@ -769,7 +835,9 @@ export type VotingEventType = "USER_BASED" | "STAKE_BASED" | "BALANCE_BASED"; export type VotingPowerAsset = "ADA"; -export type Web3Action = "CAST_VOTE" | "VIEW_VOTE_RECEIPT" | "LOGIN"; +export type Web3Action = "CAST_VOTE" | "VIEW_VOTE_RECEIPT" | "LOGIN" | "IS_VOTE_CASTING_ALLOWED" | "IS_VOTE_CHANGING_ALLOWED" | "VOTED_ON"; + +export type LoginSystem = "JWT" | "CIP93"; export type FinalityScore = "LOW" | "MEDIUM" | "HIGH" | "VERY_HIGH" | "FINAL"; @@ -777,6 +845,8 @@ export type SessionTrackingMode = "COOKIE" | "URL" | "SSL"; export type State = "UNSIGNED" | "SIGNED" | "VERIFIED"; +export type ValidationError = "UNKNOWN" | "CIP8_FORMAT_ERROR" | "NO_PUBLIC_KEY"; + export type Origin = "JSON" | "STRING" | "BYTE_ARRAY" | "BASE64URL" | "JWS_OBJECT" | "SIGNED_JWT"; export type KeyOperation = "SIGN" | "VERIFY" | "ENCRYPT" | "DECRYPT" | "WRAP_KEY" | "UNWRAP_KEY" | "DERIVE_KEY" | "DERIVE_BITS"; diff --git a/ui/summit-2023/src/types/voting-ledger-follower-types.ts b/ui/summit-2023/src/types/voting-ledger-follower-types.ts index 8d9a1beab..0f9cd67e2 100644 --- a/ui/summit-2023/src/types/voting-ledger-follower-types.ts +++ b/ui/summit-2023/src/types/voting-ledger-follower-types.ts @@ -1,6 +1,6 @@ /* tslint:disable */ /* eslint-disable */ -// Generated using typescript-generator version 3.2.1263 on 2023-09-12 11:56:31. +// Generated using typescript-generator version 3.2.1263 on 2023-09-18 21:28:37. export interface Either extends Value, Serializable { left: L; @@ -156,13 +156,13 @@ export interface EventPresentation { proposalsRevealEpoch?: number; categories: CategoryPresentation[]; active: boolean; + highLevelCategoryResultsWhileVoting: boolean; + categoryResultsWhileVoting: boolean; + highLevelEventResultsWhileVoting: boolean; + proposalsReveal: boolean; notStarted: boolean; finished: boolean; - proposalsReveal: boolean; allowVoteChanging: boolean; - highLevelEventResultsWhileVoting: boolean; - categoryResultsWhileVoting: boolean; - highLevelCategoryResultsWhileVoting: boolean; } export interface EventPresentationBuilder { diff --git a/ui/summit-2023/src/types/voting-verification-app-types.ts b/ui/summit-2023/src/types/voting-verification-app-types.ts index 0b8985e4b..6ca8afb3a 100644 --- a/ui/summit-2023/src/types/voting-verification-app-types.ts +++ b/ui/summit-2023/src/types/voting-verification-app-types.ts @@ -1,6 +1,6 @@ /* tslint:disable */ /* eslint-disable */ -// Generated using typescript-generator version 3.2.1263 on 2023-09-12 11:56:49. +// Generated using typescript-generator version 3.2.1263 on 2023-09-18 21:28:54. export interface Either extends Value, Serializable { left: L;