Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
7800f98
ready for oauth
abu-b-sidq Nov 4, 2024
dc2514c
intermediate
abu-b-sidq Nov 12, 2024
06433d4
issue type and custom fields created
abu-b-sidq Nov 14, 2024
a01a77c
dev complete
abu-b-sidq Dec 10, 2024
c3e4785
testing jenkins
abu-b-sidq Dec 19, 2024
b546d26
testing jenkins
abu-b-sidq Dec 19, 2024
cbb3e68
testing jenkins
abu-b-sidq Dec 19, 2024
100c32e
testing jenkins
abu-b-sidq Dec 19, 2024
ba2628b
testing jenkins
abu-b-sidq Dec 19, 2024
d3db51f
testing jenkins
abu-b-sidq Dec 19, 2024
271a21b
testing jenkins
abu-b-sidq Dec 19, 2024
3fb79be
testing jenkins
abu-b-sidq Dec 19, 2024
a0bee21
testing jenkins
abu-b-sidq Dec 19, 2024
2c0ef2a
testing jenkins
abu-b-sidq Dec 19, 2024
3f9e619
testing jenkins
abu-b-sidq Dec 19, 2024
c3141d7
testing jenkins
abu-b-sidq Dec 19, 2024
33797ca
testing jenkins
abu-b-sidq Dec 19, 2024
d7111d2
testing jenkins
abu-b-sidq Dec 19, 2024
dd1a3cc
testing jenkins
abu-b-sidq Dec 19, 2024
1bc77d5
testing jenkins
abu-b-sidq Dec 19, 2024
b92248b
testing jenkins
abu-b-sidq Dec 19, 2024
07c00f8
testing jenkins
abu-b-sidq Dec 19, 2024
e61227b
testing jenkins
abu-b-sidq Dec 19, 2024
99f593a
testing jenkins
abu-b-sidq Dec 19, 2024
d6804eb
testing jenkins
abu-b-sidq Dec 19, 2024
26e25ac
testing jenkins
abu-b-sidq Dec 19, 2024
74123dd
testing jenkins
abu-b-sidq Dec 19, 2024
0fc8bb0
testing jenkins
abu-b-sidq Dec 19, 2024
093245b
testing jenkins
abu-b-sidq Dec 19, 2024
d4948e5
testing jenkins
abu-b-sidq Dec 19, 2024
a86cbc3
testing jenkins
abu-b-sidq Dec 19, 2024
55019e5
testing jenkins
abu-b-sidq Dec 19, 2024
5fd3638
testing jenkins
abu-b-sidq Dec 19, 2024
7717611
testing jenkins
abu-b-sidq Dec 19, 2024
f54c03c
testing jenkins
abu-b-sidq Dec 19, 2024
e99955f
testing jenkins
abu-b-sidq Dec 19, 2024
f25596f
testing jenkins
abu-b-sidq Dec 19, 2024
5be1055
testing jenkins
abu-b-sidq Dec 19, 2024
17d2ee0
testing jenkins
abu-b-sidq Dec 19, 2024
102dc72
testing jenkins
abu-b-sidq Dec 19, 2024
abcaa3f
testing jenkins
abu-b-sidq Dec 19, 2024
0d7efc8
testing jenkins
abu-b-sidq Dec 19, 2024
ab4a1e5
testing jenkins
abu-b-sidq Dec 19, 2024
8b6fac6
testing jenkins
abu-b-sidq Dec 19, 2024
aa5ec50
testing jenkins
abu-b-sidq Dec 19, 2024
809a63b
testing jenkins
abu-b-sidq Dec 19, 2024
f4b5273
testing jenkins
abu-b-sidq Dec 19, 2024
4f272e9
testing jenkins
abu-b-sidq Dec 19, 2024
f6961ef
testing jenkins
abu-b-sidq Dec 19, 2024
e8fde6e
testing jenkins
abu-b-sidq Dec 19, 2024
ecd4c78
testing jenkins
abu-b-sidq Dec 19, 2024
71880d5
testing jenkins
abu-b-sidq Dec 19, 2024
40a209b
testing jenkins
abu-b-sidq Dec 19, 2024
c4e76bc
testing jenkins
abu-b-sidq Dec 19, 2024
a180116
testing jenkins
abu-b-sidq Dec 19, 2024
8e926b1
testing jenkins
abu-b-sidq Dec 19, 2024
e8c8eaf
testing jenkins
abu-b-sidq Dec 19, 2024
b2e1a72
testing jenkins
abu-b-sidq Dec 19, 2024
c9df844
testing jenkins
abu-b-sidq Dec 19, 2024
555ee5c
testing jenkins
abu-b-sidq Dec 19, 2024
19166f6
testing jenkins
abu-b-sidq Dec 19, 2024
574033c
testing jenkins
abu-b-sidq Dec 19, 2024
0b836dd
testing jenkins
abu-b-sidq Dec 19, 2024
805710d
testing jenkins
abu-b-sidq Dec 19, 2024
a08074b
testing jenkins
abu-b-sidq Dec 19, 2024
caa9341
testing jenkins
abu-b-sidq Dec 19, 2024
240b47a
testing jenkins
abu-b-sidq Dec 19, 2024
3e66925
testing jenkins
abu-b-sidq Dec 19, 2024
c861bc9
testing jenkins
abu-b-sidq Dec 19, 2024
c0fb7b6
testing jenkins
abu-b-sidq Dec 19, 2024
8964187
testing jenkins
abu-b-sidq Dec 19, 2024
50e257e
testing jenkins
abu-b-sidq Dec 19, 2024
1747cef
testing jenkins
abu-b-sidq Dec 19, 2024
150410d
Testing Multiple Dev
abu-b-sidq Dec 19, 2024
2ae579f
Testing Multiple Dev
abu-b-sidq Dec 19, 2024
3c34f59
Testing Multiple Dev
abu-b-sidq Dec 19, 2024
6fc92fd
Testing Multiple Dev
abu-b-sidq Dec 19, 2024
ec07052
Testing Multiple Dev
abu-b-sidq Dec 19, 2024
c2a36cd
testing jenkins
abu-b-sidq Dec 19, 2024
ac39e7e
Testing Multiple Dev
abu-b-sidq Dec 19, 2024
7c5f5ea
Testing Multiple Dev
abu-b-sidq Dec 19, 2024
9bec624
Testing Multiple Dev
abu-b-sidq Dec 19, 2024
2c5c9b7
Testing Multiple Dev
abu-b-sidq Dec 19, 2024
78227f6
added custom properties in issue component
klsteja-shipsy Dec 27, 2024
46f36b1
Merge pull request #3 from shipsy/DR-ISS-262116_add_custom_attributes…
Dec 30, 2024
d1e4f3d
fixed array error
klsteja-shipsy Dec 30, 2024
43b1c01
Merge pull request #4 from shipsy/DR-ISS-262116_add_custom_attributes…
Dec 30, 2024
e7aab55
migration file
abu-b-sidq Dec 31, 2024
ff39814
Merge branch 'staging' of https://github.com/shipsy/plane into staging
abu-b-sidq Dec 31, 2024
cd03828
migration file
abu-b-sidq Dec 31, 2024
fb53aaf
web dev complete
Feb 24, 2025
7157b85
dev changes
abu-b-sidq Feb 25, 2025
1904787
Merge branch 'staging' of https://github.com/shipsy/plane into staging
abu-b-sidq Feb 25, 2025
1a362e2
fix
abu-b-sidq Feb 25, 2025
db341b2
dev issues
abu-b-sidq Feb 25, 2025
08a42fd
dev issues
abu-b-sidq Feb 25, 2025
5c50c21
dev issues
abu-b-sidq Feb 25, 2025
daa3d2e
dev issues
abu-b-sidq Feb 25, 2025
08bd96a
fixed
abu-b-sidq Feb 26, 2025
4ffe507
fix
abu-b-sidq Feb 26, 2025
2007e99
build fix
abu-b-sidq Feb 26, 2025
5ad130f
minor fixes
abu-b-sidq Feb 26, 2025
bed3c33
added custom properties in filters
abu-b-sidq Feb 26, 2025
a0882d1
added properties
abu-b-sidq Feb 26, 2025
7809f0e
celery and flower
abu-b-sidq Feb 27, 2025
475fdcb
Health check fix
Naman-SIngla-Shipsy Mar 3, 2025
217204b
env var fix
Naman-SIngla-Shipsy Mar 3, 2025
af3d837
dockerfile fix
Naman-SIngla-Shipsy Mar 4, 2025
4cb2d63
Merge branch 'staging' into ISS-265078/fix/health_check
abu-b-sidq Mar 4, 2025
c6db515
Merge pull request #10 from shipsy/ISS-265078/fix/health_check
abu-b-sidq Mar 4, 2025
316984e
changes till 12th march
abu-b-sidq Mar 12, 2025
91f9473
Merge branch 'staging' of https://github.com/shipsy/plane into staging
abu-b-sidq Mar 12, 2025
4428976
commented un used variables and imports
abu-b-sidq Mar 13, 2025
51c2e58
un commented
abu-b-sidq Mar 13, 2025
cd2a8e0
Allowing the project member permission for guests users
abu-b-sidq Mar 17, 2025
1fb0c8e
Fix for the user's second login issue
abu-b-sidq Mar 17, 2025
61a9692
fixed filter search issue
abu-b-sidq Mar 18, 2025
d18a141
Merge pull request #15 from shipsy/filter_search_error_fix
sumarpreet-kaur-shipsy Mar 18, 2025
a8528e2
Get issueTypeCustomProperties and make these fields editable on UI
rahulsahay-shipsy Mar 18, 2025
fb850e1
Update custom properties on being edited
rahulsahay-shipsy Mar 18, 2025
6613a98
Merge branch 'staging' of github.com:shipsy/plane into Editable-custo…
rahulsahay-shipsy Mar 18, 2025
78ec6d8
Add is required in custom properties
sumarpreet-kaur-shipsy Mar 19, 2025
be35966
Prevent leaving required custom properties blank
rahulsahay-shipsy Mar 19, 2025
9bcc3e9
Hardcoding issue_type_id for now, revert back later
rahulsahay-shipsy Mar 19, 2025
6ebc601
Fetch issueTypeCustomProperties
rahulsahay-shipsy Mar 19, 2025
6de5554
Append issue-type-custom-property id while creating merged properties
rahulsahay-shipsy Mar 19, 2025
565385f
Added ApiView for updating custom property values in issue_custom_pro…
rahulsahay-shipsy Mar 19, 2025
a9a66c9
Added api paths for update issueCustomProperties
rahulsahay-shipsy Mar 19, 2025
621121f
fixed profile creation failure
abu-b-sidq Mar 19, 2025
332e001
Merge branch 'demo' of https://github.com/shipsy/plane into staging
abu-b-sidq Mar 19, 2025
a7f4177
Add issueCustomProperty Serializer
rahulsahay-shipsy Mar 20, 2025
4474daa
Get issueCustomProperty id also
rahulsahay-shipsy Mar 20, 2025
4febf28
Add issueCustomPropertyView
rahulsahay-shipsy Mar 20, 2025
068bafe
Add issueCustomPropertyView
rahulsahay-shipsy Mar 20, 2025
a3f8109
Get issueCustomProperty id also
rahulsahay-shipsy Mar 20, 2025
67976a8
Make custom-properties editable, is_required validation, update custo…
rahulsahay-shipsy Mar 20, 2025
813b8de
Editable Custom Properties
rahulsahay-shipsy Mar 20, 2025
f266562
Fix for the redirecting to set password page issue
abu-b-sidq Mar 20, 2025
6d453c8
Merge pull request #18 from shipsy/PlaneLoginIssue
sumarpreet-kaur-shipsy Mar 20, 2025
3baa08c
display-property-std -- code
naman-agrawal-shipsy Mar 20, 2025
6ad4527
Merge branch 'staging' of https://github.com/shipsy/plane into displa…
naman-agrawal-shipsy Mar 20, 2025
9bf0eef
Added task for creating custom property update activity
rahulsahay-shipsy Mar 20, 2025
2b951d7
Create activity for custom property update
rahulsahay-shipsy Mar 20, 2025
6035905
Make custom proerties editable
rahulsahay-shipsy Mar 20, 2025
8b26d8f
Update custom properties when edited
rahulsahay-shipsy Mar 20, 2025
cf27a0f
style
abu-b-sidq Mar 20, 2025
caf9cf8
Fix for the redirecting to set password page issue
abu-b-sidq Mar 20, 2025
34ae62c
Merge branch 'dev' of github.com:shipsy/plane into Editable-custom-pr…
rahulsahay-shipsy Mar 20, 2025
b82176c
changes in custom prop column component
naman-agrawal-shipsy Mar 20, 2025
e4aa3d9
Create and Update Custom Properties Activity
abu-b-sidq Mar 20, 2025
ceda621
Track activity for update and create custom property
abu-b-sidq Mar 20, 2025
06a3cc4
Get issue_type_id from IssueDetail and Editable Custom Properties
abu-b-sidq Mar 21, 2025
71a21cd
Get issue_type_id from IssueDetails and EditableCustomProperties
abu-b-sidq Mar 21, 2025
964d66b
Get issue_type_id in IssueSerializer also
abu-b-sidq Mar 21, 2025
aab6dcf
Disable the dropdown of workspaces
vignesh-kandula-shipsy Mar 21, 2025
6b60c41
Merge branch 'dev' of https://github.com/shipsy/plane into display_pr…
naman-agrawal-shipsy Mar 21, 2025
cba2dd4
Merge branch 'staging' of https://github.com/shipsy/plane into displa…
naman-agrawal-shipsy Mar 21, 2025
6eeb38d
hub_code icon change
naman-agrawal-shipsy Mar 21, 2025
ddcd4fb
pull
abu-b-sidq Mar 21, 2025
2b96095
hide tooltip when no content
abu-b-sidq Mar 21, 2025
bb68517
small-fix
abu-b-sidq Mar 21, 2025
8c7bbe1
Create celery job for custom property update activity tracking
rahulsahay-shipsy Mar 21, 2025
5e05e0e
Merge pull request #22 from shipsy/display_properties--std-fields
sumarpreet-kaur-shipsy Mar 21, 2025
b41137f
UI Improvements in Edit Custom Properties
rahulsahay-shipsy Mar 21, 2025
7e18282
Merge branch 'dev' of github.com:shipsy/plane into Editable-custom-pr…
rahulsahay-shipsy Mar 21, 2025
c135652
UI Improvement for Editable Custom Properties
abu-b-sidq Mar 21, 2025
5c7061a
Changes to support multipart data in nginx config files
abu-b-sidq Mar 22, 2025
19dde9d
Merge pull request #23 from shipsy/add_config_uploads
sumarpreet-kaur-shipsy Mar 22, 2025
1c00fe0
Filter the issues with usernames from headers( X-Assume-Role)
vignesh-kandula-shipsy Mar 24, 2025
a027135
Merge pull request #25 from shipsy/DR-TKT-57029-SearchableIssuesByUse…
sumarpreet-kaur-shipsy Mar 24, 2025
f3da610
Merge pull request #20 from shipsy/Editable-custom-property-fields
sumarpreet-kaur-shipsy Mar 25, 2025
df2413e
Merge pull request #21 from shipsy/DR-ISS-265924-DisableWorkspaceDrop…
sumarpreet-kaur-shipsy Mar 25, 2025
b67a44e
Fix for filteting the issues by type_id
vignesh-kandula-shipsy Mar 25, 2025
3989427
Merge pull request #26 from shipsy/FixForFilteringIssuesByTypeId
sumarpreet-kaur-shipsy Mar 25, 2025
dbb28f0
added postmessage multiple user fix
abu-b-sidq Mar 25, 2025
1a6b2ab
added try catch
naman-agrawal-shipsy Mar 25, 2025
9e5d97d
Merge pull request #27 from shipsy/multiple-user-login-fix
naman-agrawal-shipsy Mar 25, 2025
884ab3d
Added four new fileds to issue model and added filteration
abu-b-sidq Mar 26, 2025
e646eed
Merge pull request #28 from shipsy/AddingNewFields
sumarpreet-kaur-shipsy Mar 26, 2025
f15b733
Fixed custom-properties alignment
rahulsahay-shipsy Mar 27, 2025
3f5355c
Custom-property widgth as props
rahulsahay-shipsy Mar 27, 2025
0438fdd
Fixed error message positioning
rahulsahay-shipsy Mar 27, 2025
d8df23f
added new fileds to display properties
vignesh-kandula-shipsy Mar 27, 2025
61cf44b
Merge pull request #30 from shipsy/DR-ISS-266189-AddednewtoDisplayPro…
sumarpreet-kaur-shipsy Mar 27, 2025
c60c1fe
Activity for updating/creating custom properties values
rahulsahay-shipsy Mar 27, 2025
28a57d4
Activity block component for update in custom properties values
rahulsahay-shipsy Mar 27, 2025
21e3499
Case for rendering custom property value update activities
rahulsahay-shipsy Mar 27, 2025
3cf7a5d
Sequence chnage
vignesh-kandula-shipsy Mar 27, 2025
9b520fd
Added 4 additional properties (names) in fixed issue properties
rahulsahay-shipsy Mar 28, 2025
7a16bbd
Merge pull request #34 from shipsy/Editable-custom-property-fields
sumarpreet-kaur-shipsy Mar 28, 2025
a2e24c4
Merge pull request #35 from shipsy/DR-ISS-266189-AddednewtoDisplayPro…
sumarpreet-kaur-shipsy Mar 28, 2025
0e43b87
Merge pull request #36 from shipsy/View-added-fixed-properties(names)…
sumarpreet-kaur-shipsy Mar 28, 2025
40a01e9
added property type prop
abu-b-sidq Apr 1, 2025
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
4 changes: 3 additions & 1 deletion admin/Dockerfile.admin
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,6 @@ ENV NEXT_PUBLIC_WEB_BASE_URL=$NEXT_PUBLIC_WEB_BASE_URL
ENV NEXT_TELEMETRY_DISABLED 1
ENV TURBO_TELEMETRY_DISABLED 1

