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

increase mobile app verification token TTL from 1 minute to 5 minutes #2859

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Changed

- Increase mobile app verification token TTL by @joeyorlando ([#TBD](https://github.com/grafana/oncall/pull/TBD))

### Fixed

- Changed HTTP Endpoint to Email for inbound email integrations
Expand Down
1 change: 0 additions & 1 deletion docker-compose-developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ services:
labels: *oncall-labels
environment:
ONCALL_API_URL: http://host.docker.internal:8080
MOBILE_APP_QR_INTERVAL_QUEUE: 290000 # 4 minutes and 50 seconds
volumes:
- ./grafana-plugin:/etc/app
- node_modules_dev:/etc/app/node_modules
Expand Down
3 changes: 1 addition & 2 deletions engine/apps/mobile_app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import typing

from django.conf import settings
from django.core import validators
from django.db import models
from django.utils import timezone
Expand All @@ -15,7 +14,7 @@
if typing.TYPE_CHECKING:
from apps.user_management.models import Organization, User

MOBILE_APP_AUTH_VERIFICATION_TOKEN_TIMEOUT_SECONDS = 60 * (5 if settings.DEBUG else 1)
MOBILE_APP_AUTH_VERIFICATION_TOKEN_TIMEOUT_SECONDS = 60 * 5 # 5 minutes


def get_expire_date():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ type Props = {
};

const INTERVAL_MIN_THROTTLING = 500;
const INTERVAL_QUEUE_QR = process.env.MOBILE_APP_QR_INTERVAL_QUEUE
? parseInt(process.env.MOBILE_APP_QR_INTERVAL_QUEUE, 10)
: 50000;
/**
* 290_000 = 4 minutes and 50 seconds
* QR code token has a TTL of 5 minutes
* This means we will fetch a new token just before the current one expires
*/
const INTERVAL_QUEUE_QR = 290_000;
const INTERVAL_POLLING = 5000;
const BACKEND = 'MOBILE_APP';

Expand Down
1 change: 0 additions & 1 deletion grafana-plugin/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ module.exports.getWebpackConfig = (config, options) => {
*/
new webpack.EnvironmentPlugin({
ONCALL_API_URL: null,
MOBILE_APP_QR_INTERVAL_QUEUE: null,
}),
new webpack.DefinePlugin({
'process.env': JSON.stringify(dotenv.config().parsed),
Expand Down
Loading