{"id":18498677,"url":"https://github.com/zircote/bona-fides","last_synced_at":"2025-05-14T05:30:48.972Z","repository":{"id":27006980,"uuid":"30471078","full_name":"zircote/bona-fides","owner":"zircote","description":"A Python lib for validation of AWS SNS Notification signatures.","archived":false,"fork":false,"pushed_at":"2015-02-09T03:56:34.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-17T00:45:45.490Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zircote.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}},"created_at":"2015-02-07T21:36:40.000Z","updated_at":"2015-02-09T03:56:35.000Z","dependencies_parsed_at":"2022-08-31T21:35:56.049Z","dependency_job_id":null,"html_url":"https://github.com/zircote/bona-fides","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Fbona-fides","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Fbona-fides/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Fbona-fides/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Fbona-fides/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zircote","download_url":"https://codeload.github.com/zircote/bona-fides/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076977,"owners_count":22010630,"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-11-06T13:42:00.529Z","updated_at":"2025-05-14T05:30:48.926Z","avatar_url":"https://github.com/zircote.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SNS Signatory\n\nTODO: still needs work, ie logging, error handling and expanded configuration details/options. And Docs\n\n### Example Usage\n\nUsing the AWS SNS Notification example from http://docs.aws.amazon.com/sns/latest/dg/json-formats.html:\n\n```json\n{\n  \"Type\" : \"Notification\",\n  \"MessageId\" : \"22b80b92-fdea-4c2c-8f9d-bdfb0c7bf324\",\n  \"TopicArn\" : \"arn:aws:sns:us-west-2:123456789012:MyTopic\",\n  \"Subject\" : \"My First Message\",\n  \"Message\" : \"Hello world!\",\n  \"Timestamp\" : \"2012-05-02T00:54:06.655Z\",\n  \"SignatureVersion\" : \"1\",\n  \"Signature\" : \"EXAMPLEw6JRNwm1LFQL4ICB0bnXrdB8ClRMTQFGBqwLpGbM78tJ4etTwC5zU7O3tS6tGpey3ejedNdOJ+1fkIp9F2/LmNVKb5aFlYq+9rk9ZiPph5YlLmWsDcyC5T+Sy9/umic5S0UQc2PEtgdpVBahwNOdMW4JPwk0kAJJztnc=\",\n  \"SigningCertURL\" : \"https://sns.us-west-2.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem\",\n  \"UnsubscribeURL\" : \"https://sns.us-west-2.amazonaws.com/?Action=Unsubscribe\u0026SubscriptionArn=arn:aws:sns:us-west-2:123456789012:MyTopic:c9135db0-26c4-47ec-8998-413945fb5a96\"\n}\n```\n\n\n```python\njson_string = \u003csee_above\u003e\nOPTIONS = {\n    \"white_list\": [\n        \"arn:aws:sns:us-east-1:199999999999:blah_blah\",  # Accept for a specific topic/arn\n    ],\n    \"validate_signature\": True\n}\n\nsns_validation = bona_fides.Validator(OPTIONS)\nnotification = sns_validation.handle(m)\nif notification.is_valid:\n    assert(notification.message)\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzircote%2Fbona-fides","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzircote%2Fbona-fides","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzircote%2Fbona-fides/lists"}