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

Temporary Authentication login #1410

Merged
merged 10 commits into from
Apr 15, 2024
Merged

Temporary Authentication login #1410

merged 10 commits into from
Apr 15, 2024

Conversation

Sujanadh
Copy link
Contributor

@Sujanadh Sujanadh commented Apr 2, 2024

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Related Issue

Describe this PR

This PR implements JWT authentication with a validity of 7 days. It includes a new endpoint, /temp/login/ which creates a token and sets a cookie, and a wrapper function to verify the token and return static user info, which is svcfmtm.

Alternative Approaches Considered

Did you attempt any other approaches that are not documented in code?

Review Guide

Notes for the reviewer. How to test this change?

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@Sujanadh Sujanadh requested a review from spwoodcock April 2, 2024 06:34
@Sujanadh Sujanadh self-assigned this Apr 2, 2024
@github-actions github-actions bot added the backend Related to backend code label Apr 2, 2024
@Sujanadh
Copy link
Contributor Author

Sujanadh commented Apr 2, 2024

  • I have used PyJWT package
  • AUTH_SECRET_KEY with 64 bytes is randomly generated and is used in .env file
  • Still need to update the dependency to update-task-status endpoint and related project summary endpoints
  • PyJWT package and pdm lock file are not pushed yet
  • open to suggestions and improvements

@Sujanadh Sujanadh marked this pull request as draft April 2, 2024 07:18
@spwoodcock
Copy link
Member

This is pretty neat 😁

But there is no need for us to generate our own tokens, as this can be handled by OpenStreetMap.

I will send you the OSM auth token for svcfmtm and we can simply verify that using login_required.

The token can be set inside a cookie in the same way we do currently too

@Sujanadh
Copy link
Contributor Author

Sujanadh commented Apr 2, 2024

ohh ok i thought we are not using osm auth. I totally forgot svcfmtm is already an osm user ,not just made up user.

@Sujanadh
Copy link
Contributor Author

Sujanadh commented Apr 3, 2024

i have updated the temp login to use osm auth tokens.
what are the other endpoints that we are giving temporary access?

@spwoodcock
Copy link
Member

For sure we need to update the task status (lock/unlock) - that's the main one πŸ‘

@Sujanadh
Copy link
Contributor Author

Sujanadh commented Apr 8, 2024

I have added login_required in update_task_status , is there anything to add?

