This file contains 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
package org.example; | |
import org.bouncycastle.asn1.x500.X500Name; | |
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; | |
import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; | |
import org.bouncycastle.jce.provider.BouncyCastleProvider; | |
import org.bouncycastle.operator.ContentSigner; | |
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; | |
import org.bouncycastle.util.io.pem.PemObject; | |
import org.bouncycastle.util.io.pem.PemWriter; |
This file contains 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
{ | |
"sub": "admin", | |
"iss": "https://localhost:9095/apikey", | |
"iat": 1595152875, | |
"jti": "22362268-e74a-44de-ac9c-2c3ae71653b9", | |
"keytype": "PRODUCTION", | |
"allowedAPIs": [ | |
{ | |
"name": "PizzaShackAPI", | |
"version": "1.0.0" |
This file contains 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
# The API Key authentication settings. | |
[apikey.tokenConfigs] | |
issuer="https://localhost:9095/apikey" | |
audience="http://org.wso2.apimgt/gateway" | |
certificateAlias="ballerina" | |
# Validate the Allowed APIs. | |
validateAllowedAPIs=true | |
[apikey.issuer] | |
[apikey.issuer.tokenConfig] |
This file contains 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
securityDefinitions: | |
petstore_auth: | |
... | |
api_key: | |
type: "apiKey" | |
name: "petstore_key" # Change the header name | |
in: "header" |
This file contains 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
# Resource Level | |
paths: | |
"/*": | |
get: | |
responses: | |
'200': | |
description: OK | |
x-wso2-application-security: | |
security-types: | |
- apiKey |
This file contains 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
... | |
components: | |
securitySchemes: | |
apiKey: | |
type: apiKey | |
in: header # Can be header or query | |
name: X-API-KEY # Can be any name | |
... |
This file contains 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
# API Key Security Token Service(STS) configurations | |
[apikey.issuer] | |
# API Key STS token configurations | |
[apikey.issuer.tokenConfig] | |
enabled=true | |
keyStorePath="${mgw-runtime.home}/runtime/bre/security/ballerinaKeystore.p12" | |
keyStorePassword="ballerina" | |
issuer="https://localhost:9095/apikey" | |
certificateAlias="ballerina" | |
# validity time in seconds for the API Key. -1 is to indicate unlimited time |
This file contains 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
<payloadFactory media-type="xml"> | |
<format> | |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> | |
<soapenv:Body> | |
<root xmlns=""> | |
<grant_type>client_credentials</grant_type> | |
<scope>demo_scope</scope> | |
</root> | |
</soapenv:Body> | |
</soapenv:Envelope> |
This file contains 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
#swagger-editor { | |
font-size: 1.3em; | |
} | |
.container { | |
height: 100%; | |
max-width: 880px; | |
margin-left: auto; | |
margin-right: auto; | |
} |
This file contains 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
logContent() { | |
const content = window.localStorage.getItem('swagger-editor-content'); | |
console.log(content); | |
} |
NewerOlder