{"id":20460444,"url":"https://github.com/dapphub/ds-auth","last_synced_at":"2025-04-13T05:53:06.590Z","repository":{"id":54512113,"uuid":"64948604","full_name":"dapphub/ds-auth","owner":"dapphub","description":"Updatable, unobtrusive Solidity authorization pattern","archived":false,"fork":false,"pushed_at":"2022-08-28T01:57:30.000Z","size":85,"stargazers_count":140,"open_issues_count":3,"forks_count":37,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-13T05:52:55.926Z","etag":null,"topics":["authorization","dappsys","ethereum","solidity"],"latest_commit_sha":null,"homepage":"https://dapp.tools/dappsys/ds-auth.html","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dapphub.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":"2016-08-04T16:05:46.000Z","updated_at":"2024-10-22T11:17:18.000Z","dependencies_parsed_at":"2022-08-13T18:20:12.225Z","dependency_job_id":null,"html_url":"https://github.com/dapphub/ds-auth","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/dapphub%2Fds-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapphub%2Fds-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapphub%2Fds-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapphub%2Fds-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dapphub","download_url":"https://codeload.github.com/dapphub/ds-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670503,"owners_count":21142901,"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":["authorization","dappsys","ethereum","solidity"],"created_at":"2024-11-15T12:19:38.408Z","updated_at":"2025-04-13T05:53:06.567Z","avatar_url":"https://github.com/dapphub.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2\u003eDSAuth\n  \u003csmall class=\"text-muted\"\u003e\n    \u003ca href=\"https://github.com/dapphub/ds-auth\"\u003e\u003cspan class=\"fa fa-github\"\u003e\u003c/span\u003e\u003c/a\u003e\n  \u003c/small\u003e\n\u003c/h2\u003e\n\n_Fully updatable unobtrusive auth_\n\nProvides a flexible and updatable auth pattern which is completely separate\nfrom application logic. By default, the `auth` modifier will restrict \nfunction-call access to the including contract owner and the including\ncontract itself.\n\nIn addition, fine-grained function access can be controlled by specifying an\n`authority` - a contract which implements the `DSAuthority` interface to define \ncustom access permissions.\n\nDappsys provides a couple of ready-made authority contracts,\n[ds-guard](https://dapp.tools/dappsys/ds-guard.html) and\n[ds-roles](https://dapp.tools/dappsys/ds-roles.html), which can be used as \nauthorities where updatable fine-grained permissioned auth is required.\n\n### Usage\n\nThe `auth` **modifier** provided by DSAuth triggers the internal `isAuthorized` \nfunction to require that the `msg.sender` is authorized ie. the sender is either:\n\n1. the contract `owner`;\n2. the contract itself;\n3. or has been granted permission via a specified `authority`.\n\n```solidity\nfunction myProtectedFunction() auth {}\n```\n\n### API\n\n#### `setOwner(address owner_)` \nSet a new `owner` (requires auth)\n\n#### `setAuthority(DSAuthority authority_)` \nSet a new `authority` (requires auth)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdapphub%2Fds-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdapphub%2Fds-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdapphub%2Fds-auth/lists"}