{"id":18253516,"url":"https://github.com/kingjan1999/traefik-plugin-query-modification","last_synced_at":"2025-04-04T16:33:07.294Z","repository":{"id":57549876,"uuid":"306086207","full_name":"kingjan1999/traefik-plugin-query-modification","owner":"kingjan1999","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-17T03:08:41.000Z","size":15,"stargazers_count":7,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T16:15:48.281Z","etag":null,"topics":["traefik-plugin"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kingjan1999.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":"2020-10-21T16:37:03.000Z","updated_at":"2024-04-27T23:46:58.000Z","dependencies_parsed_at":"2024-06-20T15:34:33.274Z","dependency_job_id":"4c00d99a-1ebb-48d1-bd8f-9bd63a752dac","html_url":"https://github.com/kingjan1999/traefik-plugin-query-modification","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingjan1999%2Ftraefik-plugin-query-modification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingjan1999%2Ftraefik-plugin-query-modification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingjan1999%2Ftraefik-plugin-query-modification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingjan1999%2Ftraefik-plugin-query-modification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kingjan1999","download_url":"https://codeload.github.com/kingjan1999/traefik-plugin-query-modification/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247209791,"owners_count":20901858,"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":["traefik-plugin"],"created_at":"2024-11-05T10:07:01.425Z","updated_at":"2025-04-04T16:33:07.004Z","avatar_url":"https://github.com/kingjan1999.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Traefik Plugin for Modifying Query Parameters\n\nThis Traefik plugin allows you to modify the query parameters of an incoming request, by either adding new, deleting or modifying existing query parameters.\nE.g. you can transform `?a=b\u0026c=d\u0026e=f` to `?a=g\u0026h=i` by using this plugin (multiple times).\n\n## Sample Complete Configuration\n\nThe following code snippet is a sample configuration for the dynamic file based provider (TOML), but as usual, this plugin should work with all other configuration providers as well.\n\n```toml\n[http]\n  [http.routers]\n    [http.routers.router0]\n      entryPoints = [\"http\"]\n      service = \"service-foo\"\n      rule = \"Path(`/foo`)\"\n      middlewares = [\"my-plugin\"]\n\n  [http.middlewares]\n    [http.middlewares.my-plugin.plugin.dev]\n      type = \"modify\"\n      paramName = \"password\"\n      newValue = \"censored\"\n```\n\n## Configuration Overview\n\nThis plugin knows three different modifications:\n\n### Adding new parameters (`type = \"add\"`)\n\nSpecify the type (`add`), the name / key of the new query parameter (`paramName`) and the value of the new parameter (`newValue`).\n\nExample: \n```toml\ntype = \"add\"\nparamName = \"authenticated\"\nnewValue = \"true\"\n```\n\nTransforms this querystring: `?some=other\u0026stuff=here` into: `?some=other\u0026stuff=here\u0026authenticated=true`\n\n*Note*: Existing query params with the same name are not replaced, instead a new param with the same name is added. Using the previous example:\n`?authenticated=false` becomes `?authenticatd=false\u0026authenticated=true`. The handling of such query strings depends on your upstream server. To replace existing values, use `modify`.\n\n### Modifying existing parameters (`type = \"modify\"`)\n\nThis is the most complex mode, as it supports multiple configuration types. You always need to specify which parameters to modify and how the new value should be computed. Avoid configuration more of one way for each of these (e.g. `paramName` and `paramNameRegex`) as this might result in unexpected behavior.\n\n#### Specifying parameter\n\nYou have three choices:\n\n- `paramName` matches the plain name / key of the parameter (e.g. `paramName=\"test\"` matches the `test=1234` param in `?test=1234\u0026othertest=5678`)\n- `paramNameRegex` matches the name / key of the parameter with a regex (e.g. `paramNameRegex=\"^.*test$\"` matches `test=1234` and `othertest=5678` in `?test=1234\u0026othertest=5678`)\n- `paramValueRegex` matches the value of the parameter with a regex (e.g. `paramValueRegex=\"^1234$\"` matches `test=1234` in `?test=1234\u0026othertest=5678`)\n\nNote: While always all matched parameters are handled, you might want to consider just using this middleware plugin multiple times instead of trying to create complex regexes for your situation.\n\n#### Specifying substitution\n\nThere are two nays:\n\n- `newValue` replaces the old value with the specifying value. `$1` is replaced by the old value (note: as of now, this is not escapable) (e.g. `paramName=\"test\",newValue=\"bar-$1\"` transforms `test=foo` into `test=bar-foo`)\n- `newValueRegex` allows you to use the capture groups from `paramValueRegex` to create the replacement value (e.g. `paramValueRegex=\"^(.*)oo$\",newValueRegex=\"$1\"` transforms `test=foo\u0026test2=poo` into `test=f\u0026test=p`)\n\n\n### Deleting existing parameters (`type = \"delete\"`)\n\nThis deletes an existing parameters including all of it's values. Specifying the affected parameters works the same [as above](https://github.com/kingjan1999/traefik-plugin-query-modification#specifying-parameter).\nExample: `type=\"delete\",paramValueRegex=\"password\"` transforms `?secret=password\u0026othersecret=other-password\u0026tracker=1234` into `tracker=1234`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingjan1999%2Ftraefik-plugin-query-modification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkingjan1999%2Ftraefik-plugin-query-modification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingjan1999%2Ftraefik-plugin-query-modification/lists"}