You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add supports for multiple security schemes in http server (#1070)
* feat(http-binding): add supports for multiple security schemes
Note that this means that the server is able to expose Things with different
security requirements. For example, it is possibile to now have a Thing
with `nosec` security scheme and one with `basic` security scheme. As a
side effect, the OAuth example now works as explained in #873.
Fix#204#873
* refactor(binding-http/http-server): rename supportedSecuritySchemes
* refactor(binding-http/routes/common): rename utility functions
* fix(binding-http/routers): handle cors for no-thing paths
* fixup! fix(binding-http/routers): handle cors for no-thing paths
Copy file name to clipboardExpand all lines: packages/binding-http/README.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,9 +132,11 @@ let httpConfig = {
132
132
allowSelfSigned:true, // client configuration
133
133
serverKey:"privatekey.pem",
134
134
serverCert:"certificate.pem",
135
-
security: {
136
-
scheme:"basic", // (username & password)
137
-
},
135
+
security: [
136
+
{
137
+
scheme:"basic", // (username & password)
138
+
},
139
+
],
138
140
};
139
141
// add HTTPS binding with configuration
140
142
servient.addServer(newHttpServer(httpConfig));
@@ -182,7 +184,7 @@ The protocol binding can be configured using his constructor or trough servient
182
184
allowSelfSigned?:boolean; // Accept self signed certificates
183
185
serverKey?:string; // HTTPs server secret key file
184
186
serverCert?:string; // HTTPs server certificate file
185
-
security?:TD.SecurityScheme; //Security scheme of the server
187
+
security?:TD.SecurityScheme[]; //A list of possible security schemes to be used by things exposed by this servient.
186
188
baseUri?:string// A Base URI to be used in the TD in cases where the client will access a different URL than the actual machine serving the thing. [See Using BaseUri below]
187
189
middleware?:MiddlewareRequestHandler; // the MiddlewareRequestHandler function. See [Adding a middleware] section below.
188
190
}
@@ -225,9 +227,9 @@ The http protocol binding supports a set of security protocols that can be enabl
0 commit comments