| Age | Commit message (Collapse) | Author |
|
=== Breaking changes
* lib/ssh: rename method Get to ScpGet and Put to ScpPut
This changes is to make clear that the methods to copy the files, either
from local or from remote, is using the "scp" through exec package,
not using the native SSH file transfer protocol.
While at it, use consistent log prefix for error message.
* ssh: rename the NewClient function to NewClientFromConfig
This is to differentiate it with x/crypto ssh package that have the same
function name.
* ssh: move the config parser to subpackage "config"
There are two reasons for moving to sub-package. First, the code for
parsing the ssh_config(5) take almost 99% of the lines in the ssh package.
Second, in case we want to submit the code to upstream,
golang.org/x/crypto, we need the package to be independent, less external
dependencies as possible.
* http: remove the Memfs field from Server
Now that Options field has been exported, we did not need to have
duplicate Memfs, so this field is removed in favor of Options.Memfs.
=== Enhancements
* websocket: export the Options field on the Server
Previously, the Options field is not exported to prevent user from
changing it once it set through NewServer() function.
This changes export the Options field to allow user of Server access its
values. We can create a method on server to return read-only options,
but that will over complicated the Server API.
* http: export the Options field on the Server
Previously, the Options field is not exported to prevent user from
changing it once it set through NewServer() function.
This changes export the Options field to allow user of Server access its
values. We can create a method on server to return read-only options,
but that will over complicated the Server API.
* websocket: store all the handshake headers to Handshake.Header
Previously only non-required headers are stored in the Handshake Header
field, while the required header value stored on their respective fields.
This commit store all request header key and values into the Header
field.
|
|
This changes is to make clear that the methods to copy the files, either
from local or from remote, is using the "scp" through exec package,
not using the native SSH file transfer protocol.
While at it, use consistent log prefix for error message.
|
|
This will allow seamless integration with the x/crypto/ssh Client type.
|
|
This is to differentiate it with x/crypto ssh package that have the same
function name.
|
|
There are two reasons for moving to sub-package. First, the code for
parsing the ssh_config(5) take almost 99% of the lines in the ssh package.
Second, in case we want to submit the code to upstream,
golang.org/x/crypto, we need the package to be independent, less external
dependencies as possible.
|
|
Now that Options field has been exported, we did not need to have
duplicate Memfs, so this field is removed in favor of Options.Memfs.
|
|
|
|
|
|
Previously, the Options field is not exported to prevent user from
changing it once it set throught NewServer() function.
This changes export the Options field to allow user of Server access its
values. We can create a method on server to return read-only options,
but that will over complicated the Server API.
|
|
Previously, the Options field is not exported to prevent user from
changing it once it set throught NewServer() function.
This changes export the Options field to allow user of Server access its
values. We can create a method on server to return read-only options,
but that will over complicated the Server API.
|
|
Previously only non-required headers are stored in the Handshake Header
field, while the required header value stored on their respective fields.
This commit store all request header key and values into the Header field.
|
|
Since the commit 909a6c722d we change the server initialization using
ServerOptions instead of port number only.
|
|
This release bring better functionalities, usability, and fixes for `xmlrpc`
package.
=== Breaking changes
* xmlrpc: change the Response to embed the errors.E
The errors.E contains code and message that also implement wrapping and
unwrapping error, so we can use the Response as error just like in
http.EndpointResponse.
* xmlrpc: write the XML header when marshaling request not on client
Previously, the XML header is added when sending the request using
client.
This commit changes it to write the header when marshaling the Request
instance.
* xmlrpc: replace Value field for struct with map of string and value
Previously, for param with type "struct" is represented by slice of
Member{Name,Value}.
This commit changes the Value field for "struct" to a map of string and
value for easily access the struct's member, without looping.
* xmlrpc: refactoring the parser for decoding XML-RPC request
This changes,
* method to parse XML-RPC request,
* change the Member field Value type to pointer to Value,
* change the Request field Params type to slice of pointer of Value,
* change the Response field Param type to pointer to Value,
* rename the Value fields from Members to StructMembers and Values to
ArrayValues
=== New features
* memfs: add function to Merge one or more instance of MemFS
The Merge function merge one or more instance of MemFS into single MemFS
instance.
If there are two instance of Node that have the same path, the last
instance will be ignored.
* xmlrpc: add method to marshal Response
* mlog: add function and method PrintStack
The PrintStack function or method will writes to error writers the stack
trace returned by debug.Stack.
=== Enhancements
* http: add request type for XML
Setting Endpoint's RequestType to RequestTypeXML will check the content
type of HTTP request to match with "text/xml".
=== Bug fixes
* memfs: set the field Parent on Node AddChild
* xmlrpc: convert the uint8 and uint16 as type Integer, and Uint as Double
Previously, uint8 and uint16 will be converted as Double, but those
types are in range of four bytes so it can still be handled by int32.
* xmlrpc: set client response IsFault when StatusCode >= 400
Previously, we set IsFault to true if the HTTP response code not equal to
200 only, which is not always correct.
This commit changes it to check any status code that is greater or equal
to 400.
* memfs: fix test by checking multiple content-types
On Arch Linux with Go tip, the content-type for JavaScript file is
"text/javascript". While on Ubuntu with Go 1.16 the content-type for
JavaScript file is "application/javascript".
|
|
This is to make sure that the returned value is not ignored with "_".
While at it, remove unused global constant `boolTrue`.
|
|
The Merge function merge one or more instance of MemFS into single MemFS
instance.
If there are two instance of Node that have the same path, the last
instance will be ignored.
|
|
|
|
Explain the fields for Options on the first example and fix the field
Root.
|
|
Previously, uint8 and uint16 will be converted as Double, but those
types are in range of four bytes so it can still be handled by int32.
|
|
The errors.E contains code and message that also implement wrapping and
unwrapping error, so we can use the Response as error just like in
http.EndpointResponse.
|
|
This is to make the Request or Response format consistent and to make
test working as expected.
|
|
Previously, we set IsFault to true if the HTTP response code not equal to
200 only, which is not always correct.
This commit changes it to check any status code that is greater or equal
to 400.
|
|
|
|
Previously, the XML header is added when sending the request using
client.
This commit changes it to write the header when marshaling the Request
instance.
|
|
Previously, for param with type "struct" is represented by slice of
Member{Name,Value}.
This commit changes the Value field for "struct" to a map of string and
value for easily access the struct's member, without looping.
|
|
This changes,
* method to parse XML-RPC request,
* change the Member field Value type to pointer to Value,
* change the Request field Params type to slice of pointer of Value,
* change the Response field Param type to pointer to Value,
* rename the Value fields from Members to StructMembers and Values to
ArrayValues
|
|
Setting Endpoint's RequestType to RequestTypeXML will check the content
type of HTTP request to match with "text/xml".
|
|
On Arch Linux with Go tip, the content-type for JavaScript file is
"text/javascript". While on Ubuntu with Go 1.16 the content-type for
JavaScript file is "application/javascript".
|
|
The PrintStack function or method will writes to error writers the stack
trace returned by debug.Stack.
|
|
In commit 25b6e78dd we add new line to error message, so this comment
does not applicable anymore.
|
|
|
|
=== New features
* math/big: add method Add, IsLess, IsGreater, and Scan on Int
The Add method simplify addition of one value to current Int.
The IsLess and IsGreater method simplify comparing Int with any value.
The Scan method allow the Int to be used on sql Scan().
* math/big: add method IsZero on Int
The IsZero method will return true if the current i value is zero.
* big: extends the standard big.Int
The standard big.Int does not implement sql/driver.Valuer interface,
which make it not usable when querying or doing update/insert with
database.
This commit extend the big.Int and simplify creating new Int from any
values using NewInt().
Also, make it support marshal/unmarshal JSON
=== Enhancements
* sql: make the column filename on table _migration as primary key
This will allow deleting the record by filename instead of requiring
all columns.
* http: add the Total field to EndpointResponse
The Total field contains the total number of all records, while the
Count fields only contains the total number of records in Data.
* http: add field Page to EndpointResponse
The page field contains the requested page on current response.
If page is from request then the offset will be set to page times limit.
While at it, move the field comment to its declaration.
* big: allow creating new Rat from uint64 and *big.Int
* ssh: check for empty private key file on Get and Put
If the private key file is empty, skip it for being added as parameter
of scp command. This is to prevent warning message on user side.
=== Chores
* memfs: update the test ContentType for JavaScript files
The latest Go set the content type for JavaScript file as
"text/javascript; charset=utf-8", not "application/javascript".
* paseto: replace le64() function with binary.Write()
The le64() return the string representation of uint64 in little endian,
which is basically binary.Write with parameter output buffer,
LittleEndian, and input value.
|
|
The latest Go set the content type for JavaScript file as
"text/javascript; charset=utf-8", not "application/javascript".
|
|
This will allow deleting the record by filename instead of requiring
all columns.
|
|
The Add method simplify addition of one value to current Int.
The IsLess and IsGreater method simplify comparing Int with any value.
The Scan method allow the Int to be used on sql Scan().
|
|
The IsZero method will return true if the current i value is zero.
|
|
|
|
|
|
The le64() return the string representation of uint64 in little endian,
which is basically binary.Write with parameter output buffer,
LittleEndian, and input value.
|
|
The Total field contains the total number of all records, while the
Count fields only contains the total number of records in Data.
|
|
The standard big.Int does not implement sql/driver.Valuer interface,
which make it not usable when querying or doing update/insert with
database.
This commit extend the big.Int and simplify creating new Int from any
values using NewInt().
|
|
The page field contains the requested page or current response.
If page is from request then the offset will be set to page times limit.
While at it, move the field comment to its declaration.
|
|
|
|
|
|
If the private key file is empty, skip it for being added as parameter
of scp command. This is to prevent warning message on user side.
|
|
Set the minimum Go version to 1.16
Commit 4cdd6b01c1 "http: add method to generate standard HTTP request
on Client" use the io.NopCloser thats only available in Go 1.16. Either
we move backward by replacing it with ioutil.NopCloser or we move forward
by setting the minimum Go version to 1.16.
We choose to move forward.
|
|
Commit 4cdd6b01c1 "http: add method to generate standard HTTP request
on Client" use the io.NopCloser thats only available in Go 1.16. Either
we move backward by replacing it with ioutil.NopCloser or we move forward
by setting the minimum Go version to 1.16.
We choose to move forward.
|
|
=== Breaking changes
* all: refactoring the test.Assert and test.AssertBench signature
Previously, the test.Assert and test.AssertBench functions has the
boolean parameter to print the stack trace of test in case its not equal.
Since this parameter is not mandatory and its usually always set to
"true", we remove them from function signature to simplify the call
to Assert and AssertBench.
* all: refactoring http.Client methods signature
Previously, parameters to method Delete, Get, Post, PostForm, PostFormData,
PostJSON, Put, and PutJSON are in the following order:
(headers, path, params)
This is sometimes confusing. To make it better and works with format
of HTTP request header,
METHOD PATH
HEADERS
PARAMS
we move the path to the first parameter and headers as the second
parameter, so the call to client methods would be
(path, headers, params)
* http: remove parameter contentType on Client method Put
Since one can set the Content-Type in parameter headers, this parameter is
become redundant.
=== New features
* http: add method to generate standard HTTP request on Client
The GenerateHttpRequest method generate http.Request instance from
method, path, requestType, headers, and params.
For HTTP method GET, CONNECT, DELETE, HEAD, OPTIONS, or TRACE; the params
value should be nil or url.Values.
If its url.Values, then the params will be encoded as query parameters.
For HTTP method is PATCH, POST, or PUT; the params will converted based on
requestType rules below,
* If requestType is RequestTypeQuery and params is url.Values it will be
added as query parameters in the path.
* If requestType is RequestTypeForm and params is url.Values it will be
added as URL encoded in the body.
* If requestType is RequestTypeMultipartForm and params type is
map[string][]byte, then it will be converted as multipart form in the
body.
* If requestType is RequestTypeJSON and params is not nil, the params will
be encoded as JSON in body.
* ssh: ask for passphrase if private key is encrypted on generateSigners
In case the private key defined in IdentityFile is encrypted, prompt
for the passphrase on the screen and read it from stdin using
terminal.ReadPassword().
This changes also remove call to generateSigners on postConfig(),
instead invoke it from NewClient() to minimize multiple calls to
generateSigners().
* ssh: use the SSH agent to authenticate on NewClient
Previously, the client use the IdentityFile on ConfigSection to
Authenticate with the remote SSH server. In case the IdentityFile is
Encrypted with passphrase, each time NewClient is invoked it will ask
For passphrase.
To minimize inputing the passphrase, we check if current use run the
SSH agent through SSH_AUTH_SOCK environment variable and use the agent
To generate signers.
This method need manual key added by user to SSH agent before calling
NewClient to make it works.
=== Enhancements
* xmlrpc: add debug statements to print request and response
The debug level is set minimum to 3. If its set it will print the
request and response to standard output.
|
|
The handleClose is a function that will be called when client receive
control CLOSE frame from server. Default handle is to response
with control CLOSE frame with the same payload.
This field is not exported, and only defined to allow testing.
|
|
Previously, the client use the IdentityFile on ConfigSection to
authenticate with the remote SSH server. In case the IdentityFile is
encrypted with passphrase, each time NewClient is invoked it will ask
for passphrase.
To minimize inputing the passphrase, we check if current use run the
SSH agent through SSH_AUTH_SOCK environment variable and use the agent
to generate signers.
This method need manual key added by user to SSH agent before calling
NewClient to make it works.
|
|
In case the private key defined in IdentityFile is encrypted, prompt
for the passphrase on the screen and read it from stdin using
term.ReadPassword().
This changes also remove call to generateSigners on postConfig(),
instead invoke it from NewClient() to minimize multiple calls to
generateSigners().
|