8000 feat: add all missing security records to write ops by polillomm · Pull Request #184 · goinfinite/os · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add all missing security records to write ops #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
1c5eb6b
feat: add CronSri constructor to SystemResourceIdentifier
polillomm Nov 4, 2024
42ea679
feat: add activity record creation on update account api key
polillomm Nov 4, 2024
29d8b76
refact: return CronId from create method
polillomm Nov 4, 2024
1e6685d
feat: add operator accountId and ipAddress to CreateCron DTO
polillomm Nov 4, 2024
ddac30a
feat: add CreateCron to CreateActivityRecords UC
polillomm Nov 4, 2024
2f7920a
feat: add activity record creatin to CreateCron UC and inject activit…
polillomm Nov 4, 2024
856fb51
feat: inject activityRecordCmdRepo to API and CLI controllers, but pr…
polillomm Nov 4, 2024
48c9c9b
refact: inject cronCmdRepo to use cases instead to initialize inside …
polillomm Nov 4, 2024
32586aa
refact: implements slog error to ReadCrons and return infra error to …
polillomm Nov 4, 2024
eb7bccd
refact: update CreateCron UC to use slog instead log
polillomm Nov 4, 2024
e38430e
refact: update UpdateCron UC to use slog instead log
polillomm Nov 4, 2024
ebb5a53
feat: add activity record creation to UpdateCron UC and inject activi…
polillomm Nov 4, 2024
cffc98f
8000 feat: add ReadByComment to CronQueryRepo
polillomm Nov 4, 2024
3c51ce1
fix: change DTO name to updateDto instead updateCron
polillomm Nov 4, 2024
8eaa295
refact: remove DeleteByComment from cronCmdRepo
polillomm Nov 4, 2024
821c40b
feat: add activity record creation to DeleteCron UC and inject activi…
polillomm Nov 4, 2024
9733d9f
feat: inject trailDbSvc to Database service layer
polillomm Nov 4, 2024
871b19b
feat: add activity record creation to CreateDatabase UC and inject ac…
polillomm Nov 5, 2024
5504b70
feat: add activity record creation to DeleteDatabase UC and inject ac…
polillomm Nov 5, 2024
b583b65
refact: remove DatabaseType from CreateDatabase DTO
polillomm Nov 5, 2024
3b097cf
feat: add params and query params reader to readRequestBody
polillomm Nov 5, 2024
22e79c4
refact: using new readRequestBody helper to get route params instead …
polillomm Nov 5, 2024
a7f0224
feat: add activity record creation to CreateDatabaseUser UC and injec…
polillomm Nov 5, 2024
acd5800
feat: add DeleteDatabaseUser DTO
polillomm Nov 5, 2024
a12a05a
feat: add activity record creation to DeleteDatabaseUser UC and injec…
polillomm Nov 5, 2024
1a92cf5
feat: inject trailDbSvc to Marketplace service layer
polillomm Nov 11, 2024
f87fae4
feat: add activity record creation to InstallMarketplaceCatalogItem U…
polillomm Nov 11, 2024
2d42874
feat: add activity record creation to DeleteMarketplaceInstalledItem …
polillomm Nov 11, 2024
c0c26ef
feat: inject trailDbSvc to Runtime service layer
polillomm Nov 11, 2024
be4628d
feat: add activity record creation to UpdatePhpConfigs UC and inject …
polillomm Nov 11, 2024
e77469f
feat: add NewMarketplaceCatalogItemSri to InstallMarketplaceCatalogIt…
polillomm Nov 11, 2024
7b95887
feat: add activity record creation to CreateInstallableService and Cr…
polillomm Nov 11, 2024
1b4fe31
feat: add activity record creation to UpdateService UC and inject act…
polillomm Nov 11, 2024
93297c0
feat: add InstalledServiceSri and implements to activity record from …
polillomm Nov 11, 2024
f5710dc
refact: indent CreateActivityRecord UC
polillomm Nov 11, 2024
87791ea
feat: add activity record creation to DeleteService UC and inject act…
polillomm Nov 11, 2024
30eb4e0
refact: remove enumerator from UpdatePhpConfigs on CreateActivityRecord
polillomm Nov 11, 2024
e47c9a6
feat: add activity records to SslPair and split SslId into two VOs
polillomm Nov 11, 2024
9d58511
feat: add activity record creation to DeleteSslPair UC and inject act…
polillomm Nov 12, 2024
e7e9934
feat: add activity record creation to DeleteSslPairVhosts UC and inje…
polillomm Nov 12, 2024
df2a0f6
feat: inject trailDbSvc to VirtualHost service layer
polillomm Nov 12, 2024
606c453
feat: add activity record creation to CreateVirtualHost UC and inject…
polillomm Nov 12, 2024
0a20dc5
feat: add activity record creation to DeleteSslPairVhosts
polillomm Nov 12, 2024
b4e1d04
feat: add activity record creation to DeleteVirtualHost UC and inject…
polillomm Nov 12, 2024
153bba5
refact: add json notations to DeleteMarketplaceInstalledItem DTO
polillomm Nov 12, 2024
c44af36
feat: add activity records to CreateMapping and propagate DTOs
polillomm Nov 12, 2024
52f086b
feat: add activity record creation to DeleteMapping UC and inject act…
polillomm Nov 12, 2024
750cf18
feat: add activity record creation to all FileManager use cases and i…
polillomm Nov 12, 2024
19aa374
refact: return infra error when read throw an error
polillomm Nov 13, 2024
e317db6
refact: using only ReadRequestBody API helper instead to get from URL…
polillomm Nov 13, 2024
47cfc02
chore: update swagger
polillomm Nov 13, 2024
c4e100d
chore: bump version and add task to CHANGELOG
polillomm Nov 13, 2024
da8bcb9
chore: update swagger
polillomm Nov 13, 2024
4d8a6ef
chore: merge pull request goinfinite#183
polillomm Nov 26, 2024
30be0ce
refact: remove all params names from repository interfaces
polillomm Nov 26, 2024
cd8a216
refact: change helper name to improve readability
polillomm Nov 26, 2024
643b46f
refact: remove useless info logs from some use cases
polillomm Nov 26, 2024
47c1f2a
refact: remove primaryVirtualHost from JSON tags in DeleteVirtualHost UC
polillomm Nov 27, 2024
662c58f
refact: change CreateTrash method name to CreateGeneralTrash
polillomm Nov 27, 2024
6cc2133
refact: improve string hasher method name
polillomm Nov 27, 2024
1db1f15
refact: using operatorIpAddress and operatorAccountId on file manager…
polillomm Nov 27, 2024
1260ca7
fix: return UC call instead two returns
polillomm Nov 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

