Skip to content
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

bug fix: missing JWT function #268

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 8 additions & 2 deletions internal/delivery/http/permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ func NewPermissionHandler(usecase usecase.Usecase) *PermissionHandler {
// @Produce json
// @Success 200 {object} domain.PermissionSet
// @Router /permissions/templates [get]
// @Security JWT

func (h PermissionHandler) GetPermissionTemplates(w http.ResponseWriter, r *http.Request) {
permissionSet := domain.NewDefaultPermissionSet()

Expand All @@ -54,7 +56,9 @@ func (h PermissionHandler) GetPermissionTemplates(w http.ResponseWriter, r *http
// @Accept json
// @Produce json
// @Success 200 {object} domain.PermissionSet
// @Router /roles/{roleId}/permissions [get]
// @Router organizations/{organizationId}/roles/{roleId}/permissions [get]
// @Security JWT

func (h PermissionHandler) GetPermissionsByRoleId(w http.ResponseWriter, r *http.Request) {
// path parameter
var roleId string
Expand Down Expand Up @@ -93,7 +97,9 @@ func (h PermissionHandler) GetPermissionsByRoleId(w http.ResponseWriter, r *http
// @Param roleId path string true "Role ID"
// @Param body body domain.UpdatePermissionsByRoleIdRequest true "Update Permissions By Role ID Request"
// @Success 200
// @Router /roles/{roleId}/permissions [put]
// @Router organizations/{organizationId}/roles/{roleId}/permissions [put]
// @Security JWT

func (h PermissionHandler) UpdatePermissionsByRoleId(w http.ResponseWriter, r *http.Request) {
// path parameter
log.Debug("UpdatePermissionsByRoleId Called")
Expand Down
6 changes: 6 additions & 0 deletions internal/delivery/http/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func NewRoleHandler(usecase usecase.Usecase) *RoleHandler {
// @Param body body domain.CreateTksRoleRequest true "Create Tks Role Request"
// @Success 200 {object} domain.CreateTksRoleResponse
// @Router /organizations/{organizationId}/roles [post]
// @Security JWT

func (h RoleHandler) CreateTksRole(w http.ResponseWriter, r *http.Request) {
// path parameter
Expand Down Expand Up @@ -101,6 +102,8 @@ func (h RoleHandler) CreateTksRole(w http.ResponseWriter, r *http.Request) {
// @Param organizationId path string true "Organization ID"
// @Success 200 {object} domain.ListTksRoleResponse
// @Router /organizations/{organizationId}/roles [get]
// @Security JWT

func (h RoleHandler) ListTksRoles(w http.ResponseWriter, r *http.Request) {
// path parameter
var organizationId string
Expand Down Expand Up @@ -155,6 +158,7 @@ func (h RoleHandler) ListTksRoles(w http.ResponseWriter, r *http.Request) {
// @Param roleId path string true "Role ID"
// @Success 200 {object} domain.GetTksRoleResponse
// @Router /organizations/{organizationId}/roles/{roleId} [get]
// @Security JWT

func (h RoleHandler) GetTksRole(w http.ResponseWriter, r *http.Request) {
// path parameter
Expand Down Expand Up @@ -196,6 +200,7 @@ func (h RoleHandler) GetTksRole(w http.ResponseWriter, r *http.Request) {
// @Param roleId path string true "Role ID"
// @Success 200
// @Router /organizations/{organizationId}/roles/{roleId} [delete]
// @Security JWT

func (h RoleHandler) DeleteTksRole(w http.ResponseWriter, r *http.Request) {
// path parameter
Expand Down Expand Up @@ -229,6 +234,7 @@ func (h RoleHandler) DeleteTksRole(w http.ResponseWriter, r *http.Request) {
// @Param body body domain.UpdateTksRoleRequest true "Update Tks Role Request"
// @Success 200
// @Router /organizations/{organizationId}/roles/{roleId} [put]
// @Security JWT

func (h RoleHandler) UpdateTksRole(w http.ResponseWriter, r *http.Request) {
// path parameter
Expand Down
Loading