This file contains hidden or 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
| suspend fun hasModerationLabels( | |
| uid: String, | |
| filename: String, | |
| ): Boolean { | |
| // https://docs.aws.amazon.com/rekognition/latest/dg/moderation.html | |
| try { | |
| val key = "messenger/$uid/$filename" |
This file contains hidden or 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
| suspend fun FilePart.toBytes(): ByteArray { | |
| val bytesList: List<ByteArray> = this.content() | |
| .flatMap { dataBuffer -> Flux.just(dataBuffer.asByteBuffer().array()) } | |
| .collectList() | |
| .awaitSingle() | |
| val byteStream = ByteArrayOutputStream() | |
| bytesList.forEach { bytes -> byteStream.write(bytes) } | |
| return byteStream.toByteArray() | |
| } |
This file contains hidden or 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
| @Configuration | |
| class OpenAPIConfig { | |
| @Bean | |
| fun api(): OpenAPI = OpenAPI() | |
| .components( | |
| Components() | |
| .addSecuritySchemes( | |
| "Access Token", | |
| SecurityScheme() |
This file contains hidden or 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
| import javax.persistence.AttributeConverter | |
| import javax.persistence.Converter | |
| @Converter | |
| class StringSetConverter : AttributeConverter<Set<String>, String> { | |
| companion object { | |
| private const val SPLIT_CHAR = ";" | |
| } |
This file contains hidden or 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
| ssh-keygen -m PEM -t rsa -b 4096 -C "tester@tester.com" |