Add authentication

This commit is contained in:
2023-10-05 21:11:22 +08:00
parent 78de04713f
commit 8e5375ab30
24 changed files with 580 additions and 15 deletions

View File

@@ -1,17 +1,19 @@
package top.fatweb.api
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.springframework.boot.test.context.SpringBootTest
import top.fatweb.api.constants.SecurityConstants
import java.security.MessageDigest
import java.util.*
import top.fatweb.api.constant.SecurityConstants
@SpringBootTest
class FatWebApiApplicationTests {
@Test
fun contextLoads() {
SecurityConstants.jwtKey
}
@Test
fun removePrefixTest() {
assertEquals("12312", "Bearer 12312".removePrefix(SecurityConstants.tokenPrefix))
}
}