File tree Expand file tree Collapse file tree 3 files changed +53
-1
lines changed
Expand file tree Collapse file tree 3 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 78137813 "securitySchemes" : {
78147814 "OAuth2" : {
78157815 "type" : " oauth2" ,
7816- "description" : " OAuth 2.0 authentication"
7816+ "description" : " OAuth 2.0 authentication" ,
7817+ "flows" : {
7818+ "authorizationCode" : {
7819+ "authorizationUrl" : " https://mastodon.example/oauth/authorize" ,
7820+ "tokenUrl" : " https://mastodon.example/oauth/token" ,
7821+ "scopes" : {
7822+ "read" : " Read access" ,
7823+ "write" : " Write access" ,
7824+ "follow" : " Follow/unfollow accounts" ,
7825+ "push" : " Push notifications"
7826+ }
7827+ },
7828+ "clientCredentials" : {
7829+ "tokenUrl" : " https://mastodon.example/oauth/token" ,
7830+ "scopes" : {
7831+ "read" : " Read access" ,
7832+ "write" : " Write access"
7833+ }
7834+ }
7835+ }
78177836 },
78187837 "BearerAuth" : {
78197838 "type" : " http" ,
Original file line number Diff line number Diff line change @@ -35,6 +35,25 @@ class OpenAPIGenerator {
3535 OAuth2 : {
3636 type : 'oauth2' ,
3737 description : 'OAuth 2.0 authentication' ,
38+ flows : {
39+ authorizationCode : {
40+ authorizationUrl : 'https://mastodon.example/oauth/authorize' ,
41+ tokenUrl : 'https://mastodon.example/oauth/token' ,
42+ scopes : {
43+ 'read' : 'Read access' ,
44+ 'write' : 'Write access' ,
45+ 'follow' : 'Follow/unfollow accounts' ,
46+ 'push' : 'Push notifications'
47+ }
48+ } ,
49+ clientCredentials : {
50+ tokenUrl : 'https://mastodon.example/oauth/token' ,
51+ scopes : {
52+ 'read' : 'Read access' ,
53+ 'write' : 'Write access'
54+ }
55+ }
56+ }
3857 } ,
3958 BearerAuth : {
4059 type : 'http' ,
Original file line number Diff line number Diff line change @@ -9,11 +9,24 @@ interface OpenAPIServer {
99 description ?: string ;
1010}
1111
12+ interface OAuthFlow {
13+ authorizationUrl ?: string ;
14+ tokenUrl : string ;
15+ refreshUrl ?: string ;
16+ scopes : Record < string , string > ;
17+ }
18+
1219interface OpenAPISecurityScheme {
1320 type : string ;
1421 scheme ?: string ;
1522 bearerFormat ?: string ;
1623 description ?: string ;
24+ flows ?: {
25+ implicit ?: OAuthFlow ;
26+ password ?: OAuthFlow ;
27+ clientCredentials ?: OAuthFlow ;
28+ authorizationCode ?: OAuthFlow ;
29+ } ;
1730}
1831
1932interface OpenAPIProperty {
@@ -95,6 +108,7 @@ export {
95108 OpenAPIInfo ,
96109 OpenAPIServer ,
97110 OpenAPISecurityScheme ,
111+ OAuthFlow ,
98112 OpenAPIProperty ,
99113 OpenAPISchema ,
100114 OpenAPIParameter ,
You can’t perform that action at this time.
0 commit comments