Class UserTokenController

java.lang.Object
eu.rarogsoftware.rarog.platform.plugins.pat.rest.UserTokenController

@RestController @PreAuthorize("hasAuthority(\'AUTH_ORGANIC\') and hasAuthority(\'TYPE_HUMAN\')") @RequestMapping(value="token/user", produces="application/json") public class UserTokenController extends Object
  • Constructor Details

  • Method Details

    • getCurrentUserTokens

      @GetMapping("my") public org.springframework.http.ResponseEntity<List<TokenControllerHelper.TokenDisplayData>> getCurrentUserTokens(@AuthenticationPrincipal StandardUser user, jakarta.servlet.http.HttpServletRequest request)
    • createToken

      @PostMapping("create") public org.springframework.http.ResponseEntity<TokenControllerHelper.TokenCreatedData> createToken(@AuthenticationPrincipal StandardUser user, @RequestParam(value="doNotTranslate",required=false,defaultValue="false") boolean doNotTranslate, @RequestBody UserTokenController.CreateTokenRequest createTokenRequest) throws TokenCreationException
      Throws:
      TokenCreationException
    • getTokenMetadata

      @GetMapping("create/meta") public org.springframework.http.ResponseEntity<TokenMetadata> getTokenMetadata(@AuthenticationPrincipal StandardUser standardUser)
    • getOtherUserTokens

      @GetMapping("{usernameOrUserId}/list") @PreAuthorize("hasAuthority(\'AUTH_ORGANIC\') and hasAuthority(\'TYPE_HUMAN\') and hasAuthority(\'ROLE_ADMIN\')") public org.springframework.http.ResponseEntity getOtherUserTokens(@PathVariable("usernameOrUserId") String usernameOrUserId, jakarta.servlet.http.HttpServletRequest request)
    • removeToken

      @DeleteMapping("{id}") public org.springframework.http.ResponseEntity removeToken(@PathVariable("id") Long tokenId, @AuthenticationPrincipal StandardUser user)