From 6278b1d74c571e079c547fbdc55d7e5575d985f0 Mon Sep 17 00:00:00 2001 From: Tomas Rutkauskas Date: Thu, 12 Nov 2026 11:29:42 +0200 Subject: [PATCH] README fixes, MIT license GitHub can detect, SECURITY.md Co-Authored-By: Claude Opus 5.5 --- LICENSE.txt | 33 +++++++++++++++++++++------------ README.md | 27 +++++++++++++-------------- SECURITY.md | 21 +++++++++++++++++++++ 3 files changed, 55 insertions(+), 26 deletions(-) create mode 100644 SECURITY.md diff --git a/LICENSE.txt b/LICENSE.txt index dc40e32..ec1a2ae 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,12 +1,21 @@ -ConvertAPI -https://www.convertapi.com -(c) 2011-2018 Baltsoft - -ConvertAPI-Go -https://github.com/ConvertAPI/convertapi-go -Copyright (c) 2018 Tomas Rutkauskas - -The MIT License -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +MIT License + +Copyright (c) 2012-2026 ConvertAPI + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 950ccac..090f327 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,13 @@ packages you import are `github.com/ConvertAPI/convertapi-go/pkg` (package `conv You can get your free API token at https://www.convertapi.com/a/authentication ```go -config.Default = config.NewDefault(os.Getenv("api-token")) +config.Default = config.NewDefault("api-token") ``` ### File conversion Convert DOCX file to PDF example. -All supported formats and options can be found [here](https://www.convertapi.com/conversions). +All supported formats and options can be found [here](https://www.convertapi.com/api). ```go pdfRes := convertapi.ConvDef("docx", "pdf", param.NewPath("file", "test.docx", nil)) @@ -50,17 +50,17 @@ Other result operations: ```go // save all result files to folder -res.ToPath("/tmp") +pdfRes.ToPath("/tmp") // get second file in result -files, err := res.Files() +files, err := pdfRes.Files() secondFile := files[1] -// result implements Reader interface so it is possible to stream result -io.Copy(myReader, res) +// result implements the io.Reader interface, so you can stream it +io.Copy(myWriter, pdfRes) // get conversion cost -cost, err := res.Cost() +cost, err := pdfRes.Cost() ``` #### Convert remote file @@ -74,7 +74,7 @@ pptxRes := convertapi.ConvDef("pptx", "pdf", #### Additional conversion parameters ConvertAPI accepts extra conversion parameters depending on selected file formats. -All conversion parameters and explanations can be found [here](https://www.convertapi.com/conversions). +All conversion parameters and explanations can be found [here](https://www.convertapi.com/api). ```go jpgRes := convertapi.ConvDef("pdf", "jpg", @@ -88,7 +88,7 @@ jpgRes := convertapi.ConvDef("pdf", "jpg", ### User information -You can always check your remaining seconds programmatically by fetching [user information](https://www.convertapi.com/doc/user). +You can always check your conversion counts programmatically by fetching [user information](https://www.convertapi.com/docs/user-information). ```go user, err := convertapi.UserInfo(nil) @@ -99,7 +99,7 @@ conversionsConsumed := user.ConversionsConsumed ### Alternative domain How to set an alternative domain can be found in the [advanced example](https://github.com/ConvertAPI/convertapi-library-go/blob/main/examples/advanced/main.go). -Dedicated to the region [domain list](https://www.convertapi.com/doc/servers-location). +Dedicated to the region [domain list](https://www.convertapi.com/docs/servers-location). ### More examples @@ -127,14 +127,13 @@ package main import ( "fmt" - "os" "github.com/ConvertAPI/convertapi-go/pkg" "github.com/ConvertAPI/convertapi-go/pkg/config" ) func main() { - config.Default = config.NewDefault(os.Getenv("api-token")) + config.Default = config.NewDefault("api-token") if file, errs := convertapi.ConvertPath("test.docx", "/tmp/result.pdf"); errs == nil { fmt.Println("PDF file saved to: ", file.Name()) @@ -145,7 +144,7 @@ func main() { ``` This is the bare-minimum to convert a file using the ConvertAPI client, but you can do a great deal more with the ConvertAPI Go library. -Take special note that you should replace `api-token` with the token you obtained in item two of the pre-requisites. +Replace `api-token` with your API token from https://www.convertapi.com/a/authentication. ### Conversion Without Temporarily Storing Files on the ConvertAPI File Server @@ -161,5 +160,5 @@ Using `multipart` is much more efficient compared to JSON with base64 encoding. Please leave all comments, bugs, requests, and issues on the Issues page. We'll respond to your request ASAP! ### License -The ConvertAPI Go Library is licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php "Read more about the MIT license form") license. +The ConvertAPI Go Library is licensed under the [MIT](https://opensource.org/licenses/MIT) license. Refer to the [LICENSE](https://github.com/ConvertAPI/convertapi-library-go/blob/main/LICENSE.txt) file for more information. \ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..cd3d178 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security policy + +## Reporting a vulnerability + +Please do not report security vulnerabilities in public GitHub issues, discussions or pull requests. + +Report them privately on GitHub instead: open the [Security tab](https://github.com/ConvertAPI/convertapi-library-go/security) of this repository and click "Report a vulnerability", or go straight to [the report form](https://github.com/ConvertAPI/convertapi-library-go/security/advisories/new). Only you and the maintainers can see the report. + +Please include: + +- the version of the github.com/ConvertAPI/convertapi-go module and of Go you use; +- the steps to reproduce the issue, or a proof of concept; +- what an attacker could do with it. + +We will confirm that we received your report and keep you updated until it is fixed. Please give us reasonable time to release a fix before you disclose the issue publicly. + +You can use the same private route if you are not sure whether the issue is in this SDK or in the ConvertAPI service itself. + +## Supported versions + +Security fixes are released in the latest version of the [github.com/ConvertAPI/convertapi-go module](https://github.com/ConvertAPI/convertapi-library-go/releases). Please check that the issue still occurs with the latest version before you report it.