Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/auth
AgeCommit message (Collapse)Author
2022-11-14auth: Run tests in sha256 modeJames Fargher
These tests know nothing of object hashes and so are safe to run.
2022-10-27Add docs testing Make target and CI/CD joberead/add-docs-testing-make-target-and-ci_cd-jobEvan Read
Also expand reach of Markdown linting to more files
2022-10-10lint: Remove space after `nolint:`Karthik Nayak
With recent changes `gofmt` [1] started reformatting godoc comments. This causes a problem wherein it reformats `//nolint: staticcheck` to `// nolint: staticcheck`. But it does ignore directives [2]. So let's change all our nolint to directive format. This avoids the conflict with `gofmt`. This fix was done by running `grep -r --include="*.go" -E "//nolint: .*"` and manually fixing the issues. [1]: https://github.com/golangci/golangci-lint/issues/1658#issuecomment-1183148066 [2]: https://github.com/golangci/golangci-lint/issues/3098#issuecomment-1214364533
2022-07-18test: Disable all test with tag sha256Toon Claes
We're about to add the ability to test with SHA256 hashes. We assume none of the tests work with this object format. With this change we add the build constraint to not run any test when the tag 'gitaly_test_sha256' is set.
2022-05-20Update go package name from v14 to v15John Cai
This commit changes the major version in the package name from v14 to v15 Updating go.mod & go.sum with new module name v15 Update Makefile to bump major version to v15 Update the gitaly package name in the Makefile. Also update gitaly-git2go-v14 -> gitaly-git2go-v15. We need to keep gitaly-git2go-v14 for a release however, for zero downtime upgrades. This pulls directly from a sha that is v14. Update package name from v14->v15 for auth, client, cmd, internal packages This commit changes the package name from v14 to v15 in go and proto files in the internal, auth, client, cmd packages. proto: Update major package number in package name tools: Change major version number in package name from v14 to v15 gitaly-git2go: Change the package name from v14 to v15 update module updater for v15 Update the documentation for the module updater to reflect v15
2022-01-27Automatically clean up testhelper.ContextSami Hiltunen
testhelper.Context() currently return a cancellation function as a second return value. Majority of the tests do not need to explicitly cancel the context but they simply defer its cancellation to clean up after the test. Given this, we can reduce the test verbosity and make testhelper.Context easier to compose by removing the unnecessary second return value. This adds a t.Cleanup function to automatically cancel the context at the end of the tests and omits the returned cancellation function. Tests which simply `defer cancel()` have had the extra call removed. Some tests explicitly call the cancellation, and these tests have been modified to add context.WithCancel around the testhelper.Context call. There are a few loctions where testing.TB was passed down to test helpers that create the context.
2021-12-14tests: Convert to use testhelper contextsPatrick Steinhardt
We're about to disallow use of "normal" contexts created via the `context` package given that they do not perform sanity checks for feature flags. Instead, contexts should be created via the testhelper package. Convert tests to use the testhelper context.
2021-08-31global: Reformat sources with gofumptPatrick Steinhardt
Reformat sources with gofumpt.
2021-07-12Standardise package aliasesPavlo Strokov
It is not common to use snake case names for packages and package aliases in Go. The change renames aliases to a preferred single word name. We also use 'gitaly' prefix for the project-defined packages that clashes with standard or 3-rd party package names.
2021-04-21Use promauto to register Prometheus metricsSashi Kumar
2021-04-19global: Do not ignore write errorsPatrick Steinhardt
We're currently missing error checks for various invocations of `Write()` functions. Fix this issue by properly checking returned errors and drop the corresponding linter ignore rule.
2020-12-17token: Remove `tokenValidity` initializationPatrick Steinhardt
In order to support our ldflags hack which was removed in the preceding commit, we had separate variables for the token validation string and the actual duration. This was done so that one could pass a `-X` flag to the linker in order to override the string value and parse it into the real duration at initialization time. But given that we don't use that hack anymore, it's now useless. Let's remove this infrastructure now and just use the timeout directly.
2020-12-17auth: Introduce function to set token validity durationPatrick Steinhardt
Right now, it's not possible to modify the duration for which a token is valid outside of the `auth` package, but in fact we do rely on being able to do so in the authentication tests in `internal/gitaly/server`. As it's not possible to modify it via code, we instead rely on modifying its value via the Go's `-X` linker flag, which is quite awkward. This commit introduces a new function `SetTokenValidityDuration()` which allows us to fix this weirdness.
2020-12-17auth: Rename `timestampThreshold` to `tokenValidityDuration`Patrick Steinhardt
The `timestampThreshold` records how long a token is going to stay valid for authentication purposes. It's not quite obvious going by its name, so let's rename it to `tokenValidityDuration` to hopefullymake its purpose a bit more obvious.
2020-05-29Check auth before limit handlerJohn Cai
2020-04-17Drop support for Gitaly v1 authenticationPavlo Strokov
Removal of `RPCCredentials` as it was completely the same implementation as `RPCCredentialsV2`. Fix all places where `RPCCredentials` was used. Removal of `v1` token representation check and validation. Closes: https://gitlab.com/gitlab-org/gitaly/-/issues/2498
2020-04-14Static code analysis: introduction of new lintersPavlo Strokov
New linter 'unconvert' reports about unneeded type conversions.
2020-03-17Improving of static check analyze.Pavlo Strokov
`unused` linter was enabled to report about unused code. Unused code removed.
2020-02-27Remove V1 authentication methods for clientsZeger-Jan van de Weg
This change swaps V1 authentication with V2 without the caller knowing it did. This allows for a smooth transition toward V2. Idea taken from: https://gitlab.com/gitlab-org/gitaly/issues/2498#note_293995290
2020-02-20Clarify how Gitaly v2 auth worksJacob Vosmaer
2019-10-21Count v2 auth error return pathsJacob Vosmaer
2019-10-16Add go brace whitespace formatterJacob Vosmaer
2019-01-14Replace net/context with context packageZeger-Jan van de Weg
Leveraging `go fix` these changes were made, I only applied some regexp to get the import grouping correct. The old package can't be removed from vendor directory yet, as other dependencies depend on it.
2018-12-04Update to latest goimports formattingJacob Vosmaer
2018-09-06Allow server to receive an hmac token with the client timestamp for authAlejandro Rodríguez
2018-04-11Make more of the auth code public so we can reuse itJacob Vosmaer (GitLab)
2017-06-20Token authenticationJacob Vosmaer (GitLab)