Skip to content

Commit

Permalink
Fixed the security warnings. (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctreminiom authored Jun 17, 2024
1 parent c697e8f commit ec97dc8
Show file tree
Hide file tree
Showing 114 changed files with 3,709 additions and 2,626 deletions.
4 changes: 2 additions & 2 deletions pkg/infra/models/admin_organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ type UserProductAccessDataScheme struct {

// UserProductLastActiveScheme represents a product a user has access to.
type UserProductLastActiveScheme struct {
Id string `json:"id,omitempty"` // The ID of the product.
ID string `json:"id,omitempty"` // The ID of the product.
Key string `json:"key,omitempty"` // The key of the product.
Name string `json:"name,omitempty"` // The name of the product.
Url string `json:"url,omitempty"` // The URL of the product.
URL string `json:"url,omitempty"` // The URL of the product.
LastActive string `json:"last_active,omitempty"` // The last active time of the product.
}

Expand Down
109 changes: 59 additions & 50 deletions pkg/infra/models/admin_user.go
Original file line number Diff line number Diff line change
@@ -1,75 +1,84 @@
// Package models provides the data structures used in the admin user management.
package models

// AdminUserScheme represents an admin user account.
type AdminUserScheme struct {
Account *AdminUserAccountScheme `json:"account,omitempty"`
Account *AdminUserAccountScheme `json:"account,omitempty"` // The account details of the admin user.
}

// AdminUserAccountScheme represents the account details of an admin user.
type AdminUserAccountScheme struct {
AccountID string `json:"account_id,omitempty"`
Name string `json:"name,omitempty"`
Nickname string `json:"nickname,omitempty"`
ZoneInfo string `json:"zoneinfo,omitempty"`
Locale string `json:"locale,omitempty"`
Email string `json:"email,omitempty"`
Picture string `json:"picture,omitempty"`
AccountType string `json:"account_type,omitempty"`
AccountStatus string `json:"account_status,omitempty"`
EmailVerified bool `json:"email_verified,omitempty"`
ExtendedProfile *AdminUserExtendedProfileScheme `json:"extended_profile"`
PrivacySettings *AdminUserPrivacySettingsScheme `json:"privacy_settings"`
AccountID string `json:"account_id,omitempty"` // The account ID of the admin user.
Name string `json:"name,omitempty"` // The name of the admin user.
Nickname string `json:"nickname,omitempty"` // The nickname of the admin user.
ZoneInfo string `json:"zoneinfo,omitempty"` // The timezone information of the admin user.
Locale string `json:"locale,omitempty"` // The locale of the admin user.
Email string `json:"email,omitempty"` // The email of the admin user.
Picture string `json:"picture,omitempty"` // The picture of the admin user.
AccountType string `json:"account_type,omitempty"` // The account type of the admin user.
AccountStatus string `json:"account_status,omitempty"` // The account status of the admin user.
EmailVerified bool `json:"email_verified,omitempty"` // Whether the email of the admin user is verified.
ExtendedProfile *AdminUserExtendedProfileScheme `json:"extended_profile"` // The extended profile of the admin user.
PrivacySettings *AdminUserPrivacySettingsScheme `json:"privacy_settings"` // The privacy settings of the admin user.
}

// AdminUserExtendedProfileScheme represents the extended profile of an admin user.
type AdminUserExtendedProfileScheme struct {
JobTitle string `json:"job_title,omitempty"`
TeamType string `json:"team_type,omitempty"`
JobTitle string `json:"job_title,omitempty"` // The job title of the admin user.
TeamType string `json:"team_type,omitempty"` // The team type of the admin user.
}

// AdminUserPrivacySettingsScheme represents the privacy settings of an admin user.
type AdminUserPrivacySettingsScheme struct {
Name string `json:"name,omitempty"`
Nickname string `json:"nickname,omitempty"`
Picture string `json:"picture,omitempty"`
ExtendedProfileJobTitle string `json:"extended_profile.job_title,omitempty"`
ExtendedProfileDepartment string `json:"extended_profile.department,omitempty"`
ExtendedProfileOrganization string `json:"extended_profile.organization,omitempty"`
ExtendedProfileLocation string `json:"extended_profile.location,omitempty"`
ZoneInfo string `json:"zoneinfo,omitempty"`
Email string `json:"email,omitempty"`
ExtendedProfilePhoneNumber string `json:"extended_profile.phone_number,omitempty"`
ExtendedProfileTeamType string `json:"extended_profile.team_type,omitempty"`
Name string `json:"name,omitempty"` // The name privacy setting of the admin user.
Nickname string `json:"nickname,omitempty"` // The nickname privacy setting of the admin user.
Picture string `json:"picture,omitempty"` // The picture privacy setting of the admin user.
ExtendedProfileJobTitle string `json:"extended_profile.job_title,omitempty"` // The job title privacy setting of the admin user.
ExtendedProfileDepartment string `json:"extended_profile.department,omitempty"` // The department privacy setting of the admin user.
ExtendedProfileOrganization string `json:"extended_profile.organization,omitempty"` // The organization privacy setting of the admin user.
ExtendedProfileLocation string `json:"extended_profile.location,omitempty"` // The location privacy setting of the admin user.
ZoneInfo string `json:"zoneinfo,omitempty"` // The timezone information privacy setting of the admin user.
Email string `json:"email,omitempty"` // The email privacy setting of the admin user.
ExtendedProfilePhoneNumber string `json:"extended_profile.phone_number,omitempty"` // The phone number privacy setting of the admin user.
ExtendedProfileTeamType string `json:"extended_profile.team_type,omitempty"` // The team type privacy setting of the admin user.
}

// AdminUserPermissionGrantScheme represents a permission grant of an admin user.
type AdminUserPermissionGrantScheme struct {
Allowed bool `json:"allowed,omitempty"`
Reason *AdminUserPermissionGrantReasonScheme `json:"reason,omitempty"`
Allowed bool `json:"allowed,omitempty"` // Whether the permission is allowed.
Reason *AdminUserPermissionGrantReasonScheme `json:"reason,omitempty"` // The reason for the permission grant.
}

// AdminUserPermissionGrantReasonScheme represents the reason for a permission grant of an admin user.
type AdminUserPermissionGrantReasonScheme struct {
Key string `json:"key,omitempty"`
Key string `json:"key,omitempty"` // The key of the reason.
}

// AdminUserPermissionScheme represents the permissions of an admin user.
type AdminUserPermissionScheme struct {
EmailSet *AdminUserPermissionGrantScheme `json:"email.set,omitempty"`
LifecycleEnablement *AdminUserPermissionGrantScheme `json:"lifecycle.enablement,omitempty"`
Profile *AdminUserPermissionProfileScheme `json:"profile,omitempty"`
ProfileWrite *AdminUserPermissionProfileScheme `json:"profile.write,omitempty"`
ProfileRead *AdminUserPermissionGrantScheme `json:"profile.read,omitempty"`
LinkedAccountsRead *AdminUserPermissionGrantScheme `json:"linkedAccounts.read,omitempty"`
APITokenRead *AdminUserPermissionGrantScheme `json:"apiToken.read,omitempty"`
APITokenDelete *AdminUserPermissionGrantScheme `json:"apiToken.delete,omitempty"`
Avatar *AdminUserPermissionGrantScheme `json:"avatar,omitempty"`
PrivacySet *AdminUserPermissionGrantScheme `json:"privacy.set,omitempty"`
SessionRead *AdminUserPermissionGrantScheme `json:"session.read,omitempty"`
EmailSet *AdminUserPermissionGrantScheme `json:"email.set,omitempty"` // The email set permission of the admin user.
LifecycleEnablement *AdminUserPermissionGrantScheme `json:"lifecycle.enablement,omitempty"` // The lifecycle enablement permission of the admin user.
Profile *AdminUserPermissionProfileScheme `json:"profile,omitempty"` // The profile permission of the admin user.
ProfileWrite *AdminUserPermissionProfileScheme `json:"profile.write,omitempty"` // The profile write permission of the admin user.
ProfileRead *AdminUserPermissionGrantScheme `json:"profile.read,omitempty"` // The profile read permission of the admin user.
LinkedAccountsRead *AdminUserPermissionGrantScheme `json:"linkedAccounts.read,omitempty"` // The linked accounts read permission of the admin user.
APITokenRead *AdminUserPermissionGrantScheme `json:"apiToken.read,omitempty"` // The API token read permission of the admin user.
APITokenDelete *AdminUserPermissionGrantScheme `json:"apiToken.delete,omitempty"` // The API token delete permission of the admin user.
Avatar *AdminUserPermissionGrantScheme `json:"avatar,omitempty"` // The avatar permission of the admin user.
PrivacySet *AdminUserPermissionGrantScheme `json:"privacy.set,omitempty"` // The privacy set permission of the admin user.
SessionRead *AdminUserPermissionGrantScheme `json:"session.read,omitempty"` // The session read permission of the admin user.
}

// AdminUserPermissionProfileScheme represents the profile permissions of an admin user.
type AdminUserPermissionProfileScheme struct {
Name *AdminUserPermissionGrantScheme `json:"name,omitempty"`
Nickname *AdminUserPermissionGrantScheme `json:"nickname,omitempty"`
Zoneinfo *AdminUserPermissionGrantScheme `json:"zoneinfo,omitempty"`
Locale *AdminUserPermissionGrantScheme `json:"locale,omitempty"`
ExtendedProfilePhoneNumber *AdminUserPermissionGrantScheme `json:"extended_profile.phone_number,omitempty"`
ExtendedProfileJobTitle *AdminUserPermissionGrantScheme `json:"extended_profile.job_title,omitempty"`
ExtendedProfileOrganization *AdminUserPermissionGrantScheme `json:"extended_profile.organization,omitempty"`
ExtendedProfileDepartment *AdminUserPermissionGrantScheme `json:"extended_profile.department,omitempty"`
ExtendedProfileLocation *AdminUserPermissionGrantScheme `json:"extended_profile.location,omitempty"`
ExtendedProfileTeamType *AdminUserPermissionGrantScheme `json:"extended_profile.team_type,omitempty"`
Name *AdminUserPermissionGrantScheme `json:"name,omitempty"` // The name permission of the admin user.
Nickname *AdminUserPermissionGrantScheme `json:"nickname,omitempty"` // The nickname permission of the admin user.
Zoneinfo *AdminUserPermissionGrantScheme `json:"zoneinfo,omitempty"` // The timezone information permission of the admin user.
Locale *AdminUserPermissionGrantScheme `json:"locale,omitempty"` // The locale permission of the admin user.
ExtendedProfilePhoneNumber *AdminUserPermissionGrantScheme `json:"extended_profile.phone_number,omitempty"` // The phone number permission of the admin user.
ExtendedProfileJobTitle *AdminUserPermissionGrantScheme `json:"extended_profile.job_title,omitempty"` // The job title permission of the admin user.
ExtendedProfileOrganization *AdminUserPermissionGrantScheme `json:"extended_profile.organization,omitempty"` // The organization permission of the admin user.
ExtendedProfileDepartment *AdminUserPermissionGrantScheme `json:"extended_profile.department,omitempty"` // The department permission of the admin user.
ExtendedProfileLocation *AdminUserPermissionGrantScheme `json:"extended_profile.location,omitempty"` // The location permission of the admin user.
ExtendedProfileTeamType *AdminUserPermissionGrantScheme `json:"extended_profile.team_type,omitempty"` // The team type permission of the admin user.
}
14 changes: 10 additions & 4 deletions pkg/infra/models/admin_user_token.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
// Package models provides the data structures used in the user token management.
package models

import "time"

// UserTokensScheme represents a user token.
// ID is the unique identifier of the token.
// Label is the label assigned to the token.
// CreatedAt is the time when the token was created.
// LastAccess is the last time the token was accessed.
type UserTokensScheme struct {
ID string `json:"id,omitempty"`
Label string `json:"label,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
LastAccess time.Time `json:"lastAccess,omitempty"`
ID string `json:"id,omitempty"` // The ID of the user token.
Label string `json:"label,omitempty"` // The label of the user token.
CreatedAt time.Time `json:"createdAt,omitempty"` // The creation time of the user token.
LastAccess time.Time `json:"lastAccess,omitempty"` // The last access time of the user token.
}
21 changes: 13 additions & 8 deletions pkg/infra/models/agile_epic.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
// Package models provides the data structures used in the agile management.
package models

// EpicScheme represents an agile epic.
type EpicScheme struct {
ID int `json:"id,omitempty"`
Key string `json:"key,omitempty"`
Self string `json:"self,omitempty"`
Name string `json:"name,omitempty"`
Summary string `json:"summary,omitempty"`
Color *EpicColorScheme `json:"color,omitempty"`
Done bool `json:"done,omitempty"`
ID int `json:"id,omitempty"` // The ID of the epic.
Key string `json:"key,omitempty"` // The key of the epic.
Self string `json:"self,omitempty"` // The self URL of the epic.
Name string `json:"name,omitempty"` // The name of the epic.
Summary string `json:"summary,omitempty"` // The summary of the epic.
Color *EpicColorScheme `json:"color,omitempty"` // The color scheme of the epic.
Done bool `json:"done,omitempty"` // The status of the epic.
}

// EpicColorScheme represents the color scheme of an epic.
// Key is the key of the color scheme.
type EpicColorScheme struct {
Key string `json:"key,omitempty"`
Key string `json:"key,omitempty"` // The key of the color scheme.
}
44 changes: 44 additions & 0 deletions pkg/infra/models/agile_sprint.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
// Package models provides the data structures used in the agile sprint management.
package models

import "time"

// SprintScheme represents an agile sprint.
// ID is the unique identifier of the sprint.
// Self is the self URL of the sprint.
// State is the state of the sprint.
// Name is the name of the sprint.
// StartDate is the start date of the sprint.
// EndDate is the end date of the sprint.
// CompleteDate is the completion date of the sprint.
// OriginBoardID is the ID of the board where the sprint originated.
// Goal is the goal of the sprint.
type SprintScheme struct {
ID int `json:"id,omitempty"`
Self string `json:"self,omitempty"`
Expand All @@ -14,6 +25,13 @@ type SprintScheme struct {
Goal string `json:"goal,omitempty"`
}

// SprintPayloadScheme represents the payload for creating or updating a sprint.
// Name is the name of the sprint.
// StartDate is the start date of the sprint.
// EndDate is the end date of the sprint.
// OriginBoardID is the ID of the board where the sprint originated.
// Goal is the goal of the sprint.
// State is the state of the sprint.
type SprintPayloadScheme struct {
Name string `json:"name,omitempty"`
StartDate string `json:"startDate,omitempty"`
Expand All @@ -23,6 +41,12 @@ type SprintPayloadScheme struct {
State string `json:"state,omitempty"`
}

// SprintIssuePageScheme represents a page of issues in a sprint.
// Expand is a string that contains the instructions for expanding the issues in the page.
// StartAt is the starting index of the page.
// MaxResults is the maximum number of results per page.
// Total is the total number of issues.
// Issues is a slice of the issues in the page.
type SprintIssuePageScheme struct {
Expand string `json:"expand,omitempty"`
StartAt int `json:"startAt,omitempty"`
Expand All @@ -31,20 +55,40 @@ type SprintIssuePageScheme struct {
Issues []*SprintIssueScheme `json:"issues,omitempty"`
}

// SprintIssueScheme represents an issue in a sprint.
// Expand is a string that contains the instructions for expanding the issue.
// ID is the unique identifier of the issue.
// Self is the self URL of the issue.
// Key is the key of the issue.
type SprintIssueScheme struct {
Expand string `json:"expand,omitempty"`
ID string `json:"id,omitempty"`
Self string `json:"self,omitempty"`
Key string `json:"key,omitempty"`
}

// SprintMovePayloadScheme represents the payload for moving an issue in a sprint.
// Issues is a slice of the issues to be moved.
// RankBeforeIssue is the rank of the issue before the move.
// RankAfterIssue is the rank of the issue after the move.
// RankCustomFieldId is the ID of the custom field used for ranking.
type SprintMovePayloadScheme struct {
Issues []string `json:"issues,omitempty"`
RankBeforeIssue string `json:"rankBeforeIssue,omitempty"`
RankAfterIssue string `json:"rankAfterIssue,omitempty"`
RankCustomFieldId int `json:"rankCustomFieldId,omitempty"`
}

// SprintDetailScheme represents the details of a sprint.
// ID is the unique identifier of the sprint.
// State is the state of the sprint.
// Name is the name of the sprint.
// StartDate is the start date of the sprint.
// EndDate is the end date of the sprint.
// CompleteDate is the completion date of the sprint.
// OriginBoardID is the ID of the board where the sprint originated.
// Goal is the goal of the sprint.
// BoardID is the ID of the board where the sprint is located.
type SprintDetailScheme struct {
ID int `json:"id,omitempty"`
State string `json:"state,omitempty"`
Expand Down
Loading

0 comments on commit ec97dc8

Please sign in to comment.