Skip to content

Commit

Permalink
SHIBUI-2268
Browse files Browse the repository at this point in the history
Created controller and endpoint to fetch all the properties


Former-commit-id: a57f9b6
  • Loading branch information
chasegawa committed Aug 17, 2022
1 parent c2c601c commit 04c48ef
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package edu.internet2.tier.shibboleth.admin.ui.controller;

import edu.internet2.tier.shibboleth.admin.ui.service.ShibConfigurationService;
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.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/api/shib")
@Tags(value = {@Tag(name = "Shibboleth Properties")})
public class ShibPropertiesController {
@Autowired
private ShibConfigurationService service;

@GetMapping("/properties")
@Transactional(readOnly = true)
public ResponseEntity<?> getAll() {
return ResponseEntity.ok(service.getAll());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ public interface ShibConfigurationService {
List<String> getExistingPropertyNames();

void save(ShibConfigurationProperty prop);

List<ShibConfigurationProperty> getAll();
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ public List<String> getExistingPropertyNames() {
public void save(ShibConfigurationProperty prop) {
repository.save(prop);
}

@Override
public List<ShibConfigurationProperty> getAll() {
return repository.findAll();
}
}

0 comments on commit 04c48ef

Please sign in to comment.