EXPOSE 3000
EXPOSE 3000

CMD node admin/server.js admin
9 changes: 5 additions & 4 deletions admin/ce/components/common/upgrade-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import { getButtonStyling } from "@plane/ui";
import { cn } from "@/helpers/common.helper";

export const UpgradeButton: React.FC = () => (
<a href="https://plane.so/one" target="_blank" className={cn(getButtonStyling("primary", "sm"))}>
Available on One
<SquareArrowOutUpRight className="h-3.5 w-3.5 p-0.5" />
</a>
<a></a>
// <a href="https://plane.so/one" target="_blank" className={cn(getButtonStyling("primary", "sm"))}>
// Available on One
// <SquareArrowOutUpRight className="h-3.5 w-3.5 p-0.5" />
// </a>
);
11 changes: 0 additions & 11 deletions admin/core/components/admin-sidebar/help-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,6 @@ export const HelpSection: FC = observer(() => {
{!isSidebarCollapsed && "Redirect to plane"}
</a>
</Tooltip>
<Tooltip tooltipContent="Help" position={isSidebarCollapsed ? "right" : "top"} className="ml-4">
<button
type="button"
className={`ml-auto grid place-items-center rounded-md p-1.5 text-custom-text-200 outline-none hover:bg-custom-background-90 hover:text-custom-text-100 ${
isSidebarCollapsed ? "w-full" : ""
}`}
onClick={() => setIsNeedHelpOpen((prev) => !prev)}
>
<HelpCircle className="h-3.5 w-3.5" />
</button>
</Tooltip>
<Tooltip tooltipContent="Toggle sidebar" position={isSidebarCollapsed ? "right" : "top"} className="ml-4">
<button
type="button"
Expand Down
3 changes: 3 additions & 0 deletions aio/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ events {

http {
sendfile on;
chunked_transfer_encoding on;
client_body_buffer_size 10M;
client_max_body_size 50M;

server {
listen 80;
Expand Down
39 changes: 32 additions & 7 deletions apiserver/Dockerfile.api
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ RUN apk add --no-cache --virtual .build-deps \
"postgresql-dev" \
"libc-dev" \
"linux-headers" \
&& \
pip install -r requirements.txt --compile --no-cache-dir \
&& \
apk del .build-deps
&& pip install -r requirements.txt --compile --no-cache-dir \
&& apk del .build-deps

# Install Flower for Celery Monitoring
RUN pip install flower

# Add in Django deps and generate Django's static files
ENV FLOWER_UNAUTHENTICATED_API=true

# Copy application files
COPY manage.py manage.py
COPY plane plane/
COPY templates templates/
Expand All @@ -46,7 +48,30 @@ RUN mkdir -p /code/plane/logs
RUN chmod +x ./bin/*
RUN chmod -R 777 /code

# Expose container port and run entry point script
EXPOSE 8000
# Expose ports for API and Flower UI
EXPOSE 8000 5555

# Declare a build argument
ARG ENV_FILE_PATH

# Use the build argument
COPY ${ENV_FILE_PATH} /code/plane/file.env

# Export the environment file path as an image environment variable
ENV ENV_FILE_PATH=${ENV_FILE_PATH}

RUN if [ "${ENV_TYPE}" = "apiserver" ]; then \
python manage.py migrate --noinput; \
fi

CMD if [ "${ENV_TYPE}" = "apiserver" ]; then \
gunicorn -w 2 -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:8000 --max-requests 1200 --max-requests-jitter 1000 --access-logfile -; \
elif [ "${ENV_TYPE}" = "celery" ]; then \
celery -A plane flower --port=5555 --address=0.0.0.0 --url_prefix=flower & \
celery -A plane worker -l info; \
elif [ "${ENV_TYPE}" = "celery-beat" ]; then \
(celery -A plane flower --port=5555 --address=0.0.0.0 --url-prefix=flower &) && celery -A plane beat -l info; \
else \
echo "Unknown ENV_TYPE: ${ENV_TYPE}"; \
exit 1; \
fi
24 changes: 21 additions & 3 deletions apiserver/plane/api/middleware/api_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

# Module imports
from plane.db.models import APIToken

from django.conf import settings
from django.contrib.auth import get_user_model

class APIKeyAuthentication(authentication.BaseAuthentication):
"""
Expand All @@ -18,11 +19,21 @@ class APIKeyAuthentication(authentication.BaseAuthentication):
www_authenticate_realm = "api"
media_type = "application/json"
auth_header_name = "X-Api-Key"
assume_header_role = "X-Assume-Role"

def get_api_token(self, request):
return request.headers.get(self.auth_header_name)

def validate_api_token(self, token):
def validate_api_token(self, token, assume_role_value=None):
# Check if the token matches the static token from settings
User = get_user_model()
if token == settings.STATIC_API_TOKEN:
if assume_role_value:
user = User.objects.filter(username=assume_role_value).first()
else:
user = User.objects.filter(is_superuser=True).first()
self.rewite_project_id_in_url()
return (user, token)
Comment on lines +29 to +36
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add error handling for missing user.

When validating a static API token with an assumed role, there's no check to ensure the requested user actually exists. If a non-existent username is provided, the code will return None for the user, which could lead to unexpected behavior.

         if token == settings.STATIC_API_TOKEN:
             if assume_role_value:
                 user = User.objects.filter(username=assume_role_value).first()
+                if user is None:
+                    raise AuthenticationFailed(f"User with username '{assume_role_value}' does not exist")
             else:
                 user = User.objects.filter(is_superuser=True).first()
+                if user is None:
+                    raise AuthenticationFailed("No superuser found in the system")
-            self.rewite_project_id_in_url()
+            self.rewrite_project_id_in_url()
             return (user, token)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
User = get_user_model()
if token == settings.STATIC_API_TOKEN:
if assume_role_value:
user = User.objects.filter(username=assume_role_value).first()
else:
user = User.objects.filter(is_superuser=True).first()
self.rewite_project_id_in_url()
return (user, token)
User = get_user_model()
if token == settings.STATIC_API_TOKEN:
if assume_role_value:
user = User.objects.filter(username=assume_role_value).first()
if user is None:
raise AuthenticationFailed(f"User with username '{assume_role_value}' does not exist")
else:
user = User.objects.filter(is_superuser=True).first()
if user is None:
raise AuthenticationFailed("No superuser found in the system")
self.rewrite_project_id_in_url()
return (user, token)

try:
api_token = APIToken.objects.get(
Q(
Expand All @@ -40,11 +51,18 @@ def validate_api_token(self, token):
api_token.save(update_fields=["last_used"])
return (api_token.user, api_token.token)

def rewite_project_id_in_url(self):
pass
# import pdb;pdb.set_trace()

def authenticate(self, request):
token = self.get_api_token(request=request)
if not token:
return None

# Validate the API token
user, token = self.validate_api_token(token)
assume_role_value = request.headers.get(self.assume_header_role, None)
print("assume_role",assume_role_value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove debug print statement.

There's a debug print statement that should be removed before deploying to production. Leaving print statements in authentication code can leak sensitive information to logs.

-        print("assume_role",assume_role_value)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
print("assume_role",assume_role_value)


user, token = self.validate_api_token(token, assume_role_value)
return user, token
2 changes: 2 additions & 0 deletions apiserver/plane/api/serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
IssueActivitySerializer,
IssueExpandSerializer,
IssueLiteSerializer,
IssueCustomPropertySerializer
)
from .issue_type import IssueTypeSerializer, IssueTypeCustomPropertySerializer
from .state import StateLiteSerializer, StateSerializer
from .cycle import CycleSerializer, CycleIssueSerializer, CycleLiteSerializer
from .module import (
Expand Down
Empty file.
Loading