Skip to content

feat: Add JWT Authentication#12

Open
3ettilina wants to merge 5 commits into
mainfrom
feat/263-jwt-auth
Open

feat: Add JWT Authentication#12
3ettilina wants to merge 5 commits into
mainfrom
feat/263-jwt-auth

Conversation

@3ettilina

Copy link
Copy Markdown
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

@mtwichel mtwichel left a comment

Copy link
Copy Markdown
Contributor

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!

Comment thread lib/src/shared_model/access_key.dart Outdated
import 'package:equatable/equatable.dart';

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

Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread lib/src/token_storage.dart Outdated
late String _token;
final AccessKey _accessKey;

String get getToken {

Copy link
Copy Markdown
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