Skip to content

Release v0.1.0.alpha1#4

Merged
radiantshaw merged 12 commits intomainfrom
release/0.1.0.alpha1
Jan 20, 2026
Merged

Release v0.1.0.alpha1#4
radiantshaw merged 12 commits intomainfrom
release/0.1.0.alpha1

Conversation

@radiantshaw
Copy link
Owner

Updated gemspec with the correct details. Also verified by building the gem locally. Other changes are updates to README that mainly updates the Usage section, and references to this repo.

Added the ability to fetch the ID Token via the Authorization Code
Grant. The class responsible for doing the fetching is
`::Vauth::AuthCodeGrant`. It returns a `::Vauth::IdentityToken` via its
`#identity_token` method. `::Vauth::AuthCodeGrant` currently only has
the ability to deal with the ID Token, as I'm only focusing on Open ID
Connect for now. In the future, it should also have a method to fetch
the Access Token.

The `::Vauth::Client` struct holds the information that allows the grant
object to make the request. Currently, I'm not sure if there's a better
way to encapsulate the information handled via the `::Vauth::Client`
class, but its refactor is on my mind if I find a better way.

Other notable changes are related to RuboCop. I didn't like the
defaults, so I changed it to my liking. The end goal is to collect all
these and extract a gem out of it.

Installed the `debug` gem as well for obvious reasons. It also created a
`Gemfile.lock` that wasn't present earlier for some reason.

Installed the `jwt` gem as well to decode the ID Token received from the
OAuth2 Provider.

Generated the binstub for Rake to make it easier to run the tests as
well as RuboCop.

Also had to remove a spec that was failing. It was just an example spec.
Created the `::Vauth::AuthorizationRequest` class which currently has
the ability to construct the Authorization URL via the `#url` method.
It needs the `::Vauth::Client` to construct the URL.

Also had to modify the `::Vauth::Client` struct to now hold the
`:authorization_uri` value.

Also fixed some RuboCop issues in other places, and modified some
default RuboCop rules.
Added the ability to generate the state of a request to the
`::Vauth::AuthorizationRequest` class. When a state is not passed, it
represents a new request to be made by the Resource Owner. When a state
is passed, it represents a previously made request by the Resource
Owner.

The ability to verify is given to the `::Vauth::AuthCodeGrant` object.
It needs the request instance, and the received state from the redirect.
The state value returned by the `::Vauth::AuthorizationRequest#state`
method should be stored in a secured storage (like Rails sessions)
before redirecting the Resource Owner to the Authorization URI. If the
stored and received states don't match, then the
`::Vauth::AuthCodeGrant` instance is not available and an error is
thrown. The thought behind this is that if there's a state mismatch,
then you're not given the grant to fetch the ID Token (and Access Token,
but it's not implemented).

Also modified a RuboCop rule for the block length metric. I'm just gonna
keep increasing the number for now to see how big the test blocks get. I
might just disable this metric for tests, but at the same time I don't
want the tests to get out of hand. Let's see!
`token_uri` was wrapped, but `authorization_uri` wasn't.

Also, I'm not sure if everytime `::Vauth::Client#token_uri` or
`::Vauth::Client#authorization_uri` is called, it should return a new
instance of `URI`. I feel like it should be the responsibility of the
consumers of this class to do the duplication if they need it. But, I'm
not stressing about it right now, so we should be good!
Renamed it to `::Vauth::AuthorizationCodeGrant` for no particular reason
other than feeling like "Auth" should be "Authorization".
For no specific reason than the fact that I hate keeping track of what
dependencies need to be required in a file.
Updated the gemspec file with the necessary information, and tested it
by building the gem. Had to then gitignore the `.gem` file.
Added a warning to tell everyone not to use this in production.
Hopefully, the slopcoders read this.

Added all the usage instructions, and also updated the references to the
repo on GitHub.
@radiantshaw radiantshaw self-assigned this Jan 20, 2026
@radiantshaw radiantshaw merged commit fa99299 into main Jan 20, 2026
1 check passed
@radiantshaw radiantshaw deleted the release/0.1.0.alpha1 branch January 20, 2026 07:48
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.

1 participant