Skip to content

Commit 70e0eed

Browse files
committed
GH-200 Fix typo in ClientCredentials flow
1 parent 8b3f86a commit 70e0eed

File tree

3 files changed

+8
-3
lines changed
  • examples/javalin-gradle-kotlin/src/main/java/io/javalin/openapi/plugin/test
  • openapi-specification/src/main/kotlin/io/javalin/openapi

3 files changed

+8
-3
lines changed

examples/javalin-gradle-kotlin/src/main/java/io/javalin/openapi/plugin/test/JavalinTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
import com.fasterxml.jackson.databind.node.TextNode;
44
import io.javalin.Javalin;
55
import io.javalin.http.Context;
6+
import io.javalin.http.CreatedResponse;
67
import io.javalin.http.Handler;
78
import io.javalin.openapi.ApiKeyAuth;
89
import io.javalin.openapi.BasicAuth;
910
import io.javalin.openapi.BearerAuth;
11+
import io.javalin.openapi.ClientCredentials;
1012
import io.javalin.openapi.CookieAuth;
1113
import io.javalin.openapi.Custom;
1214
import io.javalin.openapi.CustomAnnotation;
@@ -113,7 +115,10 @@ public static void main(String[] args) {
113115
.withSecurityScheme("OAuth2", new OAuth2("This API uses OAuth 2 with the implicit grant flow.")
114116
.withFlow(new ImplicitFlow("https://api.example.com/oauth2/authorize")
115117
.withScope("read_pets", "read your pets")
116-
.withScope("write_pets", "modify pets in your account")))
118+
.withScope("write_pets", "modify pets in your account")
119+
)
120+
.withFlow(new ClientCredentials("https://api.example.com/credentials/authorize"))
121+
)
117122
.withGlobalSecurity(new Security("OAuth2")
118123
.withScope("write_pets")
119124
.withScope("read_pets"))

openapi-specification/src/main/kotlin/io/javalin/openapi/Security.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,5 @@ class ClientCredentials @JvmOverloads constructor(
8989
val tokenUrl: String,
9090
override val scopes: MutableMap<String, String> = mutableMapOf()
9191
) : OAuth2Flow<ClientCredentials> {
92-
override val flowType: String = "clientCredentials "
92+
override val flowType: String = "clientCredentials"
9393
}

wiki

Submodule wiki updated from 5f13445 to dfbbc8d

0 commit comments

Comments
 (0)