33 < head >
44 < meta charset ="utf-8 ">
55 < meta name ="viewport " content ="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes ">
6- < script type ="module " src ="https://unpkg.com/rapidoc/dist/rapidoc-min.js "> </ script >
7- < link href ="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;600&family=Roboto+Mono&display=swap " rel ="stylesheet ">
8- < style >
9- .size { width : 100px ; height : 30px ; font-size : 13px ; margin : 0 2px ; padding : 0 8px ; border-radius : 2px ; outline : none; color : # fff ;}
10- .txt {background-color : # 2e2e2e ; border : 1px solid # 2069e0 ;}
11- .table { border : 1px solid # 444 ; border-collapse : collapse;}
12- .table td { font-size : 12px ; font-family : 'Roboto Mono' ; border : 1px solid # 444 ; padding : 8px ;}
13- .table th { font-size : 11px ; font-family : 'Open Sans' ; border : 1px solid # 444 ; padding : 8px ; background : # 222 ;}
14- datalist {
15- background-color : # 222 ;
16- border : 1px solid # 2069e0 ;
17- }
18- </ style >
6+ < script src ="./load-rapidoc-and-other-common-scripts.js "> </ script >
197 </ head >
8+ < style >
9+ table {
10+ padding : 8px ;
11+ }
12+ th {
13+ height : 36px ;
14+ background-color : rgba (0 , 0 , 0 , 0.2 );
15+ text-align : left
16+ }
17+ tr {
18+ height : 28px ;
19+ }
20+
21+ </ style >
2022 < body >
2123 < rapi-doc id ="thedoc "
2224 spec-url ="../specs/auth.yaml "
@@ -36,23 +38,26 @@ <h3>Programmatically Applying Security and Setting a API Server</h3>
3638 < div style ="margin:24px 0 8px 0 ">
3739 RapiDoc provides you with two helper methods which you can use to supply security keys programatically. You can use one of these method based on the security scheme type
3840 </ div >
39- < table class ="table " style ="border:1px solid #444; font-family:'Roboto Mono'; ">
40- < tr > < th > SCHEME-TYPE</ th > < th > METHOD USED TO UPDATE</ th > </ tr >
41- < tr > < td > basic</ td > < td > setHttpUserNameAndPassword('http-basic', 'newUserName', 'newPassword')</ td > </ tr >
42- < tr > < td > other than basic</ td > < td style ="border-bottom: 1px dashed #383838; " rowspan ="3 "> setApiKey('api_key1', 'newApiToken')</ td > </ tr >
41+ < table class ="table " style ="border:1px solid #444;width:100% ">
42+ < tr > < th style ="width:180px; height: 36px;
43+ background-color: rgba(0, 0, 0, 0.2);
44+ text-align: left; "> SCHEME-TYPE</ th > < th > METHOD USED TO UPDATE</ th > </ tr >
45+ < tr > < td > basic</ td > < td class ="mono "> setHttpUserNameAndPassword('http-basic', 'newUserName', 'newPassword')</ td > </ tr >
46+ < tr > < td > other than basic</ td > < td class ="mono " rowspan ="3 "> setApiKey('api_key1', 'newApiToken')</ td > </ tr >
4347 </ table >
4448
4549 < div style ="margin:24px 0 8px 0 ">
4650 The table below list all the scurity schemes included in this spec. Check the corrosponding method that can be used to supply an access-token
4751 </ div >
48- < table class ="table " style ="border:1px solid #444; font-family:'Roboto Mono' ">
49- < tr > < th > SECURITY SCHEME</ th > < th > SCHEME TYPE</ th > < th > METHOD USED TO UPDATE</ th > </ tr >
50- < tr > < td > http-basic</ td > < td > basic</ td > < td > setHttpUserNameAndPassword('http-basic', 'newUserName', 'newPassword')</ td > </ tr >
51- < tr > < td > http-bearer</ td > < td > bearer</ td > < td > setApiKey('http-bearer', 'newToken')</ td > </ tr >
52- < tr > < td > api_key1</ td > < td > < span style ="color:#777 "> (not-specified)</ span > </ td > < td > setApiKey('api_key1', 'newToken')</ td > </ tr >
53- < tr > < td > api_key2</ td > < td > < span style ="color:#777 "> (not-specified)</ span > </ td > < td > setApiKey('api_key2', 'newToken')</ td > </ tr >
54- < tr > < td > ms-oauth</ td > < td > < span style ="color:#777 "> (not-specified)</ span > </ td > < td > setApiKey('ms-oauth', 'newToken')</ td > </ tr >
55- < tr > < td > api_key_cookie</ td > < td > < span style ="color:#777 "> (not-specified)</ span > </ td >
52+ < table class ="table " style ="border:1px solid #444; width:100% ">
53+ < tr > < th style ="width:180px "> SECURITY SCHEME</ th > < th > SCHEME TYPE</ th > < th > METHOD USED TO UPDATE</ th > </ tr >
54+ < tr > < td > http-basic</ td > < td > basic</ td > < td class ="mono "> setHttpUserNameAndPassword('http-basic', 'newUserName', 'newPassword')</ td > </ tr >
55+ < tr > < td > http-bearer</ td > < td > < span style ="color:#777 "> (not-specified)</ span > </ td > < td class ="mono "> setApiKey('http-bearer-a', 'newToken')</ td > </ tr >
56+ < tr > < td > http-bearer</ td > < td > < span style ="color:#777 "> (not-specified)</ span > </ td > < td class ="mono "> setApiKey('http-bearer-b', 'newToken')</ td > </ tr >
57+ < tr > < td > api_key1 </ td > < td > < span style ="color:#777 "> (not-specified)</ span > </ td > < td class ="mono "> setApiKey('api_key1', 'newToken')</ td > </ tr >
58+ < tr > < td > api_key2 </ td > < td > < span style ="color:#777 "> (not-specified)</ span > </ td > < td class ="mono "> setApiKey('api_key2', 'newToken')</ td > </ tr >
59+ < tr > < td > ms-oauth </ td > < td > < span style ="color:#777 "> (not-specified)</ span > </ td > < td class ="mono "> setApiKey('ms-oauth', 'newToken')</ td > </ tr >
60+ < tr > < td > api_key_cookie</ td > < td > < span style ="color:#777 "> (not-specified)</ span > </ td >
5661 < td > < span style ="color:#777 "> (wont work as this scheme sends api-key in a cookie, and rapidoc dont create/read cookies)</ span > </ td >
5762 </ tr >
5863 </ table >
@@ -71,22 +76,23 @@ <h3>Programmatically Applying Security and Setting a API Server</h3>
7176 </ td >
7277 </ tr >
7378 < tr >
74- < td > API Key</ td >
79+ < td > HTTP Bearer / API Key</ td >
7580 < td >
7681 < select class ='size txt ' style ="width:138px " id ='api-security-scheme-id ' placeholder ='Security Scheme ID '>
7782 < option value ="api_key1 "> api_key1</ option >
7883 < option value ="api_key2 "> api_key2</ option >
79- < option value ="http-bearer "> http-bearer</ option >
84+ < option value ="http-bearer-a "> Bearer token-a</ option >
85+ < option value ="http-bearer-b "> Bearer token-b</ option >
8086 < option value ="ms-oauth "> ms-oauth</ option >
8187 < option value ="invalid-key "> invalid-key</ option >
8288 </ select >
8389
84- < input class ='size txt ' id ='api-key-value ' type ='text ' value ="new-token " placeholder ='API Key Value ' spellcheck ='false ' >
90+ < input class ='txt ' style =" width:225px " id ='api-key-value ' type ='text ' value ="new-token " placeholder ='API Key Value ' spellcheck ='false ' >
8591 < button class ='size btn ' style ="display: inline; " onclick ='setSecurity(event, "apikey") '> Apply</ button >
8692 </ td >
8793 </ tr >
8894 < tr >
89- < td colspan ="2 "> < button class ='size btn ' style ="width:200px " onclick ='clearSecurityKeys(event) '> Clear all Keys</ button > </ td >
95+ < td colspan ="2 "> < button class ='size btn ' style ="width:200px; margin:auto " onclick ='clearSecurityKeys(event) '> Clear all Keys</ button > </ td >
9096 </ tr >
9197 </ table >
9298 < div style ="margin:32px 0 16px 0; color:#777; font-weight:bold ">
0 commit comments