{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":221325309,"defaultBranch":"master","name":"library-go","ownerLogin":"Miciah","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2019-11-12T22:37:05.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/2042465?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1707972365.0","currentOid":""},"activityList":{"items":[{"before":"0c62e2597c52a1093f3a42a4e729f11dd453a304","after":"46855ec7e21d0f7014518272b1f165e6c2ae04ed","ref":"refs/heads/OCPBUGS-22332-route-improve-errors-for-missing-custom-host-permission","pushedAt":"2024-04-23T20:23:55.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"Miciah","name":"Miciah Dashiel Butler Masters","path":"/Miciah","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/2042465?s=80&v=4"},"commit":{"message":"route: Improve errors for missing custom-host perm\n\nReturn \"you do not have permission\" error messages instead of \"field is\nimmutable\" error messages when the user tries to update a route's\nspec.host, spec.subdomain, or spec.tls field without the required\n\"custom-host\" permission.\n\nNote that this change does not affect the HTTP status code for these\nerrors, which will continue to be HTTP 422, \"Unprocessable Entity\", as both\nthe openshift-apiserver admission[1] and the kube-apiserver admission[2]\nwrap errors from the route validation's ValidateHostUpdate function using\n\"k8s.io/apimachinery/pkg/api/errors\".NewInvalid[3].\n\n1. https://github.com/openshift/openshift-apiserver/blob/c5ba848e78463f9c73e1d2daec9e565daa4a6f4a/vendor/k8s.io/apiserver/pkg/registry/rest/update.go#L154-L156\n2. https://github.com/openshift/kubernetes/blob/5a4819c6048e42515c3c5538b723ba6272440eee/openshift-kube-apiserver/admission/route/hostassignment/admission.go#L135-L137\n3. https://github.com/openshift/kubernetes/blob/5a4819c6048e42515c3c5538b723ba6272440eee/staging/src/k8s.io/apimachinery/pkg/api/errors/errors.go#L281-L310\n\nThis commit is related to OCPBUGS-22332.\n\nhttps://issues.redhat.com/browse/OCPBUGS-22332\n\n* pkg/route/hostassignment/assignment.go (routeHostPermissionErrMsg)\n(routeSubdomainPermissionErrMsg, routeTLSPermissionErrMsg): New consts.\n(AllocateHost): Use routeHostPermissionErrMsg and routeTLSPermissionErrMsg\ninstead of string literals.\n(validateImmutableField): New helper function, based on\nValidateImmutableField from apimachinery but using a custom error message.\n(ValidateHostUpdate): Use the new consts and helper function instead of\nValidateImmutableField from apimachinery.","shortMessageHtmlLink":"route: Improve errors for missing custom-host perm"}},{"before":null,"after":"0c62e2597c52a1093f3a42a4e729f11dd453a304","ref":"refs/heads/OCPBUGS-22332-route-improve-errors-for-missing-custom-host-permission","pushedAt":"2024-02-15T04:46:05.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"Miciah","name":"Miciah Dashiel Butler Masters","path":"/Miciah","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/2042465?s=80&v=4"},"commit":{"message":"route: Improve errors for missing custom-host perm\n\nReturn \"you do not have permission\" error messages instead of \"field is\nimmutable\" error messages when the user tries to update a route's\nspec.host, spec.subdomain, or spec.tls field without the required\n\"custom-host\" permission.\n\nNote that this change does not affect the HTTP status code for these\nerrors, which will continue to be HTTP 422, \"Unprocessable Entity\", as both\nthe openshift-apiserver admission[1] and the kube-apiserver admission[2]\nwrap errors from the route validation's ValidateHostUpdate function using\n\"k8s.io/apimachinery/pkg/api/errors\".NewInvalid[3].\n\n1. https://github.com/openshift/openshift-apiserver/blob/c5ba848e78463f9c73e1d2daec9e565daa4a6f4a/vendor/k8s.io/apiserver/pkg/registry/rest/update.go#L154-L156\n2. https://github.com/openshift/kubernetes/blob/5a4819c6048e42515c3c5538b723ba6272440eee/openshift-kube-apiserver/admission/route/hostassignment/admission.go#L135-L137\n3. https://github.com/openshift/kubernetes/blob/5a4819c6048e42515c3c5538b723ba6272440eee/staging/src/k8s.io/apimachinery/pkg/api/errors/errors.go#L281-L310\n\nThis commit is related to OCPBUGS-22332.\n\nhttps://issues.redhat.com/browse/OCPBUGS-22332\n\n* pkg/route/hostassignment/assignment.go (routeHostPermissionErrMsg)\n(routeSubdomainPermissionErrMsg, routeTLSPermissionErrMsg): New consts.\n(AllocateHost): Use routeHostPermissionErrMsg and routeTLSPermissionErrMsg\ninstead of string literals.\n(validateImmutableField): New helper function, based on\nValidateImmutableField from apimachinery but using a custom error message.\n(ValidateHostUpdate): Use the new consts and helper function instead of\nValidateImmutableField from apimachinery.","shortMessageHtmlLink":"route: Improve errors for missing custom-host perm"}},{"before":null,"after":"577c2bc6a3de69aa20cd2894043c524bf9dd80ce","ref":"refs/heads/headers-fixups-2","pushedAt":"2023-08-05T18:58:35.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"Miciah","name":"Miciah Dashiel Butler Masters","path":"/Miciah","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/2042465?s=80&v=4"},"commit":{"message":"Route header actions validation fixups\n\nDon't allow an empty action type, and make some general cleanups.\n\n* pkg/route/validation/validation.go: Re-organize var and const\ndeclarations, add missing godoc to these declarations, and group the\ndeclarations into a single const block and a single var block.\n(validateHeaders): Remove unnecessary valueRegexpForHeaderValue and\nvalueErrorMessage parameters. Remove unnecessary braces and indentation.\nRe-order validation to check whether the header name is too large or in the\nforbidden set before performing a pattern match for invalid values.\n* pkg/route/validation/validation_test.go (TestValidateHeaders): Improve\ngodoc. Add test cases for empty action type or header name.\n(TestValidateRouteUpdate): Fix test name in godoc.","shortMessageHtmlLink":"Route header actions validation fixups"}},{"before":"a5d24f1150edcd45c7f87c4426c10b19d34db0c9","after":"9414a8e82b9fce4038ca329ff108b37209c98b15","ref":"refs/heads/headers-fixups","pushedAt":"2023-08-01T23:16:08.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"Miciah","name":"Miciah Dashiel Butler Masters","path":"/Miciah","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/2042465?s=80&v=4"},"commit":{"message":"Fix validation for set field\n\n* pkg/route/validation/validation.go (validateHeaders): Report error if set\nfield is set when it shouldn't be.\n* pkg/route/validation/validation_test.go (TestValidateHeaders): Add test\ncases for the set field.","shortMessageHtmlLink":"Fix validation for set field"}},{"before":"65966f0f1d3880fd3604a6a50818dd65b1d7c888","after":"a5d24f1150edcd45c7f87c4426c10b19d34db0c9","ref":"refs/heads/headers-fixups","pushedAt":"2023-08-01T23:03:49.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Miciah","name":"Miciah Dashiel Butler Masters","path":"/Miciah","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/2042465?s=80&v=4"},"commit":{"message":"Fix validation for set field\n\n* pkg/route/validation/validation.go (validateHeaders): Report error if set\nfield is set when it shouldn't be.\n* pkg/route/validation/validation_test.go (TestValidateHeaders): Add test\ncases for the set field.","shortMessageHtmlLink":"Fix validation for set field"}},{"before":null,"after":"65966f0f1d3880fd3604a6a50818dd65b1d7c888","ref":"refs/heads/headers-fixups","pushedAt":"2023-08-01T22:42:16.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"Miciah","name":"Miciah Dashiel Butler Masters","path":"/Miciah","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/2042465?s=80&v=4"},"commit":{"message":"Rewrite validateHeaders and fix TestValidateHeaders\n\nRewrite validateHeaders with the following main changes:\n\n* Instead of switching on the field path, take a regexp and error message\n string for validating header values.\n\n* Return a list of errors.\n\n* Simplify the uniqueness check.\n\n* Use field.Duplicate, field.Required, field.Invalid, and field.Forbidden\n as appropriate.\n\n* Check for missing set field.\n\nModify TestValidateHeaders with the following main changes:\n\n* Use string literals instead of variables for header names.\n\n* Add variables for too-large values, and use letters instead of NUL bytes.\n\n* Update error messages per the aforementioned changes to validateHeaders.\n\n* Fix some incorrect values in expected error messages.\n\n* Remove the headerType test parameter; always verify validation for both\n the request field and the response field. (Some test cases were missing\n the headerType value, which meant that these test cases were not actually\n testing what they were intended to test.)\n\n* Fail the test when an error was expected and validation reported no\n error.\n\n* Add test cases for invalid converter and for routes that specify both\n response headers as well as request headers.","shortMessageHtmlLink":"Rewrite validateHeaders and fix TestValidateHeaders"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAEOHjvYgA","startCursor":null,"endCursor":null}},"title":"Activity ยท Miciah/library-go"}