{"id":17882251,"url":"https://github.com/mackee/github-apps-auth","last_synced_at":"2025-03-22T12:31:37.467Z","repository":{"id":36465153,"uuid":"225790234","full_name":"mackee/GitHub-Apps-Auth","owner":"mackee","description":"The fetcher that get a token for GitHub Apps","archived":false,"fork":false,"pushed_at":"2022-06-14T07:55:28.000Z","size":33,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T16:03:56.474Z","etag":null,"topics":["authentication","github","github-app","perl","perl-module"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mackee.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","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":"2019-12-04T05:54:36.000Z","updated_at":"2020-01-06T14:48:20.000Z","dependencies_parsed_at":"2022-08-28T20:11:02.131Z","dependency_job_id":null,"html_url":"https://github.com/mackee/GitHub-Apps-Auth","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackee%2FGitHub-Apps-Auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackee%2FGitHub-Apps-Auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackee%2FGitHub-Apps-Auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackee%2FGitHub-Apps-Auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mackee","download_url":"https://codeload.github.com/mackee/GitHub-Apps-Auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959443,"owners_count":20538625,"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":["authentication","github","github-app","perl","perl-module"],"created_at":"2024-10-28T12:49:04.034Z","updated_at":"2025-03-22T12:31:36.798Z","avatar_url":"https://github.com/mackee.png","language":"Perl","readme":"# NAME\n\nGitHub::Apps::Auth - The fetcher that get a token for GitHub Apps\n\n# SYNOPSIS\n\n    use GitHub::Apps::Auth;\n    my $auth = GitHub::Apps::Auth-\u003enew(\n        private_key     =\u003e \"\u003cfilename\u003e\", # when read private key from file\n        private_key     =\u003e \\$pk,         # when read private key from variable\n        app_id          =\u003e \u003capp_id\u003e,\n        login           =\u003e \u003corganization or user\u003e\n    );\n    # This method returns the cached token inside an object.\n    # However, refresh expired token automatically.\n    my $token  = $auth-\u003eissued_token;\n\n    # If you want to use with Pithub\n    use Pithub;\n    # GitHub::Apps::Auth object behaves like a string.\n    # This object calls the `issued_token` method\n    # each time it evaluates as a string.\n    my $ph = Pithub-\u003enew(token =\u003e $auth, ...);\n\n# DESCRIPTION\n\nGitHub::Apps::Auth is the fetcher for getting a GitHub token of GitHub Apps.\n\nThis module provides a way to get a token that need to be updated regularly for GitHub API.\n\n# CONSTRUCTOR\n\n## new\n\n    my $auth = GitHub::Apps::Auth-\u003enew(\n        private_key     =\u003e \"\u003cfilename\u003e\",\n        app_id          =\u003e \u003capp_id\u003e,\n        installation_id =\u003e \u003cinstallation_id\u003e\n    );\n\nConstructs an instance of `GitHub::Apps::Auth` from credentials.\n\n### parameters\n\n#### private\\_key\n\n**Required: true**\n\nThis parameter is a private key of the GitHub Apps.\n\nThis must be a filename or string in the pem format. You can get a private key from Settings page of GitHub Apps. See [Generating a private key](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#generating-a-private-key).\n\n#### app\\_id\n\n**Required: true**\n\nThis parameter is the App ID of your GitHub Apps. Use the `App ID` in the About section of your GitHub Apps page.\n\n#### installation\\_id\n\n**Required: exclusive to** `login`\n\nA `installation_id` is an identifier of installation Organizations or repositories in GitHub Apps. This value is can be obtained from a webhook that is fired during installation. Also can be obtained from webhook's `Recent Deliveries` of GitHub apps settings.\n\n#### login\n\n**Required: exclusive to** `installation_id`\n\n`login` is used for detecting installation\\_id. If not set `installation_id` and set `login`, search `installation_id` from the list of installations.\n\n# METHODS\n\n## issued\\_token\n\n    my $token  = $auth-\u003eissued_token;\n\n`issued_token` returns a API token in string. This token is cached while valid.\n\nWhen calling this method with condition that expired token, this method refreshes a token automatically.\n\n## token\n\nThis method returns an API token. Unlike `issued_token`, this method not refresh an expired token.\n\n## expires\n\nThis returns the token expiration date in the epoch.\n\n# OPERATOR OVERLOADS\n\n`GitHub::Apps::Auth` is overloaded so that `issued_token` is called when evaluated as a string. So probably be usable in GitHub client that use raw string API token. Ex [Pithub](https://metacpan.org/pod/Pithub).\n\n# SEE ALSO\n\n[Authenticating with GitHub Apps](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps)\n\n# LICENSE\n\nCopyright (C) mackee.\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n\n# AUTHOR\n\nmackee \u003cmacopy123@gmail.com\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmackee%2Fgithub-apps-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmackee%2Fgithub-apps-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmackee%2Fgithub-apps-auth/lists"}