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

feat: Add JWT Authentication #12

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

feat: Add JWT Authentication #12

wants to merge 5 commits into from

Conversation

3ettilina
Copy link
Contributor

Status

READY

Description

This PR adds missing functionality for authenticating with DoorDashDrive based on an AccessKey provided.
It includes a little bit of refactor to make it work and isolate how we handle and store the generated token.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@3ettilina 3ettilina requested a review from mtwichel March 23, 2024 13:57
@3ettilina 3ettilina self-assigned this Mar 23, 2024
@3ettilina 3ettilina added the ready for review This PR is excited to be reviewed label Mar 23, 2024
Copy link
Contributor

@mtwichel mtwichel left a comment

Choose a reason for hiding this comment

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

Two little nitpicks - nice work! Thanks for doing this!

import 'package:equatable/equatable.dart';

/// Holds properties for generating a Doordash Drive API token
class AccessKey extends Equatable {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class AccessKey extends Equatable {
class TokenProperties extends Equatable {

I think when I hear access key, I think of a single key I need to make API calls. Could we rename this to be a bit more clear?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with you. When using AccessKey I was following Doordash Drive's doc suggestion. Will apply the change

late String _token;
final AccessKey _accessKey;

String get getToken {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
String get getToken {
String get token {

since this is already a getter, can we rename this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review This PR is excited to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants