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

Get rid of LoginCache in favour of a stored property for an identity #67

Merged
merged 7 commits into from
Oct 13, 2024

Conversation

Joannis
Copy link
Member

@Joannis Joannis commented Sep 29, 2024

…that's optional

@Joannis Joannis changed the title Get rid of LoginCache in favour of a stored property for an identity … Get rid of LoginCache in favour of a stored property for an identity Sep 29, 2024
Copy link
Member

@adam-fowler adam-fowler left a comment

Choose a reason for hiding this comment

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

Looks good, outside a couple of minor things. Makes me wonder if we should change the name of some of the other symbols that use User to Identity.

Copy link
Member

@adam-fowler adam-fowler left a comment

Choose a reason for hiding this comment

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

Nearly there. Is it worth merging both this and the session middleware at the same time. I'm pretty sure they will have clashes.

adam-fowler
adam-fowler previously approved these changes Sep 30, 2024
Copy link
Member

@adam-fowler adam-fowler left a comment

Choose a reason for hiding this comment

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

Looks good. Can we have a sibling PR which implements this across all the examples.

@adam-fowler adam-fowler dismissed their stale review September 30, 2024 09:44

Oh and working tests

@Joannis
Copy link
Member Author

Joannis commented Sep 30, 2024

Right, I changed 1 signature after running the tests :|

@adam-fowler
Copy link
Member

Swift format?

@adam-fowler
Copy link
Member

adam-fowler commented Sep 30, 2024

There also a number of documentation updates to make.

@Joannis
Copy link
Member Author

Joannis commented Sep 30, 2024

Isn't the documentation part of a different package?

@adam-fowler
Copy link
Member

The errors are most likely in the function comment headers. If you check the output you can see the issues.

Copy link
Member

@adam-fowler adam-fowler left a comment

Choose a reason for hiding this comment

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

We are good. Need a PR in examples fixing the examples up. Hopefully that'll also show up any issues with the changes if there are any.

@adam-fowler adam-fowler merged commit 187b3dc into session-middleware Oct 13, 2024
4 of 6 checks passed
@adam-fowler adam-fowler deleted the jo/replace-logincache-with-generics branch October 13, 2024 20:58
adam-fowler added a commit that referenced this pull request Oct 14, 2024
* SessionMiddleware storing session in context

* sessions should be a let

* Fix up BasicSessionRequestContext

* Add expiration date

* Add SessionMiddleware.init that takes persist storage directly

* Comments

* Make SessionContext.init public

* fixup documentation

* More comments

* Delete session and updating tests

* Shouldn't be required to set an expiresIn value when updating session

* Make SessionStorage generic over the session type

* Fix the unit tests

* Get rid of LoginCache in favour of a stored property for an identity (#67)

* Get rid of LoginCache in favour of a stored property for an identity that's optional

* Remove the Authenticatable protocol

* Simplify usage of generics constraints

* Fix the use of the IsAuthenticatedMiddleware init

* Formatting

* Clean up docs

* A bit lighter on nested generics by moving them to the middleware

---------

Co-authored-by: Joannis Orlandos <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants