tim Rowledge uploaded a new version of WebClient-Help to project The Trunk: http://source.squeak.org/trunk/WebClient-Help-tpr.12.mcz
==================== Summary ====================
Name: WebClient-Help-tpr.12 Author: tpr Time: 9 April 2023, 6:10:02.643749 pm UUID: 5e15f5b1-6367-4806-b2e2-28f065c2a24c Ancestors: WebClient-Help-kfr.11
Update the WebServer help info a little. It has, after all, been the case that the SqueakSSL package is built in since Squeak 5, so we don't need to tell people to load it. Also added info on the useful #logAction: capablilty
=============== Diff against WebClient-Help-kfr.11 ===============
Item was changed: ----- Method: WebServerHelp class>>authentication (in category 'pages') ----- authentication "This method was automatically generated. Edit it using:" "WebServerHelp edit: #authentication" + <generated> + ^(HelpTopic - ^HelpTopic title: 'Authentication' contents: 'To add authentication you can use web server as follows:
+ WebServer default addService: ''/smalltalk'' action: + [:req| | action | + WebServer default authenticate: req realm: ''squeak'' methods: #(digest basic) do: + [action := (req fields at: ''get'' ifAbsent:['''']) asSymbol. + req send200Response: (Smalltalk perform: action) asString]]. - WebServer default addService: ''/smalltalk'' action:[:req| | action | - WebServer default authenticate: req realm: ''squeak'' methods: #(digest basic) do:[ - action := (req fields at: ''get'' ifAbsent:['''']) asSymbol. - req send200Response: (Smalltalk perform: action) asString. - ]. - ].
The above supports both digest as well as basic authentication for accessing the /smalltalk service. Let''s add a user so that we can access it:
WebServer default passwordAt: ''squeak'' realm: ''squeak'' put: ''squeak''.
The server does NOT store plain text passwords, but rather hashes. To be precise, it stores the ha1 term used in digest authentication which is the same hash produced by htdigest. We can now access the /smalltalk service by providing user name ''squeak'' and password ''squeak''.
(WebClient httpGet:''http://localhost:8080/smalltalk?get=platformName'') content.
Unfortunately, digest authentication can be slow since our MD5 implementation is rather pathetic. !! + ]style[(69 7 1 11 1 12 1 10 2 3 1 1 1 1 6 1 1 13 7 1 13 1 3 1 6 1 8 1 8 3 6 1 5 2 7 1 6 1 2 1 1 3 1 6 1 3 1 5 1 9 1 2 1 1 1 8 5 3 1 16 1 1 10 8 1 6 1 1 8 1 160 7 1 11 1 8 1 6 1 8 1 4 1 8 292 8 50 2 7 102),c000000126,,c000000126,,c126000126,,c000000126,,c000000126,cgray;,,cgray;,,cgray;,,cgray;,,c000000126,,c000000126,,c000000126,,c000000126,,c126000126,,c000000126,,c000000126,,c000000126,,c000000126,c000126000,cgray;,,b,,c126000126,c000000126,,c000000126,,c000000126,,c126000126,,c000000126,c126000000,c126000126,c126000000,c126000126,,c000000126,,c000000126,,c000000126,,c126000126,,c000000126,,cgray;,c126000126,,c000000126,c000126000,,c000000126,,c000000126,,c126000126,,c000000126,,c126000126,,c000000126,,c126000126,,c000000126,c126000126,,c000000126,!!' readStream nextChunkText) + key: #authentication; + shouldStyle: false; + yourself! - ]style[(58 11 7 1 11 1 12 1 7 2 3 1 1 1 1 6 1 1 13 7 1 13 1 3 1 6 1 8 1 8 3 6 1 5 2 3 1 4 6 1 2 1 1 3 1 6 1 3 1 5 1 9 1 2 1 1 1 8 5 3 1 16 1 1 10 8 1 6 1 1 8 4 1 6 146 11 7 1 11 1 8 1 6 1 8 1 4 1 8 2 278 12 8 50 2 7 2 100),cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,cblack;,c000000127,cgray;,cblack;,cgray;,cblack;,cgray;,cblack;,cgray;,cblack;,c000000127,cblack;,c000000127,cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,cblack;,c000000127,cblack;,c000000127,cblack;,c000000127,c000127000,cblack;,cgray;,cblack;,b,cblack;,c127000127,c000000127,cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,c127000000,c127000127,c127000000,c127000127,cblack;,c000000127,cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,cblack;,cgray;,c127000127,cblack;,c000000127,cblack;,c000127000,cblack;,,cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,cblack;,c127000127,cblack ;,c000000127,cblack;,c127000127,cblack;,,cblack;,c000000127,c127000127,cblack;,c000000127,cblack;,!!' readStream nextChunkText!
Item was changed: ----- Method: WebServerHelp class>>logging (in category 'pages') ----- logging "This method was automatically generated. Edit it using:" "WebServerHelp edit: #logging" + <generated> + ^(HelpTopic - ^HelpTopic title: 'Logging' contents: + 'WebServer supports request logging in common log format. In order to tell WebServer where to log to you can either give it a stream: - 'WebServer supports logging in common log format. In order to tell WebServer where to log to you can either give it a stream:
WebServer default accessLog: Transcript.
or alternatively a file name, for example:
WebServer default accessLog: ''/var/log/wsd/access_log''.
When used in the latter form, WebServer opens and closes the file for each log entry which provides additional robustness at the cost of some performance. + + WebServer also logs status info and error reports. The #log: method uses the logAction instVar - a block or message send - to display or otherwise save the info. The default logAction (WebServer>>#initialize) is simply to pass the info to the Transcript, but more sophisticated usage might include sending it to the ToothPick logger package or via an MQTT connection. !! + ]style[(145 7 1 10 69 7 1 10 1 25 527),c000000125,,c000000125,,c000000125,,c000000125,,c125000125,!!' readStream nextChunkText) + key: #logging; + shouldStyle: false; + yourself! - ]style[(126 11 7 1 10 12 46 11 7 1 10 1 25 1 157),cblack;,c000000127,cblack;,c000000127,cblack;,,cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,!!' readStream nextChunkText!
Item was changed: ----- Method: WebServerHelp class>>sslSupport (in category 'pages') ----- sslSupport "This method was automatically generated. Edit it using:" "WebServerHelp edit: #sslSupport" + <generated> + ^(HelpTopic - ^HelpTopic title: 'SSL/TLS Support' contents: + 'WebServer supports secure connections over SSL/TLS via SqueakSSL. With SqueakSSL installed, you can tell WebServer to use a particular cert which puts WebServer into secure mode. - 'WebServer supports secure connections over SSL/TLS via SqueakSSL. To install SqueakSSL, execute the following:
- (Installer ss project: ''SqueakSSL'') - install: ''SqueakSSL-Core''; - install: ''SqueakSSL-Tests''. - - If you have SqueakSSL installed, you can tell WebServer to use a particular cert which puts WebServer into secure mode. - The certName itself is platform dependent. On Unix, the cert name is the path to the .pem file with BOTH the cert and the private key, for example:
WebServer default certName: ''/home/user/certs/testcert.pem''.
On Windows, the cert name is a string that is matched against the certificate subject. Usually, the certificate subject includes your host name so that you would use:
WebServer default certName: ''secure.domain.com''.
Client certificate handling is currently not supported. !! + ]style[(340 7 1 9 1 31 182 7 1 9 1 19 59),c000000124,,c000000124,,c124000124,,c000000124,,c000000124,,c124000124,!!' readStream nextChunkText) + key: #sslSupport; + shouldStyle: false; + yourself! - ]style[(112 12 2 1 8 1 11 4 8 1 16 4 8 1 17 1 272 11 7 1 9 1 31 1 170 11 7 1 9 1 19 1 58),cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,cblack;,c127000127,cblack;,,cblack;,c000000125,cblack;,c000000125,cblack;,c125000125,cblack;,,cblack;,c000000125,cblack;,c000000125,cblack;,c125000125,cblack;,!!' readStream nextChunkText!
squeak-dev@lists.squeakfoundation.org