```log
0.1.5 - 2024/X/X
feat: add all missing security records to write ops
fix: download files with more than 5MB in size

0.1.4 - 2024/X/X
Expand Down
18 changes: 12 additions & 6 deletions src/domain/dto/compressUnixFiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,25 @@ package dto
import "github.com/goinfinite/os/src/domain/valueObject"

type CompressUnixFiles struct {
SourcePaths []valueObject.UnixFilePath `json:"sourcePaths"`
DestinationPath valueObject.UnixFilePath `json:"destinationPath"`
CompressionType *valueObject.UnixCompressionType `json:"compressionType"`
SourcePaths []valueObject.UnixFilePath `json:"sourcePaths"`
DestinationPath valueObject.UnixFilePath `json:"destinationPath"`
CompressionType *valueObject.UnixCompressionType `json:"compressionType"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewCompressUnixFiles(
sourcePaths []valueObject.UnixFilePath,
destinationPath valueObject.UnixFilePath,
compressionType *valueObject.UnixCompressionType,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) CompressUnixFiles {
return CompressUnixFiles{
SourcePaths: sourcePaths,
DestinationPath: destinationPath,
CompressionType: compressionType,
SourcePaths: sourcePaths,
DestinationPath: destinationPath,
CompressionType: compressionType,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
18 changes: 12 additions & 6 deletions src/domain/dto/copyUnixFile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,25 @@ package dto
import "github.com/goinfinite/os/src/domain/valueObject"

type CopyUnixFile struct {
SourcePath valueObject.UnixFilePath `json:"sourcePath"`
DestinationPath valueObject.UnixFilePath `json:"destinationPath"`
ShouldOverwrite bool `json:"shouldOverwrite"`
SourcePath valueObject.UnixFilePath `json:"sourcePath"`
DestinationPath valueObject.UnixFilePath `json:"destinationPath"`
ShouldOverwrite bool `json:"shouldOverwrite"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewCopyUnixFile(
sourcePath valueObject.UnixFilePath,
destinationPath valueObject.UnixFilePath,
shouldOverwrite bool,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) CopyUnixFile {
return CopyUnixFile{
SourcePath: sourcePath,
DestinationPath: destinationPath,
ShouldOverwrite: shouldOverwrite,
SourcePath: sourcePath,
DestinationPath: destinationPath,
ShouldOverwrite: shouldOverwrite,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
18 changes: 12 additions & 6 deletions src/domain/dto/createCron.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,25 @@ package dto
import "github.com/goinfinite/os/src/domain/valueObject"

type CreateCron struct {
Schedule valueObject.CronSchedule `json:"schedule"`
Command valueObject.UnixCommand `json:"command"`
Comment *valueObject.CronComment `json:"comment"`
Schedule valueObject.CronSchedule `json:"schedule"`
Command valueObject.UnixCommand `json:"command"`
Comment *valueObject.CronComment `json:"comment"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewCreateCron(
schedule valueObject.CronSchedule,
command valueObject.UnixCommand,
comment *valueObject.CronComment,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) CreateCron {
return CreateCron{
Schedule: schedule,
Command: command,
Comment: comment,
Schedule: schedule,
Command: command,
Comment: comment,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
6 changes: 6 additions & 0 deletions src/domain/dto/createCustomService.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ type CreateCustomService struct {
LogOutputPath *valueObject.UnixFilePath `json:"logOutputPath"`
LogErrorPath *valueObject.UnixFilePath `json:"logErrorPath"`
AutoCreateMapping *bool `json:"autoCreateMapping"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewCreateCustomService(
Expand All @@ -39,6 +41,8 @@ func NewCreateCustomService(
timeoutStartSecs, maxStartRetries *uint,
logOutputPath, logErrorPath *valueObject.UnixFilePath,
autoCreateMapping *bool,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) CreateCustomService {
return CreateCustomService{
Name: name,
Expand All @@ -61,5 +65,7 @@ func NewCreateCustomService(
LogOutputPath: logOutputPath,
LogErrorPath: logErrorPath,
AutoCreateMapping: autoCreateMapping,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
10 changes: 8 additions & 2 deletions src/domain/dto/createDatabase.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ package dto
import "github.com/goinfinite/os/src/domain/valueObject"

type CreateDatabase struct {
DatabaseName valueObject.DatabaseName `json:"dbName"`
DatabaseName valueObject.DatabaseName `json:"dbName"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewCreateDatabase(
dbName valueObject.DatabaseName,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) CreateDatabase {
return CreateDatabase{
DatabaseName: dbName,
DatabaseName: dbName,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
22 changes: 14 additions & 8 deletions src/domain/dto/createDatabaseUser.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,28 @@ package dto
import "github.com/goinfinite/os/src/domain/valueObject"

type CreateDatabaseUser struct {
DatabaseName valueObject.DatabaseName `json:"dbName"`
Username valueObject.DatabaseUsername `json:"username"`
Password valueObject.Password `j 10000 son:"password"`
Privileges []valueObject.DatabasePrivilege `json:"privileges"`
DatabaseName valueObject.DatabaseName `json:"dbName"`
Username valueObject.DatabaseUsername `json:"username"`
Password valueObject.Password `json:"password"`
Privileges []valueObject.DatabasePrivilege `json:"privileges"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewCreateDatabaseUser(
dbName valueObject.DatabaseName,
username valueObject.DatabaseUsername,
password valueObject.Password,
privileges []valueObject.DatabasePrivilege,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) CreateDatabaseUser {
return CreateDatabaseUser{
DatabaseName: dbName,
Username: username,
Password: password,
Privileges: privileges,
DatabaseName: dbName,
Username: username,
Password: password,
Privileges: privileges,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
6 changes: 6 additions & 0 deletions src/domain/dto/createInstallableService.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type CreateInstallableService struct {
AutoRestart *bool `json:"autoRestart"`
MaxStartRetries *uint `json:"maxStartRetries"`
AutoCreateMapping *bool `json:"autoCreateMapping"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewCreateInstallableService(
Expand All @@ -26,6 +28,8 @@ func NewCreateInstallableService(
autoRestart *bool,
maxStartRetries *uint,
autoCreateMapping *bool,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) CreateInstallableService {
return CreateInstallableService{
Name: name,
Expand All @@ -38,5 +42,7 @@ func NewCreateInstallableService(
AutoRestart: autoRestart,
MaxStartRetries: maxStartRetries,
AutoCreateMapping: autoCreateMapping,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
6 changes: 6 additions & 0 deletions src/domain/dto/createMapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ type CreateMapping struct {
TargetType valueObject.MappingTargetType `json:"targetType"`
TargetValue *valueObject.MappingTargetValue `json:"targetValue"`
TargetHttpResponseCode *valueObject.HttpResponseCode `json:"targetHttpResponseCode"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewCreateMapping(
Expand All @@ -18,6 +20,8 @@ func NewCreateMapping(
targetType valueObject.MappingTargetType,
targetValue *valueObject.MappingTargetValue,
targetHttpResponseCode *valueObject.HttpResponseCode,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) CreateMapping {
return CreateMapping{
Hostname: hostname,
Expand All @@ -26,5 +30,7 @@ func NewCreateMapping(
TargetType: targetType,
TargetValue: targetValue,
TargetHttpResponseCode: targetHttpResponseCode,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
6 changes: 6 additions & 0 deletions src/domain/dto/createSslPair.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@ type CreateSslPair struct {
VirtualHostsHostnames []valueObject.Fqdn `json:"virtualHostsHostnames"`
Certificate entity.SslCertificate `json:"certificate"`
Key valueObject.SslPrivateKey `json:"key"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewCreateSslPair(
virtualHostsHostnames []valueObject.Fqdn,
certificate entity.SslCertificate,
key valueObject.SslPrivateKey,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) CreateSslPair {
return CreateSslPair{
VirtualHostsHostnames: virtualHostsHostnames,
Certificate: certificate,
Key: key,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
18 changes: 12 additions & 6 deletions src/domain/dto/createUnixFile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ package dto
import "github.com/goinfinite/os/src/domain/valueObject"

type CreateUnixFile struct {
FilePath valueObject.UnixFilePath `json:"filePath"`
Permissions valueObject.UnixFilePermissions `json:"permissions"`
MimeType valueObject.MimeType `json:"mimeType"`
FilePath valueObject.UnixFilePath `json:"filePath"`
Permissions valueObject.UnixFilePermissions `json:"permissions"`
MimeType valueObject.MimeType `json:"mimeType"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewCreateUnixFile(
filePath valueObject.UnixFilePath,
permissionsPtr *valueObject.UnixFilePermissions,
mimeType valueObject.MimeType,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) CreateUnixFile {
permissions, _ := valueObject.NewUnixFilePermissions("644")
if mimeType.IsDir() {
Expand All @@ -23,8 +27,10 @@ func NewCreateUnixFile(
}

return CreateUnixFile{
FilePath: filePath,
Permissions: permissions,
MimeType: mimeType,
FilePath: filePath,
Permissions: permissions,
MimeType: mimeType,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
18 changes: 12 additions & 6 deletions src/domain/dto/createVirtualHost.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,25 @@ package dto
import "github.com/goinfinite/os/src/domain/valueObject"

type CreateVirtualHost struct {
Hostname valueObject.Fqdn `json:"hostname"`
Type valueObject.VirtualHostType `json:"type"`
ParentHostname *valueObject.Fqdn `json:"parentHostname"`
Hostname valueObject.Fqdn `json:"hostname"`
Type valueObject.VirtualHostType `json:"type"`
ParentHostname *valueObject.Fqdn `json:"parentHostname"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewCreateVirtualHost(
hostname valueObject.Fqdn,
vhostType valueObject.VirtualHostType,
parentHostname *valueObject.Fqdn,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) CreateVirtualHost {
return CreateVirtualHost{
Hostname: hostname,
Type: vhostType,
ParentHostname: parentHostname,
Hostname: hostname,
Type: vhostType,
ParentHostname: parentHostname,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
14 changes: 10 additions & 4 deletions src/domain/dto/deleteCron.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@ package dto
import "github.com/goinfinite/os/src/domain/valueObject"

type DeleteCron struct {
Id *valueObject.CronId `json:"id"`
Comment *valueObject.CronComment `json:"comment"`
Id *valueObject.CronId `json:"id"`
Comment *valueObject.CronComment `json:"comment"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewDeleteCron(
id *valueObject.CronId,
comment *valueObject.CronComment,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) DeleteCron {
return DeleteCron{
Id: id,
Comment: comment,
Id: id,
Comment: comment,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
21 changes: 21 additions & 0 deletions src/domain/dto/deleteDatabase.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package dto

import "github.com/goinfinite/os/src/domain/valueObject"

type DeleteDatabase struct {
DatabaseName valueObject.DatabaseName `json:"dbName"`
OperatorAccountId valueObject.AccountId `json:"-"`
OperatorIpAddress valueObject.IpAddress `json:"-"`
}

func NewDeleteDatabase(
dbName valueObject.DatabaseName,
operatorAccountId valueObject.AccountId,
operatorIpAddress valueObject.IpAddress,
) DeleteDatabase {
return DeleteDatabase{
DatabaseName: dbName,
OperatorAccountId: operatorAccountId,
OperatorIpAddress: operatorIpAddress,
}
}
Loading
0