{"id":16767850,"url":"https://github.com/eolinker/goku-plugin-apikey-auth","last_synced_at":"2026-07-30T10:31:33.279Z","repository":{"id":103579575,"uuid":"208738347","full_name":"eolinker/Goku-plugin-apikey-auth","owner":"eolinker","description":"GOKU API GATEWAY 官方插件：APIKEY鉴权","archived":false,"fork":false,"pushed_at":"2019-09-19T02:26:15.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-12T18:47:39.131Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/eolinker.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":"2019-09-16T07:35:31.000Z","updated_at":"2023-07-25T14:29:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"602a34d3-2a5d-4c41-9ed9-609463eedcbd","html_url":"https://github.com/eolinker/Goku-plugin-apikey-auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eolinker/Goku-plugin-apikey-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eolinker%2FGoku-plugin-apikey-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eolinker%2FGoku-plugin-apikey-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eolinker%2FGoku-plugin-apikey-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eolinker%2FGoku-plugin-apikey-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eolinker","download_url":"https://codeload.github.com/eolinker/Goku-plugin-apikey-auth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eolinker%2FGoku-plugin-apikey-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279085743,"owners_count":26100020,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-13T06:10:06.932Z","updated_at":"2025-10-15T14:57:49.983Z","avatar_url":"https://github.com/eolinker.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Goku Plugin：API Key\n\n| 插件名称  | 文件名.so |  插件类型  | 错误处理方式 | 作用范围 |  优先级  |\n| ------------ | ------------ | ------------ | ------------ | ------------ | ------------ |\n| APIKey鉴权  | goku-apikey_auth | 访问策略 | 继续后续操作 | 转发前  |  1003  |\n\n鉴权方式的一种，多用于OpenAPI，设置Apikey参数，Apikey默认支持在header、body、query中使用，不能通过认证的用户将无权访问接口。\n\n# 目录\n- [编译教程](#编译教程 \"编译教程\")\n- [安装教程](#安装教程 \"安装教程\")\n- [使用教程](#使用教程 \"使用教程\")\n- [更新日志](#更新日志 \"更新日志\")\n\n# 编译教程\n\n#### 环境要求\n* 系统：基于 Linux 内核（2.6.23+）的系统，CentOS、RedHat 等均可；\n\n* golang版本号：12.x及其以上\n\n* 环境变量设置：\n\t* GO111MODULE：on\n\t\n\t* GOPROXY：https://goproxy.io\n\n\n#### 编译步骤\n\n1.clone项目\n\n2.进入项目文件夹，执行**build.sh**\n```\ncd goku-apikey_auth \u0026\u0026 chmod +x build.sh \u0026\u0026 ./build.sh\n```\n\n###### 注：build.sh为通用的插件编译脚本，自定义插件时可以拷贝直接使用。\n\n3.执行第2步将会生成文件： **{插件名}.so**\n\n将该文件上传到**节点服务器运行目录**下的**plugin**文件夹，然后在控制台安装插件即可使用。\n\n# 安装插件\n前往 Goku API Gateway 官方网站查看：[插件安装教程](url \"https://help.eolinker.com/#/tutorial/?groupID=c-341\u0026productID=19\")\n\n# 使用教程\n\n#### 配置页面\n\n进入控制台 \u003e\u003e 策略管理 \u003e\u003e 某策略 \u003e\u003e 策略插件 \u003e\u003e Apikey鉴权插件：\n\n![](http://data.eolinker.com/course/U7UhASH318687437c2efcae19a6a1a8ac740c724f3b15b0)\n\n#### 配置参数\n\n| 参数名 | 说明   | \n| ------------ | ------------ |  \n|  Apikey | Apikey的值 | \n| hildCredential  | 转发时是否隐藏Apikey |\n| remark  | 备注 |\n\n#### 配置示例\n\n```\n[\n    {\n        \"Apikey\": \"key\",\n        \"hideCredential\": false\n        \"remark\": \"\"\n    },\n    {\n        \"Apikey\": \"key2\",\n        \"hideCredential\": false\n        \"remark\": \"\"\n    }\n]\n```\n\n#### API请求参数\n\n| 参数名 | 说明  | 必填  |   值可能性   |  参数位置 |\n| ------------ | ------------ |  ------------ |  ------------ |  ------------ |  \n|  Strategy-Id | 策略id | 是 |   |  header  | \n|  Authorization-Type  | 鉴权方式 | 是 | Apikey  | header  |\n| Authorization  |  鉴权值 |  是  |    | header |\n\n\n#### 请求示例\n\n###### 以下API测试页面来自于 **eoLinker API Studio** 接口管理平台\n\n* Apikey在 **header** 中：\n\n    ![](http://data.eolinker.com/course/V8i8viHdf6dc9648a19ec778ce5698af643cefa01d3fb2e)\n\n* Apikey在 **body** 中：\n头部填写 **Strategy-Id** 与 **Authorization-Type**:\n![](http://data.eolinker.com/course/awEChej35aa995b7613f888ed9d0816cb3ff1eddd4cc3c2)\n\n* Apikey在 **query** 中：\n头部填写 **Strategy-Id** 与 **Authorization-Type**:\n![](http://data.eolinker.com/course/M85um6g07177251dbdecd1593cc8b7306252e7c589f7653)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feolinker%2Fgoku-plugin-apikey-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feolinker%2Fgoku-plugin-apikey-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feolinker%2Fgoku-plugin-apikey-auth/lists"}