Commit Graph

17 Commits

Author SHA1 Message Date
Erik Seliger
9435fde3a2
Remove unused package (#63646)
This package isn't in use anymore, so cleaning it up.

Test plan:

Go compiler doesn't complain.
2024-07-10 02:30:28 +02:00
Noah S-C
9b6ba7741e
bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
Vincent
a3816d2a98
Remove dotcom specific gmail abuse check (#60837)
* remove dotcom specific gmail abuse check

This is being handled elsewhere now.

* remove banlists

* bazel
2024-03-05 15:14:03 +00:00
Erik Seliger
2c1d7bd626
Move dotcom check out of cmd/frontend (#60810)
Simple refactor, moved the methods into internal/dotcom so that we don't import across package boundaries.

Simply moved code, existing test suites will find issues.
2024-03-04 16:05:16 +00:00
Naman Kumar
3b5f57d692
Add logic to auto disable google signups from non-gmail domain for 24hrs if too many signups from same domain. (#59243)
* Put email domain abuse checks

* Update error message

* Minor refactoring and remove redundant checks (#59266)

* Minor refactoring and remove redundant checks

* Check for reason in function call

---------

Co-authored-by: Petri-Johan Last <petri.last@sourcegraph.com>
2024-01-02 15:37:14 +05:30
Vincent
009774658f
Allow banning of email domains for DotCom registration (#56278) 2023-08-30 21:44:52 +00:00
Jean-Hadrien Chabran
3d36d34b3d
ci: re-enable race detection (#52776)
The previous approach to enable race detection was too radical and
accidently led to build our binaries with the race flage enabled, which
caused issues when building images down the line.

This happened because putting a `test --something` in bazelrc also sets
it on `build` which is absolutely not what we wanted. Usually folks get
this one working by having a `--stamp` config setting that fixes this
when releasing binaries, which we don't at this stage, as we're still
learning Bazel.

Luckily, this was caught swiftly. The current approach insteads takes a
more granular approach, which makes the `go_test` rule uses our own
variant, which injects the `race = "on"` attribute, but only on
`go_test`.


## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

CI, being a main-dry-run, this will cover the container building jobs,
which were the ones failing.

---------

Co-authored-by: Alex Ostrikov <alex.ostrikov@sourcegraph.com>
2023-06-05 20:41:47 +02:00
Dave Try
2b8fa079f0
bazel: fix buf files (#49444)
fix protoc-gen-go version
2023-03-15 20:21:38 +00:00
Dave Try
293385d5dd
bazel: update timeouts to suppress warnings (#49399)
Updates all of the BUILD fields with timeouts to suppress warnings and
reduce log spam.


## Test plan

Green CI
2023-03-15 15:04:16 +02:00
Jean-Hadrien Chabran
7c55c2351e
bk: add soft-failing bazel jobs (#47601)
This PR introduces soft-failing bazel jobs which are running on all
builds, as way to gather experience and feedback on running Bazel in CI.

Changes in the go code are mostly about adding missing git configuration
bits that were failing in the sandbox.

## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

CI will show up bazel stuff, but ok to fail. 


![image](https://user-images.githubusercontent.com/10151/223689285-ba4f91f9-991e-42ba-b333-f8adfd503ee9.png)

---------

Co-authored-by: Greg Magolan <gmagolan@gmail.com>
2023-03-08 11:28:18 +00:00
Jean-Hadrien Chabran
bc5490c4bb
bazel: introduce build files for Go (#46770) 2023-01-23 14:00:01 +01:00
Vincent
42d26a0a20
Add a module for interacting with GSM (#45661)
* add a module for interacting with GSM
2022-12-16 20:50:33 +01:00
Will Dollman
5473007223
Fix gitoliteHost validation (#44812)
* Fix gitoliteHost validation

* Validate usernames in host strings

* Change test hostname to one that resolves

* Add another failing test case for TestAddrValidation

* Use lazyregexp to cache compilation

* Perform less expensive check first

* Use named test cases

* Fix historic ineffectual assignment

* Use valid IP in unit tests
2022-11-29 10:10:58 +00:00
Vincent
5f37217c60
Add hostname validation (#42553)
* add host validation

* validate gitolite host
2022-10-06 14:09:59 +02:00
Vincent
91724a108d
Make password policy a standard feature (#39213)
* refactor and adding tests

* update schema for new policy

* remove PasswordPolicy from default dev config

* add more tests, fix bugs

* Add PasswordPolicy changes to frontend

* add PasswordPolicy jsoncontext for frontend

* add PasswordPolicy to schema

* create security helper functions, code re-use

* dedup validatePassword functionality

* remove duplicate auth.passwordPolicy

* always use minPasswordLen

* fix build, add types, fix tests

* add experimental passwordpolicy back to schema

* refactor, dedup password requirement check

* add more tests

* refactor, run linters

* add deprecation notices

* always return a GenericPasswordPolicy

* remove conf.go move to general conf

* remove interface type

* deprecate PasswordPolicy

* fix tests, refactor

* run pretty

* serialize json as frontend expects

* Apply suggestions from code review

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>

* Apply suggestions from code review

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>

* change test to be table driven

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2022-07-26 18:04:54 +02:00
Robert Lin
74ebfb7b6a
dev: fix golangci-lint, re-enable depguard, disable nolintlint (#34298)
Co-authored-by: Eric Fritz <eric@eric-fritz.com>
2022-04-21 19:37:04 +00:00
david-sandy
fbb976a76d
New Password Policy (#31881)
* Changes for backend

* Corrected operator

* Update security.go

* Updated Unit Tests

* Temp push

* Fixup schema definition

* Final Changes

* Updated for testing

* Updated test-cases

* Removed unused import

* Moved to sync

* Updated format.

* Update internal/security/security.go

Co-authored-by: Erik Seliger <erikseliger@me.com>

* Update internal/security/security.go

Co-authored-by: Erik Seliger <erikseliger@me.com>

* Update internal/security/security.go

Co-authored-by: Erik Seliger <erikseliger@me.com>

* Updated test-cases

* Added Password Requirements

* Updated test cases

* Updated formatting

* Added minLength

* Added note to keep in sync

* This shouldn't have been updated.

* Update internal/database/users.go

Co-authored-by: Erik Seliger <erikseliger@me.com>

* Update security.go

* Fixup formatting of site.schema.json

* Updated format

* Update security.go

* Update security.go

* Update security.go

* Update UserSettingsSecurityPage.tsx

* ESLint Fixes

* Update SignUpForm.tsx

* Update SignUpForm.tsx

* Update users_test.go

* Update users_test.go

* Update users_test.go

* Update users_test.go

* Update users_test.go

* Update users_test.go

* Added experimental features to context

* Update security.go

* Update SignUpForm.tsx

* Updated string conversion

* Resolved undefined reference

* Update SignUpForm.tsx

* fix failing test

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>

* update signuppage snapshot

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>

* fix linter complaint about optional chains

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>

* pass experimentalFeatures through

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>

* Format

* properly pass context to functions

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>

* Format after Stephen Change

* Updated tests

* Update mock_client.go

Co-authored-by: Erik Seliger <erikseliger@me.com>
Co-authored-by: Stephen Gutekanst <stephen@sourcegraph.com>
2022-04-11 11:29:35 -05:00