@Sujanadh Sujanadh marked this pull request as ready for review April 9, 2024 07:35
@@ -116,6 +116,9 @@ def assemble_db_connection(cls, v: Optional[str], info: ValidationInfo) -> Any:
OSM_URL: HttpUrlStr = "https://www.openstreetmap.org"
OSM_SCOPE: str = "read_prefs"
OSM_LOGIN_REDIRECT_URI: str = "http://127.0.0.1:7051/osmauth/"
OSM_SVC_TOKEN: str = """ZXlKcFpDSTZNakF6T0RZeU1Ua3NJblZ6WlhKdVlXMWx
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be hardcoded, but configurable.

In the Pydantic, specifying Optional[str] makes the field nullable. Specifying Optional[str] = None makes the field optional (what we want).

The value is then injected via the .env file.
Don't worry about updating the example dotenv etc, I can do that after.

Comment on lines 52 to 56
response.set_cookie(
key=cookie_name,
value=access_token,
max_age=604800,
expires=604800, # expiry set to 7 days,
Copy link
Member

Choose a reason for hiding this comment

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

Very nice - we just need the frontend implementation now πŸ‘

@@ -30,7 +30,7 @@
from osm_fieldwork.xlsforms import xlsforms_path

from app.__version__ import __version__
from app.auth import auth_routes
from app.auth import auth_routes, temp_auth
Copy link
Member

Choose a reason for hiding this comment

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

We probably don't need a new router for the single endpoint - should it go under the auth router?


@router.get("/login/")
async def temp_login(
request: Request,
Copy link
Member

Choose a reason for hiding this comment

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

One last thing: I think we should take an extra param email here.

Thus implementation will work for now.

When we have an email service included, maybe we ads the extra step to require verification by clicking a button in the users email inbox.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just an extra param for now?

@spwoodcock
Copy link
Member

I have added login_required in update_task_status , is there anything to add?

There is also the GET project endpoint that we should probably put behind login again.

@Sujanadh
Copy link
Contributor Author

Sujanadh commented Apr 9, 2024

I have added login_required in update_task_status , is there anything to add?

There is also the GET project endpoint that we should probably put behind login again.

There is no dependency check in GET endpoints of project view; even non-logged-in users are allowed to view projects, right?
Are we now adding login_required to them?

@spwoodcock
Copy link
Member

spwoodcock commented Apr 9, 2024

I have added login_required in update_task_status , is there anything to add?

There is also the GET project endpoint that we should probably put behind login again.

There is no dependency check in GET endpoints of project view; even non-logged-in users are allowed to view projects, right? Are we now adding login_required to them?

In the past we had projects behind a ProtectedRoute in the frontend, requiring login.
I removed it temporarily for field testing, but we probably need it back in, to cover the case of private projects (we can't have users able to access everything by default).

We can add the ProtectedRoute back into the frontend, meaning we probably also want login_required on

@router.get("/{project_id}", response_model=project_schemas.ReadProject)

The project_dashboard endpoint is also called on the project detail page.

"/project_dashboard/{project_id}", response_model=project_schemas.ProjectDashboard

This should have login_required too, but also should not be called when the user goes to the project details, only when they go to the dashboard (requires frontend change)

@Sujanadh
Copy link
Contributor Author

Sujanadh commented Apr 9, 2024

makes sense πŸ‘

@Sujanadh
Copy link
Contributor Author

Sujanadh commented Apr 9, 2024

One question. Since private and public access are checked in mapper role but not in login_required, and for the temporary login also we use svcfmtm which is mapper by default. Again, in the future new login from any source will be assigned role mapper so better to use mapper dependency instead of login_required what do you think?

@spwoodcock
Copy link
Member

spwoodcock commented Apr 9, 2024

You are completely right!

We need to give this more thought!

We need temp users to be able to access projects, so they have to be assigned MAPPER role.
As they all use the svcfmtm user, this works fine for public projects.
We just need to make sure the user svcfmtm exists and has MAPPER role.

I actually think that by default svcfmtm is ADMIN... we need to separate those roles and use two different usernames. That's another issue πŸ˜…

For private projects, we probably need a mechanism for project admins to generate an invite link. This could create a specific user tied to a project with MAPPER permission, so a user must have an invite like to access it.

Open to ideas!

@Sujanadh
Copy link
Contributor Author

Sujanadh commented Apr 9, 2024

Can't we change the role of svcfmtm to mapper?
Yes, I agree with the idea of sending invites to users via email for the private project since we don't have ui to assign users to the project.

@spwoodcock
Copy link
Member

spwoodcock commented Apr 10, 2024

After discussion, we decided to:

  • Remove ADMIN permission from default svcfmtm user account.
  • Create a second user localadmin that is manager for the FMTM Public Beta org.
    • This user is not an OSM user and is only local in the database.
    • It cannot be logged into.
  • Use svcfmtm for the temp auth in this PR.

Doing this also remove a potential future security flaw: if another organisation deploys FMTM and we kept the svcfmtm user as an admin user, we could potentially log in as admin on their FMTM instance!

@spwoodcock spwoodcock marked this pull request as draft April 12, 2024 18:26
@github-actions github-actions bot added the frontend Related to frontend code label Apr 15, 2024
@Sujanadh
Copy link
Contributor Author

{
  "detail": "Auth failed. No user id present"
}

I got this error while using localadmin, which has an id '0'. Since the id in the user's table is the primary key, does it accept a '0' value?

@Sujanadh Sujanadh marked this pull request as ready for review April 15, 2024 08:02
@spwoodcock
Copy link
Member

spwoodcock commented Apr 15, 2024

How are you using localadmin?

Login shouldn't work, except for during local development where login is skipped and localadmin is returned.

Can you check your db if the user exists? The user should have been created at server startup with id 0 (the field should accept 0 no problem)

@Sujanadh
Copy link
Contributor Author

yes i checked db, it has record of localadmin. but while getting uid during check access in roles.py it doesn't extract id from the user_data though the data have id : 0. instead it returned above error.

@spwoodcock
Copy link
Member

spwoodcock commented Apr 15, 2024

Nice, if changing to id 1 fixed the error, then all good!

@github-actions github-actions bot removed the frontend Related to frontend code label Apr 15, 2024
@spwoodcock spwoodcock self-requested a review April 15, 2024 12:12
@spwoodcock spwoodcock merged commit 89fa574 into development Apr 15, 2024
5 checks passed
@spwoodcock spwoodcock deleted the feat/temp-auth branch April 15, 2024 12:13
Sujanadh added a commit that referenced this pull request May 17, 2024
* fix (frontend): remove usage of encode and decode of id's (#1387)

* fix: project edit form update validation (#1397)

* feat formUpdateTab: form validation api add

* fix projectDetails: toggle debug console btn replaced with checkbox

* fix project: consoles remove

* fix (frontend): required fields, description word limit, odk cred input (#1404)

* feat select: required mark add

* feat projectDetailsForm: organization name select field required

* fix projectDetailsForm: display odk fields if no odk-credentials

* feat textArea: character length limit & current character length display in textArea

* feat projectDescription: short description character length limit set to 200 characters

* fix: update task activity endpoint (#1406)

Co-authored-by: sujanadh <[email protected]>

* fix: more informative browser tab titles/details (#1411)

* feat useDocumentTitle - hook to dynamically set document title

* feat documentTitle: document title add across all pages

* feat projectDetails: dynamic project name display on document title

* fix: default UNDERPASS_API_URL no trailing slash

* build: revert v2024.3.0 --> v2024.1.0

* bump: version 2024.1.0 β†’ 2024.2.0

* fix: return proper error message if form edit is invalid (#1415)

Co-authored-by: sujanadh <[email protected]>

* refactor: response of update task status and added user info in task history (#1419)

Co-authored-by: sujanadh <[email protected]>

* Return task history instead of db task  (#1421)

* refactor: response of update task status and added user info in task history

* fix: return task history instead of db task

---------

Co-authored-by: sujanadh <[email protected]>

* fix: project name editing validation (#1416)

* fix: edit project name

* feat: calculate prefix name in partial update schema

---------

Co-authored-by: sujanadh <[email protected]>

* docs: extra info on production data backup / restore

* docs: add section for example xlsforms

* docs: fix links for example xlsforms

* docs: update info about example xlsforms

* docs: link to correct form for each example xlsform/survey

* docs: link for additional info about monrovia xlsform

* refactor: task comment response and schema (#1423)

Co-authored-by: sujanadh <[email protected]>

* feat: implement ODK Entities for project creation (#1383)

* feat: add route to convert geojson --> odk csv format

* build: add public.xforms table for future multiple form per project

* build: update osm-fieldwork --> 0.6.1 for entities support

* feat: refactor project creation to use entities

* refactor: features and submission counts per task

* refactor: support all geometry type for javarosa geom and add state in nominatim

* refactor: added project_id as a foreign key to xforms table

* build: relock dependencies after merge

* feat: add helper route to convery odk submission json --> geojson

* fix: rename DbXForm.form_id --> odk_form_id

* feat: add javarosa_to_geojson_geom conversion func

* build: rename form_id --> odk_form_id in db

* feat: load odk collect with entity prefilled by intent link

* refactor: run pre-commit hooks formatting

* build: add migration to set odk_token on project, not per task

* fix: frontend

build qrcode based on project, not task

* refactor: remove generating project log (as performance improvements)

* feat: helper route to convert javarosa geom --> geojson

* build: update osm-fieldwork --> 0.7.0

* fix: working entity generation during project creation

* test: fix test for project creation flow

* fix: foreign key refernce for DbXForm to project_id

---------

Co-authored-by: sujanadh <[email protected]>

* build: make xform migration fully idempotent

* refactor: merged multi polygon to single polygon (#1426)

Co-authored-by: sujanadh <[email protected]>

* build: add helm chart for deployment in Kubernetes (#1427)

* fix: add favicon.ico to public frontend dir

* fix: make ENCRYPTION_KEY variable mandatory for settings

* docs: update project description

* build: add basic helm chart for deployment

* fix: add odk_token from projectInfo to qrcode creation

* build: fix add runAsUser to helm securityContext for codecov to pass

* ci: update all workflows --> 1.4.10 (fix checkcov false positives)

* fix(backend): allow missing odk_token for project, but log warning

* feat: Playwright integration with test cases to be written (#1433)

* feat: Playwright integration

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* docs: update info in helm chart readme, creating vars + namespace

* build: update osm-login-python --> 1.0.3 for error handling + flexible deps

* fix: project details mobile UI, user details in header (#1407)

* fix projectDetails: task popup padding fix, legend accordion padding fix

* fix projectDetails: mobile UI shift issue fix

* fix projectDetails: tiles set to bottom in large screen

* fix projectDetails: mobile UI bottom sheet margin bottom reduce

* fix primaryAppBar: logo width adjustment for mobile screen

* fix mappingHeader: remove css helper outline toggle

* fix primaryAppBar: user profile display on app bar for mobile screen

* fix projectDetails: increase bottom sheet margin bottom for mobile ui

* fix projectDetails: UI fix for map rotate icon

* feat assetModules: icon add

* feat qrCodeComponent: download qr btn add to mobile UI popup

* fix taskSectionPopup: modal shadow visible on modal close issue solve

* feat projectDetails: download button add to mapControlComponent & layerSwitcher placed down

* feat mobileProjectInfoContent: manage-project btn add

* feat projectDetails: download toggle btn UI fix

* fix taskSectionPopup: component placement above mobile footer

* fix projectOptions: remove buttons

* feat assetModules: barChart icon add

* feat mobileFooter: infographic footer item add, comment footer item shown conditionally, zIndex fix

* fix bottomSheet: zIndex fix

* fix mobileFooter: params id fix

* fix mobileProjectInfoContent: dynamic projectId for redirection to manage-project

* fix comments: comments keys & type fix according to backend response

* fix toolbar: dropdown zIndex issue fix

* fix primaryAppBar: sign-in btn show on small devices

* fix: add optional auth to raw-data-api calls, plus folder structure for persistence (#1431)

* build: update osm-rawdata for better error handling --> 0.2.4

* feat: enable raw-data-api osm auth for folder structure retain

* fix: only use folder structure for raw-data-api if auth

* fix: correctly return OSM_SVC_ACCOUNT_TOKEN in config, if set

* build: relock backend dependencies after rebase

* fix: data extract upload url with slash for s3

* fix: update logic for more flexible submission json --> geojson

* build: relock frontend dependencies to fix build

* build: add instructions for using Playwright frontend E2E tests (#1439)

* docs: add instructions for running playwright tests

* build: relock frontend deps after playwright install

* ci: add playwright test config to ci pr tests

* ci: remove demo playwright ci config

* refactor: move demo playwright file to different dir

* ci: update all workflows --> [email protected] (for playwright integration)

* test: add exclusions for vitest directories (skip e2e tests)

* fix: filter task_history endpoint using task_id (#1436)

* refactor: use task_id to get task_history

* refactor: added project_id param in path

---------

Co-authored-by: sujanadh <[email protected]>

* build: add Mozilla Dockerflow spec endpoints for devops systems (#1444)

* fix: XLSForm template download endpoint for specified categories (#1441)

* feat: add /projects/features endpoint for project FeatureCollection (disaster.ninja integration) (#1442)

* refactor: move tasks/features endpoint --> projects/{id}/task-completion

* fix(backend): coerce invalid osm_id integers by removing non-numeric chars

* refactor(frontend): rename project_details page --> project

* feat: add /projects/features/ endpoint to get FeatureCollection

* fix(backend): /projects/features handle empty featcol, hide private projects

* fix(backend): hide projects from home page where visibility!=PUBLIC

* fix: handle multipolygon geometries for project area (#1430)

* fix: choose area as task for multipolygon geojson

* fix_pytest: used featurecollection from geojson to change multi to single polygon

* refactor: created two separate convert and merge multipolygon func and refactor endpoints

* fix_pytest: reformatted outline input

* refactor: repeated code while parsing geojson and fix pytest

---------

Co-authored-by: sujanadh <[email protected]>

* feat: temporary authentication login for mappers (svcfmtm) (#1410)

* feat: temporary authentication login

* refactor: use osm auth instead of separate jwt

* feat: added svcfmtm token in config setting

* fix: changed access to update tasks status from mapper to login_required

* refactor: removed hard_coded str, added email as an extra param

* feat: replace svcfmtm user with localadmin, use svcfmtm as passwordless user

* refactor: replace svcfmtm usage with localadmin for tests + debug

* feat: added mapper to endpoints,changed osm svc account token variable

* fix: changed localadmin id from 0 to 1

* refactor: reorder task_routes imports via ruff pre-commit

---------

Co-authored-by: sujanadh <[email protected]>
Co-authored-by: spwoodcock <[email protected]>

* refactor: replace unecessary outline_centroid for tasks with ol.extent.getCenter (#1447)

* fix: activity comment api calls in frontend (#1435)

* feat project: api add to fetch taskActivity

* feat activitiesPanel: getProjectTaskActivity api integration, state update for activityList display

* feat projectType: update project types, add taskActivity and taskBoundries types

* fix comments: comment list fetch from task_history api

* fix projectCommentsList: ts type update

* fix activitiesPanel: decode params id remove

* fix projectDetails: show projecInfo and comments only if task selected

* fix activitiesPanel: get taskHistory of selected tasks only

* feat projectSlice: updateProjectTaskActivity action add to update projectTaskActivity

* fix projectTaskStatus: replace previous taskActivity update approach by updateProjectTaskActivity action call

* fix dialogTaskActions: retrieve taskActivity from projectTaskActivity & update logic to update taskActivity btn according to status

* fix activitiesPanel: remove unsued variables, getTaskActivity api replace, update setHistories logic, update zoomToTask logic

* fix comments: getProjectComments api replace

* fix: fix list-forms endpoint logic to return list of dicts

* feat: endpoints for getting Entity data & updating Entity mapping status (#1445)

* feat: add endpoint for easy entities upload from csv file

* build: update osm-fieldwork --> 0.8.0 for latest entities code

* feat: add logic to get project entities, get and update entity mapping status

* feat: add project/entities and project/entity-mapping-status endpoints

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor: move entities pydantic models to central_schemas

* build: update osm-fieldwork --> 0.8.1 for getEntity method

* fix: fix list-forms endpoint logic to return list of dicts

* fix: add default status=0 (READY) during entity creation

* feat: endpoints for getting and updating entity status

* refactor: rename new_status endpoint --> new-status

* refactor: pass through DbProject to generate_project_files instead of id

* refactor: update task history sql to use params over f-string

* build: remove unused index.html in frontend src dir

* fix(frontend): correctly load favicon.ico using root url '/favicon.ico'

* refactor: change api url tasks/task_history --> tasks/task-history

* fix(frontend): loading of data extract correctly when task area clicked

* fix(backend): logic for updating task state after locked by user id

* refactor: rename TaskSectionPopup --> TaskSelectionPopup

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* docs: add roadmap badge to main readme

* docs: fix roadmap badge emoji for readme

* docs: update link to roadmap in readme

* fix (backend): add custom TMS url during project creation (#1446)

* feat:added tms_url in project model

* feat: added custom tms url in the project detail response

---------

Co-authored-by: sujanadh <[email protected]>

* fix: role mapper to login required in data extract (#1450)

Co-authored-by: sujanadh <[email protected]>

* docs: update svg label for roadmap badge, task board --> roadmap

* build: enforce --encoding utf8 on pg_dump database backups

* docs: add link to roadmap in docs sidebar

* docs: update link to roadmap to roadmap.fmtm.dev

* docs: add user/dev roadmaps, timeline, update readme badges

* ci: add action to move assigned tasks to board In Progress column

* ci: remove workflow to for assignment due to insufficient token permissions

* docs: add public beta to timeline

* fix (frontend): working task history button status updates (#1457)

* fix(ActivitiesPanel): taskHistory api fetch remove

* fix(DialogTaskActions): taskHistory api fetch add

* fix(ProjectTaskStatus): updateTaskStatus respnonse message status retrieval update

* feat: append extra hashtag to projects with domain and project id identifier (#1454)

* fix: fix hashtags not appending if no tags provided

* fix: add extra hashtag {domain}-{project_id} for easy identify

* fix(frontend): invalidate login if mismatch between existing and new user login (#1462)

* fix: basemap tile download, refactor to use /{project_id}/name (#1467)

* feat: distinguish between tasks locked by the current user and tasks locked by others (#1469)

* feat(mapStyles): add secondaryColor of red if task is locked by user itself

* feat(projectDetails): popup add if task locked by user itselft, arg add to getTaskStatusStyle

* fix(mapStyles): zIndex of locked task increase

* fix(mapStyles): strokeColor change to black

* feat(asyncPopup): dynamic popupId & className add

* fix(projectDetails): popupId & className add to asyncPopup props

* fix(ProjectTaskStatus): assign & clear userId to locked_by_user based on taskStatus

* feat: frontend buttons to load Entities in ODK Collect by intent (#1449)

* feat: add endpoint for easy entities upload from csv file

* feat: add logic to get project entities, get and update entity mapping status

* feat: add project/entities and project/entity-mapping-status endpoints

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: endpoints for getting and updating entity status

* feat: add endpoint for minimal entity_uuid:osm_id mapping

* fix(backend): handle cases when select_one_from_file is either geojson or csv

* feat(frontend): add popup for task feature (entity) selection with link to odk by intent

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix(backend): handle edge case when task area contains no geometries (fmtm-splitter #28)

* build: update osm-fiedwork --> v0.8.2

* refactor: wrap usage of OdkEntity in helper func with error handling

* refactor: directly pass project_info to model during proj create

* refactor: simplify project creation, divide into separate odk function

* refactor: rename state osm:entity mapping var for clarity

* refactor: change label on odk intent button --> map feature in odk

* fix(backend): functions to update existing xform after entity update

* refactor(frontend): allow default odk creds label to be clicked to toggle

* fix(backend): do not pretty print final odk xml (minify)

* build: upgrade osm-fieldwork --> 0.9.0 for entities workflow

* refactor: update references to osm_fieldwork entity registration form

* fix: update xform manipulation to factor in entities fields

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* feat (frontend): add custom tms url linked to a project (#1464)

* feat(projectDetialsForm): add customTmsUrl field

* feat(createProjectValidation): custom_tms_url validation add to verify if url present on tsm_checkbox check & verify valid url

* feat(createProject): custom_tms_url & hasCustomTMS types and state add to projectDetails

* feat(splitTasks): append custom_tms_url during project creation as a parameter

* feat(project): set custom_tms_url to projectInfo state on response

* feat(generateBasemap): set selectedTileSource to tms and set tmsURL if custom tms url associated with the project

* feat(layerSwitcher): tms layer add to layerGroup if tmsUrl associated with the project

* fix(frontend): do not call introspect endpoint on /osmauth callback

* feat(frontend): login options to frontend, OSM or temp auth (#1458)

* fix(signIn): on signIn click dispatch action to open modal

* feat(loginPopup): loginPopup add to show tempLogin & osmLogin option

* fix(login): action to handle login modal toggle

* feat(login): temporaryLoginService add for temporary login

* feat(osmLogo): osm logo add

* feat(LoginPopup): image & description add to loginOptions

* fix(modal): dialog content text set to left

* fix(osm-logo): high resolutions osm-logo replaced with low resolution

* fix: login methods after temp cookie auth (#1471)

* fix(backend): remove access token from login json response (cookie only)

* fix(frontend): do not handle access_token, use async/await syntax

* refactor(frontend): simplify loginpopup, save one click

* feat(backend): add helper endpoint to view current access token

* Replace popup auth flow with redirect flow (#1473)

* refactor: simplify login store using only authDetails variable

* feat(frontend): replace popup auth with redirect auth

* build: remove local compose config var VITE_FMTM_DOMAIN

* refactor(frontend): add route login protection for additional pages

* feat: use task index as an user facing task_id (#1470)

* feat: implemented task index as task id, populate xform table

* fix: handle if empty feature

* fix: merge conflict

* fix(backend): set project_task_index to start from 1

* refactor: remove unused edit project boundary endpoint

* refactor: task history endpoint only take unique task_id

* refactor: use correct task id for comments api

* fix(frontend): replace user facing task_id --> task_index

* fix(backend): add task index to task-completion endpoint

* fix(frontend): replace submission user facing task_id --> task_index

* fix: upload entity to odk central

* refactor: task completion order by id

---------

Co-authored-by: sujanadh <[email protected]>
Co-authored-by: spwoodcock <[email protected]>

* fix: task hover popup & disable splitting algo without linestring (#1481)

* fix(projectDetailsV2): return message if the locked_by_user is the signed in user else null

* fix(AsyncPopup): show popup if any element is returned

* fix(radioButton): disabled prop add

* feat(checkGeomTypeInGeojson): function to check specified geomType in geojson

* feat(createProject): hasGeojsonLineString add to state and type add

* feat(dataExtract): display warning message if line string not present in custom data extract

* feat(splitTasks): disable taskSplittingAlgorithm option if no lineString in custom data extract

* docs: update timeline with additional dates

* docs: simplify readme, move details to docs

* docs: reorder readme headings

* docs: correctly format bullet points in readme

* docs: add code block style for install script in readme

* fix(backend): get contributors count in project summary (#1484)

* fix: actual number of contributors in project summary

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* fix(backend): use task ids to count validated and mapped status (#1485)

* fix: use task ids to count validated and mapped status

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* docs: add manjitapandey as a contributor for doc (#1486)

* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* docs: add susmina94 as a contributor for doc, ideas, and bug (#1487)

* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* docs: add manjitapandey as a contributor for ideas (#1489)

* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* docs: add Sujanadh as a contributor for maintenance (#1490)

* docs: update README.md

* docs: update .all-contributorsrc

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* docs: add NSUWAL123 as a contributor for maintenance (#1492)

* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* build: upgrade osm-fieldwork --> v0.9.1 for latest forms

* build: disable vite watch.usePolling due to high cpu usage

* feat: prompt user if task area is not fully mapped on mark complete  (#1493)

* fix(Modal): zIndex fix

* feat(projectDetailsV2): fetch /task-completion api on project page

* feat(dialogTaskActions): task mapped confirmation prompt if features not fully mapped

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* build: update osm-fieldwork --> 0.9.2 for entities sheet fix

* feat: add OpenTelemetry configuration for backend API (monitoring) (#1496)

* feat: otel work in progress

* build: relock dependencies after otel rebase

* feat: add optional monitoring config (openobserve or sentry)

* docs: add SENTRY_DSN optional env var to example .env

* build: add sentry[opentelemetry] dependencies to monitoring group

* build: relock backend dependencies after rebase to development

* fix(backend): invalid use of WKBElement in pydantic model

* ci: upgrade all workflows --> 1.5.1 for WITH_MONITORING var img build

* docs: info on WITH_MONITORING api img build arg

* feat: working sentry opentelemetry optional instrumentation

* docs: add info for using the monitoring setup (sentry)

* docs: remove demo/testing broken routes for monitoring

* fix: linting error for not equal evaluation

* docs: set default .env.example MONITORING empty var

* fix(backend): allow passing MONITORING="" for empty config var

* feat (frontend: colour features based on entity mapping status (#1500)

* feat(getTaskStatusSyle): getFeatureStatusStyle function add to colorize each building according to feature map status

* feat(projectDetailsV2): getFeatureStatusStyle function call to set style of each feature

* refactor(projectDetailsV2): remove unused variables

* Reduce endpoint calls for project details and submission page (#1501)

* fix(backend): add logo to s3 for fmtm beta organisation init

* fix(backend): add organisation_logo field to returned project info

* fix(frontend): replace project_dashboard call on project details page

* refactor: remove task-completion endpoint

* fix(backend): add task_id to entity statuses by default

* fix(backend): simplify central schemas for entities

* fix(backend): fix submission_form_fields endpoint (use xform uuid)

* refactor(frontend): simplify getting project submission data from entities

* fix(frontend): replace missed task_priority_str --> task_status

* fix(dialogTaskActions): same name variable conflict solve (#1506)

* Refactor submission endpoints backend/frontend (#1507)

* refactor: submission table, submission details, review state and filtering

* frontend_fix: updated end point and task id param

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: pre-commit fail

* refactor: removed unnecessary brackets

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* fix: refactored project dashboard and submission graph (#1509)

* Fix/frontend state api issues (#1513)

* fix(customDrawer/primaryAppBar): replace img_url key with profile_img key to display profile picture

* fix(taskSubmissionMap): replace comparision with taskId with task index

* fix(submissionDetails): replace decodedProjectId with projectId

* fix(submissionDetails): replace decodedProjectId with projectId & show recieved status by defualt if no reviewState

* fix(projectSubmissions): statuses endpoint fetch to display taskList and display taskList options

* fix(taskSubmission): replace uid with fid

* fix(taskSelectionPopup): use task index instead of taskId

* fix(dialogTaskActions): use taskId instead of task index on api fetch, post

* fix(activitiesPanel): zoom to task using taskIndex

* Fix/task history tab order (#1514)

* fix(customDrawer/primaryAppBar): replace img_url key with profile_img key to display profile picture

* fix(taskSubmissionMap): replace comparision with taskId with task index

* fix(submissionDetails): replace decodedProjectId with projectId

* fix(submissionDetails): replace decodedProjectId with projectId & show recieved status by defualt if no reviewState

* fix(projectSubmissions): statuses endpoint fetch to display taskList and display taskList options

* fix(taskSubmission): replace uid with fid

* fix(projectDetailsV2): order taskHistory tab to first & defult show taskHistory tab on task click

* fix(taskSelectionPopup): use task index instead of taskId

* fix(dialogTaskActions): use taskId instead of task index on api fetch, post

* fix(activitiesPanel): zoom to task using taskIndex

* fix(projectModel): add index type to taskBoudriesTypes

* fix(comments): use taskId instead of index for get & post api

* fix: populate task_id correctly in feature properties (#1515)

* feat: download submissions in geojson (#1517)

* feat (frontend): submissions geojson download (#1518)

* feat(projectSlice): action and state to track submission download loading

* feat(project): DownloadSubmission geojson service to download geojson

* feat(projectDetailsV2): pass project name to projectOptions component as props

* feat(projectOptions): submission geojson download button & functionality add

* fix: download submissions(csv,json) & refactor submission endpoints (#1519)

* fix: typo error in project name prefix in submission-download-geojson (#1523)

* Fix submission download (#1524)

* fix(projectSubmissions): csv & json download fix according to api

* fix(projectSubmissions): add project name as file name

* Fix merge conflict (development -> staging) (#1525)

* build: bump version string --> 2024.0.2 to prep for next release

* bump: version 2024.2.0 β†’ 2024.3.0

* fix(hotfix): use centroids for extract division by task area (#1336)

* fix: fix random integer generation if missing in data extract

* fix: reduce length of random id generated for data extract

* fix: hotfix add top level id to geojson with it missing

* fix: default UNDERPASS_API_URL no trailing slash

* build: revert v2024.3.0 --> v2024.1.0

* bump: version 2024.1.0 β†’ 2024.2.0

---------

Co-authored-by: spwoodcock <[email protected]>
Co-authored-by: Sam <[email protected]>

---------

Co-authored-by: Nishit Suwal <[email protected]>
Co-authored-by: sujanadh <[email protected]>
Co-authored-by: spwoodcock <[email protected]>
Co-authored-by: Sam <[email protected]>
Co-authored-by: Deepak Pradhan (Varun) <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants