{"id":22326052,"url":"https://github.com/solarnetwork/solarnetwork-aws-auth-token-key-provider","last_synced_at":"2025-03-26T06:11:45.546Z","repository":{"id":149073894,"uuid":"608375626","full_name":"SolarNetwork/solarnetwork-aws-auth-token-key-provider","owner":"SolarNetwork","description":"Example AWS Lambda for providing a SolarNetwork token signing key","archived":false,"fork":false,"pushed_at":"2023-03-02T04:38:52.000Z","size":271,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-31T07:32:07.025Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SolarNetwork.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-03-01T22:16:41.000Z","updated_at":"2023-03-01T23:00:59.000Z","dependencies_parsed_at":"2023-07-13T23:00:15.758Z","dependency_job_id":null,"html_url":"https://github.com/SolarNetwork/solarnetwork-aws-auth-token-key-provider","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolarNetwork%2Fsolarnetwork-aws-auth-token-key-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolarNetwork%2Fsolarnetwork-aws-auth-token-key-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolarNetwork%2Fsolarnetwork-aws-auth-token-key-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolarNetwork%2Fsolarnetwork-aws-auth-token-key-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SolarNetwork","download_url":"https://codeload.github.com/SolarNetwork/solarnetwork-aws-auth-token-key-provider/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245598320,"owners_count":20641884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-04T02:15:14.315Z","updated_at":"2025-03-26T06:11:45.540Z","avatar_url":"https://github.com/SolarNetwork.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SolarNetwork Example AWS Lamda Security Token Signing Key Provider\n\nThis project contains a Java AWS Lamda function that, when invoked, returns a signing key derived\nfrom a [SolarNetwork token secret][sn-auth].\n\nThe purpose of this Lamda function is to provide a token signing key to clients, without exposing\nthe actual token secret. This implementation serves as an example only.\n\nOnce deployed to AWS as a Lamda function, you can configure a Function URL to allow calling the\nfunction at an HTTP URL, or you could integrate it as an AWS API Gateway proxy handler. You would\nthen give the SolarNetwork token to the client. The client would then invoke the function URL to\nobtain the signing key that can then be used to sign SolarNetwork API requests.\n\n\u003e :warning: Note how the token secret configured on the Lamda must be for the token you give to the\n\u003e client!\n\nThe function returns a simple JSON object like this:\n\n```json\n{\n  \"success\": true,\n  \"key\": \"6492162046e769f9a3468cbc1992c92003233cf81c507fae5e39cd23674d2786\",\n  \"date\": \"20230301\"\n}\n```\n\nThose properties are described as:\n\n| Property | Description |\n|:---------|:------------|\n| `success` | Will be `true` if the function succeeded, `false` otherwise. |\n| `message` | If an error occurred, a reason will be provided. |\n| `key`     | The hex-encoded token signing key. |\n| `date`    | The `YYYYMMDD` date used in the signing key. This is based on the time that the function executes. |\n\n# Building\n\nYou can build a `.zip` archive suitable for uploading to an AWS Lamda function by running\n\n```\n# Posix\n./gradlew build\n\n# or, Windows\n.\\gradlew.bat build\n```\n\nThe archive will be built to `app/build/distributions/s10k-aws-lamda-token-key-provider.zip`.\n\n# Deploying\n\nThe following Lamda configuration is necessary:\n\n| Setting | Value |\n|:--------|:------|\n| Runtime | Java 11 |\n| Handler | `net.s10k.aws.lamda.security.keyprovider.TokenKeyProvider` |\n\nThe following environment variables must be configured:\n\n| Variable | Description |\n|:---------|:------------|\n| `SN_TOKEN_SECRET` | The token secret to provide signing keys for. |\n\n\n[sn-auth]: https://github.com/SolarNetwork/solarnetwork/wiki/SolarNet-API-authentication-scheme-V2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolarnetwork%2Fsolarnetwork-aws-auth-token-key-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolarnetwork%2Fsolarnetwork-aws-auth-token-key-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolarnetwork%2Fsolarnetwork-aws-auth-token-key-provider/lists"}