-
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.
Merged in feature/shibui-2268 (pull request #603)
Feature/shibui 2268 Approved-by: Dmitriy Kopylenko Approved-by: Bill Smith Former-commit-id: 105ca18483cddc45cb75d5953b9efb9f135efe2d
- Loading branch information
Showing
52 changed files
with
2,338 additions
and
125 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
57 changes: 57 additions & 0 deletions
57
...nternet2/tier/shibboleth/admin/ui/controller/AlgorithmFilterUiDefinitionController.groovy
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,57 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.controller | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper | ||
import edu.internet2.tier.shibboleth.admin.ui.jsonschema.JsonSchemaResourceLocation | ||
import edu.internet2.tier.shibboleth.admin.ui.jsonschema.JsonSchemaResourceLocationRegistry | ||
import edu.internet2.tier.shibboleth.admin.ui.service.JsonSchemaBuilderService | ||
import groovy.util.logging.Slf4j | ||
import io.swagger.v3.oas.annotations.tags.Tag | ||
import io.swagger.v3.oas.annotations.tags.Tags | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.http.ResponseEntity | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.RestController | ||
|
||
import javax.annotation.PostConstruct | ||
|
||
import static edu.internet2.tier.shibboleth.admin.ui.jsonschema.JsonSchemaLocationLookup.algorithmFilterSchema | ||
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR | ||
|
||
/** | ||
* Controller implementing REST resource responsible for exposing structure definition for algorithm format filter user | ||
* interface in terms of JSON schema. | ||
*/ | ||
@RestController | ||
@RequestMapping('/api/ui/AlgorithmFilter') | ||
@Slf4j | ||
@Tags(value = [@Tag(name = "ui")]) | ||
class AlgorithmFilterUiDefinitionController { | ||
|
||
@Autowired | ||
JsonSchemaResourceLocationRegistry jsonSchemaResourceLocationRegistry | ||
|
||
JsonSchemaResourceLocation jsonSchemaLocation | ||
|
||
@Autowired | ||
ObjectMapper jacksonObjectMapper | ||
|
||
@Autowired | ||
JsonSchemaBuilderService jsonSchemaBuilderService | ||
|
||
@GetMapping | ||
ResponseEntity<?> getUiDefinitionJsonSchema() { | ||
try { | ||
def parsedJson = jacksonObjectMapper.readValue(this.jsonSchemaLocation.url, Map) | ||
return ResponseEntity.ok(parsedJson) | ||
} catch (Exception e) { | ||
log.error(e.getMessage(), e) | ||
return ResponseEntity.status(INTERNAL_SERVER_ERROR).body([jsonParseError : e.getMessage(), sourceUiSchemaDefinitionFile: this.jsonSchemaLocation.url]) | ||
} | ||
} | ||
|
||
@PostConstruct | ||
void init() { | ||
this.jsonSchemaLocation = algorithmFilterSchema(this.jsonSchemaResourceLocationRegistry) | ||
} | ||
} |
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
36 changes: 36 additions & 0 deletions
36
...n/java/edu/internet2/tier/shibboleth/admin/ui/domain/AbstractAlgorithmIdentifierType.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,36 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.domain; | ||
|
||
import edu.internet2.tier.shibboleth.admin.ui.domain.AbstractXMLObject; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
import org.hibernate.envers.Audited; | ||
import org.opensaml.core.xml.XMLObject; | ||
import org.opensaml.xmlsec.encryption.AlgorithmIdentifierType; | ||
|
||
import javax.annotation.Nullable; | ||
import javax.persistence.Entity; | ||
|
||
@Entity | ||
@Audited | ||
@Getter | ||
@Setter | ||
@ToString | ||
@EqualsAndHashCode(callSuper = true) | ||
public abstract class AbstractAlgorithmIdentifierType extends AbstractXMLObject implements AlgorithmIdentifierType { | ||
private String algorithm; | ||
|
||
@Nullable | ||
@Override | ||
public XMLObject getParameters() { | ||
// implement? | ||
return null; | ||
} | ||
|
||
@Override | ||
public void setParameters(@Nullable final XMLObject newParameters) { | ||
// do nothing? | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
...nd/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/AlgorithmDigestMethod.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,29 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.domain; | ||
|
||
import lombok.EqualsAndHashCode; | ||
|
||
import javax.annotation.Nullable; | ||
import javax.persistence.Entity; | ||
|
||
@Entity(name = "DigestMethod") // for backwards compatibility instead of dealing with renaming the table | ||
@EqualsAndHashCode(callSuper = true) | ||
public class AlgorithmDigestMethod extends AbstractElementExtensibleXMLObject implements org.opensaml.saml.ext.saml2alg.DigestMethod { | ||
private String algorithm; | ||
|
||
public AlgorithmDigestMethod() {} | ||
|
||
public AlgorithmDigestMethod(String algorithm) { | ||
this.algorithm = algorithm; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public String getAlgorithm() { | ||
return this.algorithm; | ||
} | ||
|
||
@Override | ||
public void setAlgorithm(@Nullable String value) { | ||
this.algorithm = value; | ||
} | ||
} |
Oops, something went wrong.