WIP: Page & /apps endpoints api stub #113

Manually merged
tonitch merged 4 commits from tonitch/front/pagesAPI into master 2024-03-16 14:45:06 +01:00
2 changed files with 11 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import ovh.herisson.Clyde.Tables.User;
import java.io.UnsupportedEncodingException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Calendar;
import java.util.Date;
@ -30,13 +31,10 @@ public class TokenService {
new SecureRandom().nextBytes(bytes);
for (int i = 0; i < bytes.length; i++) {
bytes[i] = (byte) (((bytes[i]+256)%256 %95+ 32));
while ((char)bytes[i] == ';'){
bytes[i] = new SecureRandom().generateSeed(1)[0];
}
}
// will never end up in the catch because of the way that SecureRandom.nextBytes is implemented
try {
return new String(bytes,"ISO_8859_1");
return new String(Base64.getEncoder().encode(bytes),"ISO_8859_1");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}

View File

@ -0,0 +1,9 @@
import { restGet } from './restConsumer.js'
export async function appList(){
return restGet("/apps")
}
export async function checkPage(page){
return restGet("/apps/" + page)
}