Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
94178d1
fix(front): replace link in ssh debug dropdown (#398)
tbogosavljevic Jun 17, 2025
1daa423
docs: fix RFCs guide reference (#348)
emmanuel-ferdman Jun 18, 2025
8406924
chore(guard): reduce guard logging volume and make logs more useful (…
hamir-suspect Jun 19, 2025
3628b4e
feat(security-toolbox): add flag for scanners (#404)
hamir-suspect Jun 19, 2025
bf965b8
docs: add info note about Okta usage (#401)
TomFern Jun 19, 2025
71dd864
fix(projecthub-rest-api): drop page size (#406)
dexyk Jun 20, 2025
a9b6931
fix(guard): update allowed id providers (#405)
VeljkoMaksimovic Jun 20, 2025
8260866
refactor: regenerate protobuf modules (#408)
forestileao Jun 20, 2025
2e5bbf3
feat: audit logs for "Stop Job" action (#392)
dexyk Jun 23, 2025
80775ff
fix(hooks_processor): Lower the log message level (#407)
hamir-suspect Jun 23, 2025
56cff6e
fix(hooks_processor): explicitly add jason as production dependency (…
hamir-suspect Jun 23, 2025
4153030
chore(front): Refresh protos (#412)
hamir-suspect Jun 25, 2025
c0095f5
fix(hooks-processor): Don't retry processing of hooks of unsupported …
DamjanBecirovic Jun 25, 2025
b8801c2
feat(front): partial pipeline rebuild in UI (#414)
skipi Jun 26, 2025
d4999d8
feat(v1alpha api): Allow passing parameters in Run Workflow API call …
DamjanBecirovic Jun 26, 2025
b522501
feat(rbac): enable okta login when creating integration (#416)
VeljkoMaksimovic Jun 27, 2025
a8e58aa
toil(front): add feature flag for pipeline rebuilds in the UI (#419)
skipi Jul 1, 2025
47af2ae
fix(api v1alpha): Use pipeline_file as param name in Run wf API (#420)
DamjanBecirovic Jul 2, 2025
6f4d195
feat(security-toolbox): allow scanners to be configured (#421)
skipi Jul 2, 2025
ec07d8a
fix(velocity): properly handle reports exceeding size limit (#395)
skipi Jul 4, 2025
b1ee30e
toil(guard): Error handling in update emails script (#423)
VeljkoMaksimovic Jul 4, 2025
aea409e
Starter templates Rspec and Elixir overhauls (#400)
csidyel Jul 8, 2025
3dcb4e8
docs: update container-registry.md (added Redis 8.0 and Valkey 8.1) (…
d-stefanovic Jul 9, 2025
6db0d9e
fix(plumber): check if DT permits user to partially rebuild pipeline …
hamir-suspect Jul 10, 2025
9526808
fix(plumber): handle skipped blocks in partial pipeline rebuilds (#429)
hamir-suspect Jul 14, 2025
b485c3a
fix(front): default simple template for new project onboarding (#430)
hamir-suspect Jul 14, 2025
19813e8
fix(public-api-gateway): add AMQP_URL env. var (#432)
dexyk Jul 14, 2025
cfab6f1
fix(front): Fix templates that dont have valid semaphore yamls (#433)
VeljkoMaksimovic Jul 14, 2025
1e93480
fix(ppl): Add label to schedule wf via api request (#436)
VeljkoMaksimovic Jul 16, 2025
02cc44a
toil(guard): Change abuseprevention address in guard (#437)
VeljkoMaksimovic Jul 16, 2025
531d900
Update get credentials script (#428)
radwo Jul 17, 2025
0754cd7
fix(public-api-gateway): add missing rabbitmq init container (#439)
radwo Jul 17, 2025
b1ace6d
config(public-api): increase memory resources (#440)
radwo Jul 18, 2025
c5fc907
toil(bootstrapper): fix CVE-2025-22868, bump go to 1.23 (#444)
skipi Jul 23, 2025
00507ce
toil(front): treat ppl name as a plain txt (#445)
radwo Jul 24, 2025
99ea842
feat(security-toolbox/docker): configure vuln-severity-source (#446)
dexyk Jul 24, 2025
9c286a7
docs: reorganize sidebars and readd infracost recipe (#438)
TomFern Jul 28, 2025
d418c3b
chore(hooks_processor): Do not log internal requests (#411)
hamir-suspect Jul 28, 2025
d9f6af0
docs: Update arm agent types (#402)
bogyo210 Jul 28, 2025
ab5caf7
fix(plumber): improve job matrix validation - env. var dups (#417)
dexyk Jul 29, 2025
f4dcc81
toil(github_hooks): check signature on all githubapp calls (#448)
radwo Jul 29, 2025
fa29fc6
fix(docs): ToC in API refernce page now shows self-hosted agents sect…
DamjanBecirovic Jul 30, 2025
8ac6304
fix(github_hooks): GHSA-353f-x4gh-cqq8 (#450)
skipi Jul 30, 2025
79b5df0
fix(github_hooks): encode branch, tag name when fetching reference (#…
dexyk Jul 30, 2025
31b7394
fix(front): update vulnerable npm packages (#455)
radwo Jul 31, 2025
11190c6
toil(front): strengthen CSP with base-uri and restrict external domai…
radwo Jul 31, 2025
4883fe2
feat(front): add css processing to asset pipeline (#452)
skipi Jul 31, 2025
3e7a39c
toil(front): restrict host in pollman (#454)
radwo Jul 31, 2025
e93d7d1
dev(front): enable live reload for front service in local development…
radwo Jul 31, 2025
dc998a8
fix(front): bring back storage.googleapis.com to connect_src (#456)
radwo Jul 31, 2025
2963beb
fix(front): move css loading from js => css (#457)
skipi Jul 31, 2025
9030709
fix(front): URL encode branch name in case in contains '&' or '?' cha…
VeljkoMaksimovic Jul 31, 2025
03403a3
fix(front): Specify `form_action: self` directive (#459)
VeljkoMaksimovic Jul 31, 2025
49c2a55
feat(front): allow some HTML tags in markdown reports (#388)
skipi Aug 1, 2025
7777499
fix(front): enable domain in form action (#460)
dexyk Aug 1, 2025
4a90fdd
fix(front): Extend timeout for rbac api calls (#462)
VeljkoMaksimovic Aug 4, 2025
ae52252
feat(front): Add new flutter templates (#461)
csidyel Aug 5, 2025
e9dba53
docs: add Trivy security scanner recipe (#464)
TomFern Aug 6, 2025
a8c10d3
fix: Several typos (#422)
pieterocp Aug 6, 2025
79f0374
feat: add project config option to control draft PR builds (#396)
skipi Aug 7, 2025
6ff7fc0
fix(front): form action restrictions (#471)
VeljkoMaksimovic Aug 8, 2025
4f93f0f
fix(front): Add storage.googleapis.com as a valid img_src to csp (#473)
VeljkoMaksimovic Aug 11, 2025
49d776b
fix(artifacthub): Reduce log noise and merge log messages for better …
hamir-suspect Aug 12, 2025
72bb9a9
toil(auth): switch to battle tested RemoteIp in IpFilter (#475)
radwo Aug 12, 2025
ab21ed6
toil(front): read org_id from headers (#477)
radwo Aug 13, 2025
725916f
toil(front): ensure resource ownership match for test results (#478)
radwo Aug 13, 2025
4622654
fix(branch_hub): Implement archive action and respond with status :OK…
hamir-suspect Aug 13, 2025
c3f003b
Restrict cache on forked prs (#480)
VeljkoMaksimovic Aug 14, 2025
bb990a3
fix(repository_hub): URL encode branch and tag names for GitLab API (…
radwo Aug 14, 2025
cbdfb26
fix(front): pipeline status message shows who triggered pipeline corr…
VeljkoMaksimovic Aug 14, 2025
134b4b9
fix(zebra): add ff for cachehub protection (#486)
VeljkoMaksimovic Aug 15, 2025
c07117d
feat: show artifact size in UI (#485)
hamir-suspect Aug 18, 2025
90bcb1b
feat(notifications): add authorization before sending notification (#…
VeljkoMaksimovic Aug 19, 2025
2b2e8f8
docs: Add note for cache in forked prs (#497)
VeljkoMaksimovic Aug 19, 2025
69ca01a
chore(github_hooks): upgrade rails version (#506)
hamir-suspect Aug 20, 2025
d5ca558
feat(front): display who was last to modify notification (#505)
VeljkoMaksimovic Aug 20, 2025
df37a16
toil(front): Add note about the project access when modifying notific…
VeljkoMaksimovic Aug 20, 2025
aac3063
Fail fast strategy should properly mark ppl as failed when one of the…
skipi Aug 21, 2025
fc16a88
docs: update to v1.4 and add latest changes (#512)
TomFern Aug 21, 2025
c271320
Add service account feature (#466)
skipi Aug 22, 2025
4b6d92d
feat(github_hooks): handle service account github repo host account (…
hamir-suspect Aug 22, 2025
e7ddc87
fix(github-hooks): support ready_for_review hook from github (#518)
skipi Aug 22, 2025
b4efe52
fix(guard): differentiate between various types of GRPC errors (#522)
skipi Aug 27, 2025
6bffc78
fix(guard): use correct field for generating service account email do…
skipi Aug 28, 2025
a58b285
fix(front): remove redundant checks from add people button visibility…
skipi Aug 29, 2025
8966404
fix(hooks_processor): add support for handling tag deletion hooks in …
dexyk Aug 29, 2025
c64dfa8
fix(rbac_ee): add debug logs (#528)
hamir-suspect Aug 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*/out/*
*/*/out/*
**/_wildcard*
**/.tool-versions
7 changes: 5 additions & 2 deletions .semaphore/daily-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,11 @@ blocks:
jobs:
- name: JS - dependencies
commands:
- make check.js.deps APP_DIRECTORY=assets
- make check.js.deps APP_DIRECTORY=assets SCAN_RESULT_DIR=../out
- name: JS - code
commands:
- export PATH=$PATH:/home/semaphore/.local/bin
- make check.js.code APP_DIRECTORY=assets
- make check.js.code APP_DIRECTORY=assets SCAN_RESULT_DIR=../out
- name: Elixir - dependencies
commands:
- make check.ex.deps CHECK_DEPS_OPTS='--ignore-packages phoenix'
Expand Down Expand Up @@ -1993,6 +1993,9 @@ blocks:
- name: "Test"
commands:
- make test
- name: "E2E Test"
commands:
- make test.e2e
- name: "Lint"
commands:
- make lint
Expand Down
7 changes: 5 additions & 2 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -789,11 +789,11 @@ blocks:
jobs:
- name: JS - dependencies
commands:
- make check.js.deps APP_DIRECTORY=assets
- make check.js.deps APP_DIRECTORY=assets SCAN_RESULT_DIR=../out
- name: JS - code
commands:
- export PATH=$PATH:/home/semaphore/.local/bin
- make check.js.code APP_DIRECTORY=assets
- make check.js.code APP_DIRECTORY=assets SCAN_RESULT_DIR=../out
- name: Elixir - dependencies
commands:
- make check.ex.deps CHECK_DEPS_OPTS='--ignore-packages phoenix'
Expand Down Expand Up @@ -2191,6 +2191,9 @@ blocks:
- name: "Test"
commands:
- make test
- name: "E2E Test"
commands:
- make test.e2e
- name: "Lint"
commands:
- make lint
Expand Down
2 changes: 1 addition & 1 deletion GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Semaphore follows a governance model that balances commercial stewardship with c
### Decision Visibility

- Technical decisions documented in issues/PRs
- Architecture decisions documented in [RFCs](../rfcs/README.md)
- Architecture decisions documented in [RFCs](rfcs/README.md)
- Roadmap publicly available

## Code of Conduct
Expand Down
6 changes: 3 additions & 3 deletions LOCAL-DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ For development and testing, you can run Semaphore locally using Minikube:

```bash
# Get credentials
kubectl get secret root-user -n default -o jsonpath='{.data.email}' | base64 -d
kubectl get secret root-user -n default -o jsonpath='{.data.password}' | base64 -d
kubectl get secret root-user -n default -o jsonpath='{.data.token}' | base64 -d
kubectl get secret semaphore-authentication -n default -o jsonpath='{.data.ROOT_USER_EMAIL}' | base64 -d
kubectl get secret semaphore-authentication -n default -o jsonpath='{.data.ROOT_USER_PASSWORD}' | base64 -d
kubectl get secret semaphore-authentication -n default -o jsonpath='{.data.ROOT_USER_TOKEN}' | base64 -d
```

Open `https://id.semaphore.localhost` and log in!
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ DOCKER_BUILD_PATH=.
EX_CATCH_WARRNINGS_FLAG=--warnings-as-errors
CHECK_DEPS_EXTRA_OPTS?=-w feature_provider,grpc_health_check,tentacat,util,watchman,fun_registry,sentry_grpc,traceman,cacheman,log_tee,spec,proto,sys2app,looper,job_matrix,definition_validator,gofer_client,open_api_spex,when,uuid,esaml,openid_connect,block
ROOT_MAKEFILE_PATH := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
SCAN_RESULT_DIR?=out

#
# Security checks
Expand Down Expand Up @@ -111,10 +112,10 @@ ifeq ($(CI),)
-v $$(pwd):/app \
-v $(ROOT_MAKEFILE_PATH)/security-toolbox:$(SECURITY_TOOLBOX_TMP_DIR) \
registry.semaphoreci.com/ruby:3 \
bash -c 'cd $(APP_DIRECTORY) && $(SECURITY_TOOLBOX_TMP_DIR)/dependencies --language $(LANGUAGE) -d $(CHECK_DEPS_OPTS)'
bash -c 'cd $(APP_DIRECTORY) && $(SECURITY_TOOLBOX_TMP_DIR)/dependencies --language $(LANGUAGE) -d --output-dir $(SCAN_RESULT_DIR) $(CHECK_DEPS_OPTS)'
else
# ruby version is set in prologue
cd $(APP_DIRECTORY) && $(ROOT_MAKEFILE_PATH)/security-toolbox/dependencies --language $(LANGUAGE) -d $(CHECK_DEPS_OPTS)
cd $(APP_DIRECTORY) && $(ROOT_MAKEFILE_PATH)/security-toolbox/dependencies --language $(LANGUAGE) -d --output-dir $(SCAN_RESULT_DIR) $(CHECK_DEPS_OPTS)
endif

check.ex.deps:
Expand Down
2 changes: 1 addition & 1 deletion artifacthub/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include ../Makefile

APP_NAME=artifacthub
APP_ENV=prod
INTERNAL_API_BRANCH=master
INTERNAL_API_BRANCH?=master

pb.gen:
rm -rf tmp && mkdir -p tmp
Expand Down
15 changes: 12 additions & 3 deletions artifacthub/pkg/api/descriptors/artifacthub/artifacthub.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion artifacthub/pkg/api/private/privateapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func ListTransferPath(ctx context.Context, client storage.Client, artifact *mode
return err
}

result = append(result, &artifacthub.ListItem{Name: item.Path, IsDirectory: item.IsDirectory})
result = append(result, &artifacthub.ListItem{Name: item.Path, IsDirectory: item.IsDirectory, Size: item.Size})
}

return nil
Expand Down
10 changes: 5 additions & 5 deletions artifacthub/pkg/server/private/privateserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ func Test__ListPath(t *testing.T) {
response, err := server.ListPath(context.TODO(), request)
assert.Nil(t, err)
assert.Equal(t, []*artifacthub.ListItem{
{Name: "artifacts/projects/first/file1.txt", IsDirectory: false},
{Name: "artifacts/projects/first/dir/", IsDirectory: true},
{Name: "artifacts/projects/first/file1.txt", IsDirectory: false, Size: 5},
{Name: "artifacts/projects/first/dir/", IsDirectory: true, Size: 0},
}, response.Items)
})

Expand All @@ -318,9 +318,9 @@ func Test__ListPath(t *testing.T) {
response, err := server.ListPath(context.TODO(), request)
assert.Nil(t, err)
assert.Equal(t, []*artifacthub.ListItem{
{Name: "artifacts/projects/first/dir/subfile1.txt", IsDirectory: false},
{Name: "artifacts/projects/first/dir/subfile2.txt", IsDirectory: false},
{Name: "artifacts/projects/first/file1.txt", IsDirectory: false},
{Name: "artifacts/projects/first/dir/subfile1.txt", IsDirectory: false, Size: 5},
{Name: "artifacts/projects/first/dir/subfile2.txt", IsDirectory: false, Size: 5},
{Name: "artifacts/projects/first/file1.txt", IsDirectory: false, Size: 5},
}, response.Items)
})
})
Expand Down
33 changes: 19 additions & 14 deletions artifacthub/pkg/server/public/publicserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ func getAuthTokenFromContext(ctx context.Context) (string, error) {
// artifact storage, and deleting as well.
func (s *Server) GenerateSignedURLs(ctx context.Context,
q *artifacts.GenerateSignedURLsRequest) (*artifacts.GenerateSignedURLsResponse, error) {
log.Info("[GenerateSignedURLs] Received", zap.Reflect("request", q))

response := &artifacts.GenerateSignedURLsResponse{}
token, err := getAuthTokenFromContext(ctx)
if err != nil {
Expand All @@ -93,12 +91,22 @@ func (s *Server) GenerateSignedURLs(ctx context.Context,
return response, nil
}

artifact, err := s.authenticate(token, q.Paths)
artifact, claims, err := s.authenticateAndGetClaims(token, q.Paths)
if err != nil {
log.Error("Error authenticating request", zap.Error(err))
return nil, err
}

log.Info("[GenerateSignedURLs] Authenticated request",
zap.String("type", q.Type.String()),
zap.Int("paths_count", len(q.Paths)),
zap.Strings("paths", q.Paths),
zap.String("artifact", claims.ArtifactID),
zap.String("project", claims.Project),
zap.String("job", claims.Job),
zap.String("workflow", claims.Workflow),
)

var us []*artifacts.SignedURL
switch q.Type {
case artifacts.GenerateSignedURLsRequest_PUSH:
Expand Down Expand Up @@ -177,26 +185,23 @@ func getMaxReceiveMessageSize() int {
return maxReceiveMsgSize
}

func (s *Server) authenticate(token string, paths []string) (*models.Artifact, error) {
func (s *Server) authenticateAndGetClaims(token string, paths []string) (*models.Artifact, *jwt.Claims, error) {
resourceType, resourceID, err := s.findAndValidateResource(paths)
if err != nil {
return nil, err
return nil, nil, err
}

claims, err := s.validateJWT(resourceType, resourceID, token)
if err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
return nil, nil, status.Error(codes.PermissionDenied, err.Error())
}

log.Info(
"Granted access to artifact storage through JWT",
zap.String("artifact", claims.ArtifactID),
zap.String("project", claims.Project),
zap.String("job", claims.Job),
zap.String("workflow", claims.Workflow),
)
artifacts, err := models.FindArtifactByID(claims.ArtifactID)
if err != nil {
return nil, nil, err
}

return models.FindArtifactByID(claims.ArtifactID)
return artifacts, claims, nil
}

func (s *Server) validateJWT(resourceType, resourceID, token string) (*jwt.Claims, error) {
Expand Down
1 change: 1 addition & 0 deletions artifacthub/pkg/storage/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type PathItem struct {
Path string
IsDirectory bool
Age *time.Duration
Size int64
}

type PathIterator interface {
Expand Down
4 changes: 2 additions & 2 deletions artifacthub/pkg/storage/gcs_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (b *GcsBucket) DeleteObjects(paths []string) error {

func (b *GcsBucket) ListPath(options ListOptions) (PathIterator, error) {
query := gcsstorage.Query{Prefix: pathutil.EndsInSlash(options.Path)}
err := query.SetAttrSelection([]string{"Name", "Created"})
err := query.SetAttrSelection([]string{"Name", "Created", "Size"})
if err != nil {
return nil, err
}
Expand All @@ -226,7 +226,7 @@ func (b *GcsBucket) ListPath(options ListOptions) (PathIterator, error) {

func (b *GcsBucket) ListObjectsWithPagination(options ListOptions) (ObjectPager, error) {
query := gcsstorage.Query{Prefix: pathutil.EndsInSlash(options.Path)}
err := query.SetAttrSelection([]string{"Name", "Created"})
err := query.SetAttrSelection([]string{"Name", "Created", "Size"})
if err != nil {
return nil, err
}
Expand Down
2 changes: 2 additions & 0 deletions artifacthub/pkg/storage/gcs_object_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func (i *GcsPathIterator) Next() (*PathItem, error) {
Path: attrs.Prefix,
IsDirectory: true,
Age: nil,
Size: 0, // Directories don't have a size
}, nil
}

Expand All @@ -41,6 +42,7 @@ func (i *GcsPathIterator) Next() (*PathItem, error) {
Path: attrs.Name,
IsDirectory: false,
Age: &age,
Size: attrs.Size,
}, nil
}

Expand Down
8 changes: 7 additions & 1 deletion artifacthub/pkg/storage/inmemstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (b *InMemoryBucket) Size() int {

func (b *InMemoryBucket) Add(path string, age time.Time) error {
newAge := time.Since(age)
b.Objects = append(b.Objects, &PathItem{Path: "artifacts" + path, Age: &newAge})
b.Objects = append(b.Objects, &PathItem{Path: "artifacts" + path, Age: &newAge, Size: 1024}) // Default size for testing

return nil
}
Expand Down Expand Up @@ -191,5 +191,11 @@ func (b *InMemoryBucket) SetCORS(ctx context.Context) error {
}

func (b *InMemoryBucket) CreateObject(ctx context.Context, name string, content []byte) error {
b.Objects = append(b.Objects, &PathItem{
Path: name,
IsDirectory: false,
Age: nil,
Size: int64(len(content)),
})
return nil
}
2 changes: 2 additions & 0 deletions artifacthub/pkg/storage/s3_object_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (i *S3PathIterator) nextAndIncrement() *PathItem {
Path: i.removePathPrefix(*next.Key),
IsDirectory: false,
Age: &age,
Size: *next.Size,
}
}

Expand All @@ -92,6 +93,7 @@ func (i *S3PathIterator) nextAndIncrement() *PathItem {
Path: i.removePathPrefix(*nextPrefix.Prefix),
IsDirectory: true,
Age: nil,
Size: 0, // Directories don't have a size
}
}

Expand Down
4 changes: 2 additions & 2 deletions artifacthub/pkg/workers/bucketcleaner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ The bucket cleaner is a distributed system based on supervisor/worker pattern.
In this system, we have:

- A supervisor called "Scheduler" that schedules which buckets need to be cleaned up
- A worker called "Worker" which listens to the suprvisor and executes the cleanup
- A worker called "Worker" which listens to the supervisor and executes the cleanup

Communication between the supervisor and the worker is done via AMQP.
The recomended setup for the system is to have one instance (in kubernetes a pod)
The recommended setup for the system is to have one instance (in kubernetes a pod)
that runs the scheduler, and multiple instances that listen and do the work.

Diagram of communication:
Expand Down
10 changes: 5 additions & 5 deletions auth/lib/auth.ex
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ defmodule Auth do
!org ->
send_resp(conn, 401, "Unauthorized")

Auth.IpFilter.block?(conn, org) ->
Auth.IpFilter.block?(conn.remote_ip, org) ->
send_resp(conn, 404, blocked_ip_response(conn))

true ->
Expand Down Expand Up @@ -326,7 +326,7 @@ defmodule Auth do
!org ->
{:error, :missing_organization, conn}

Auth.IpFilter.block?(conn, org) ->
Auth.IpFilter.block?(conn.remote_ip, org) ->
{:error, :unauthorized_ip, conn}

true ->
Expand Down Expand Up @@ -387,7 +387,7 @@ defmodule Auth do
!org ->
{:error, :missing_organization, conn}

Auth.IpFilter.block?(conn, org) ->
Auth.IpFilter.block?(conn.remote_ip, org) ->
{:error, :unauthorized_ip, conn}

true ->
Expand Down Expand Up @@ -416,7 +416,7 @@ defmodule Auth do
!org ->
{:error, :missing_organization, conn}

Auth.IpFilter.block?(conn, org) ->
Auth.IpFilter.block?(conn.remote_ip, org) ->
{:error, :unauthorized_ip, conn}

true ->
Expand Down Expand Up @@ -680,7 +680,7 @@ defmodule Auth do
end

defp blocked_ip_response(conn) do
ip = Auth.IpFilter.client_ip(conn) |> Tuple.to_list() |> Enum.join(".")
ip = conn.remote_ip |> :inet.ntoa()

"""
You cannot access this organization from your current IP address (#{ip}) due to the security settings enabled by the organization administrator.
Expand Down
Loading