{"id":16540769,"url":"https://github.com/dominicbreuker/tinyaws","last_synced_at":"2026-05-13T23:32:17.383Z","repository":{"id":77542896,"uuid":"602245547","full_name":"DominicBreuker/tinyaws","owner":"DominicBreuker","description":"PoC for a Go AWS API client not based on the official SDK","archived":false,"fork":false,"pushed_at":"2023-02-15T20:00:33.000Z","size":8,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T22:41:50.054Z","etag":null,"topics":["aws"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DominicBreuker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-15T19:58:04.000Z","updated_at":"2023-08-13T20:06:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa6105b7-5f84-485c-b4a9-975f9aaf3cf5","html_url":"https://github.com/DominicBreuker/tinyaws","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DominicBreuker/tinyaws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DominicBreuker%2Ftinyaws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DominicBreuker%2Ftinyaws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DominicBreuker%2Ftinyaws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DominicBreuker%2Ftinyaws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DominicBreuker","download_url":"https://codeload.github.com/DominicBreuker/tinyaws/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DominicBreuker%2Ftinyaws/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33004182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws"],"created_at":"2024-10-11T18:53:16.319Z","updated_at":"2026-05-13T23:32:17.364Z","avatar_url":"https://github.com/DominicBreuker.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tinyaws\n\nA PoC for an AWS API client based only on the Go standard library, without the bloated official AWS SDK.\nIf you need only a few API calls and don't want to blow up the size of your binary, this may be for you.\n\nThis code will be little more than a blueprint.\nIt implements only a handful of API actions for STS and S3.\nUse them as examples to implement the actions you actually need.\nThe authentication logic (AWS signature) though should be reusable.\n\n## Getting Started\n\nCheck out the file [main.go](main.go), which shows all implemented API actions in action.\nThey are:\n- STS: GetCallerIdentity\n- S3: PutObject\n- S3: GetObject\n- S3: ListObjectsV2\n- S3: DeleteObject\n\nTo make it work you have to add IAM credentials into the variables first:\n\n```go\nfunc main() {\n\taccessKey := \"YOUR_KEY_ID\"\n\tsecretKey := \"YOUR_SECRET_KEY\"\n\n\tTestSTS(accessKey, secretKey)\n\tTestS3(accessKey, secretKey)\n}\n```\n\nTo test the S3 actions you need a bucket and write permissions for it.\nConfigure the name on the top of the `TestS3` function:\n\n```go\nfunc TestS3(accessKey string, secretKey string) {\n\tregion := \"us-east-2\"\n\tbucket := \"fancy-bucket-name\"\n\tkey := \"somefile.txt\"\n\tdata := []byte(\"your ad could be here\")\n    ...\n}\n```\n\nThen run `go run main.go` and you should see some log output related to the API actions.\n\n## Implementing API Actions\n\nAWS provides detailed documentation for each API action.\nAll you have to do is build the request using Go's [net/http Request](https://pkg.go.dev/net/http#Request).\nThe tricky part is authentication.\nAWS wants you to create a signature for each request, with your credentials used as a secret key.\nDetails are [in the docs](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html).\nThis repo provides an implementation of that in [pkg/client/signature.go](pkg/client/signature.go).\nThe function is called `signRequest`.\n\nFor example, consider the implementation of S3 GetObject.\nThe code for it is in [pkg/services/s3/getobject.go](pkg/services/s3/getobject.go).\nAWS documentation is [here](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html).\nThis is the code, defined of the S3 `Service`:\n\n```go\nfunc (s *Service) GetObject(region string, bucket string, key string) ([]byte, error) {\n\treq, err := http.NewRequest(\"GET\", fmt.Sprintf(\"https://%s.s3.%s.amazonaws.com/%s\", bucket, region, key), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating request: %s\", err)\n\t}\n\n\tresp, err := s.Client.Do(req, region, \"s3\", nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"unexpected status code: %d\", resp.StatusCode)\n\t}\n\n\tdata, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"reading body: %s\", err)\n\t}\n\n\treturn data, nil\n}\n```\n\nNothing special to see.\nYou could add headers or query parameters if needed, or leave it like this if you are fine with it.\nAll authentication happens under the hood.\nThe S3 service has a `Client` which wraps a [net/http Client](https://pkg.go.dev/net/http#Client)\nbut adds the signature before doing the request.\n\nYou should be able to add more API actions in a similar fashion, without having to deal with the signatures.\nHowever, understand that all request data (headers, URI, parameters, body) is part of the signature and AWS is very fussy about these.\nYour request must look exactly the same way the AWS docs describe it.\nExpect that my implementation of the signature scheme won't resolve all ambiguities for you.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominicbreuker%2Ftinyaws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdominicbreuker%2Ftinyaws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominicbreuker%2Ftinyaws/lists"}