forked from cdos-rla/colorado-rla
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from DemocracyDevelopers/74-get-assertions-en…
…dpoint 74 get assertions endpoint
- Loading branch information
Showing
10 changed files
with
680 additions
and
22 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
82 changes: 65 additions & 17 deletions
82
...-project/src/main/java/au/org/democracydevelopers/corla/endpoint/EstimateSampleSizes.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 |
---|---|---|
@@ -1,25 +1,73 @@ | ||
/* | ||
Democracy Developers IRV extensions to colorado-rla. | ||
package au.org.democracydevelopers.corla.endpoint; | ||
|
||
@copyright 2024 Colorado Department of State | ||
import spark.Request; | ||
import spark.Response; | ||
import us.freeandfair.corla.asm.ASMEvent; | ||
import us.freeandfair.corla.endpoint.AbstractDoSDashboardEndpoint; | ||
|
||
These IRV extensions are designed to connect to a running instance of the raire | ||
service (https://github.com/DemocracyDevelopers/raire-service), in order to | ||
generate assertions that can be audited using colorado-rla. | ||
import org.apache.log4j.LogManager; | ||
import org.apache.log4j.Logger; | ||
|
||
The colorado-rla IRV extensions are free software: you can redistribute it and/or modify it under the terms | ||
of the GNU Affero General Public License as published by the Free Software Foundation, either | ||
version 3 of the License, or (at your option) any later version. | ||
/** | ||
* Non-functional stub. | ||
*/ | ||
public class EstimateSampleSizes extends AbstractDoSDashboardEndpoint { | ||
|
||
The colorado-rla IRV extensions are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
See the GNU Affero General Public License for more details. | ||
/** | ||
* Class-wide logger | ||
*/ | ||
private static final Logger LOGGER = LogManager.getLogger(EstimateSampleSizes.class); | ||
|
||
You should have received a copy of the GNU Affero General Public License along with | ||
raire-service. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
/** | ||
* The event to return for this endpoint. | ||
*/ | ||
private final ThreadLocal<ASMEvent> my_event = new ThreadLocal<ASMEvent>(); | ||
|
||
package au.org.democracydevelopers.corla.endpoint; | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public EndpointType endpointType() { | ||
return EndpointType.GET; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String endpointName() { | ||
return "/estimate-sample-sizes"; | ||
} | ||
|
||
/** | ||
* @return STATE authorization is necessary for this endpoint. | ||
*/ | ||
public AuthorizationType requiredAuthorization() { | ||
return AuthorizationType.STATE; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
protected ASMEvent endpointEvent() { | ||
return my_event.get(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
protected void reset() { | ||
my_event.set(null); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String endpointBody(final Request the_request, final Response the_response) { | ||
return my_endpoint_result.get(); | ||
} | ||
|
||
public class EstimateSampleSizes { | ||
} |
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
Oops, something went wrong.