Skip to content

Commit

Permalink
Merge pull request #75 from totegamma/feat/update-policy-system2
Browse files Browse the repository at this point in the history
update policy system
  • Loading branch information
totegamma authored Jul 20, 2024
2 parents 5704797 + 49010a4 commit cc75434
Show file tree
Hide file tree
Showing 30 changed files with 2,442 additions and 857 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,19 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get tag
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ matrix.image }}

- name: Get tag
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
tags: |
type=raw,value=latest,enable=${{ !contains(env.TAG, 'beta') }}
type=semver,pattern={{raw}}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
Expand Down
23 changes: 14 additions & 9 deletions client/mock/client.go

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

25 changes: 14 additions & 11 deletions cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,48 +206,51 @@ func main() {

client := client.NewClient()

agent := concurrent.SetupAgent(db, rdb, mc, client, conconf, config.Server.RepositoryPath)
globalPolicy := getDefaultGlobalPolicy()

policy := concurrent.SetupPolicyService(rdb, globalPolicy, conconf)
agent := concurrent.SetupAgent(db, rdb, mc, client, policy, conconf, config.Server.RepositoryPath)

domainService := concurrent.SetupDomainService(db, client, conconf)
domainHandler := domain.NewHandler(domainService)

userKvService := concurrent.SetupUserkvService(db)
userkvHandler := userkv.NewHandler(userKvService)

messageService := concurrent.SetupMessageService(db, rdb, mc, client, conconf)
messageService := concurrent.SetupMessageService(db, rdb, mc, client, policy, conconf)
messageHandler := message.NewHandler(messageService)

associationService := concurrent.SetupAssociationService(db, rdb, mc, client, conconf)
associationService := concurrent.SetupAssociationService(db, rdb, mc, client, policy, conconf)
associationHandler := association.NewHandler(associationService)

profileService := concurrent.SetupProfileService(db, rdb, mc, client, conconf)
profileService := concurrent.SetupProfileService(db, rdb, mc, client, policy, conconf)
profileHandler := profile.NewHandler(profileService)

timelineService := concurrent.SetupTimelineService(db, rdb, mc, client, conconf)
timelineService := concurrent.SetupTimelineService(db, rdb, mc, client, policy, conconf)
timelineHandler := timeline.NewHandler(timelineService)

entityService := concurrent.SetupEntityService(db, rdb, mc, client, conconf)
entityService := concurrent.SetupEntityService(db, rdb, mc, client, policy, conconf)
entityHandler := entity.NewHandler(entityService)

authService := concurrent.SetupAuthService(db, rdb, mc, client, conconf)
authService := concurrent.SetupAuthService(db, rdb, mc, client, policy, conconf)
authHandler := auth.NewHandler(authService)

keyService := concurrent.SetupKeyService(db, rdb, mc, client, conconf)
keyHandler := key.NewHandler(keyService)

ackService := concurrent.SetupAckService(db, rdb, mc, client, conconf)
ackService := concurrent.SetupAckService(db, rdb, mc, client, policy, conconf)
ackHandler := ack.NewHandler(ackService)

storeService := concurrent.SetupStoreService(db, rdb, mc, client, conconf, config.Server.RepositoryPath)
storeService := concurrent.SetupStoreService(db, rdb, mc, client, policy, conconf, config.Server.RepositoryPath)
storeHandler := store.NewHandler(storeService)

subscriptionService := concurrent.SetupSubscriptionService(db)
subscriptionService := concurrent.SetupSubscriptionService(db, rdb, mc, client, policy, conconf)
subscriptionHandler := subscription.NewHandler(subscriptionService)

jobService := concurrent.SetupJobService(db)
jobHandler := job.NewHandler(jobService)

apiV1 := e.Group("", auth.SetRequestPath, auth.ReceiveGatewayAuthPropagation)
apiV1 := e.Group("", auth.ReceiveGatewayAuthPropagation)
// store
apiV1.POST("/commit", storeHandler.Commit)

Expand Down
Loading

0 comments on commit cc75434

Please sign in to comment.