Skip to content

Conversation

KoditkarVedant
Copy link
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #453

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • AutheticationClient unit tests and integration tests

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for the Introspect token API to the Notion client library, allowing users to get a token's active status, scope, and issued time.

Key Changes:

  • Adds new IntrospectTokenAsync method to the authentication client with proper validation
  • Creates request/response models for the introspect token operation
  • Includes comprehensive unit and integration tests for the new functionality

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Test/Notion.UnitTests/Notion.UnitTests.csproj Adds Moq.AutoMock dependency for enhanced unit testing
Test/Notion.UnitTests/AuthenticationClientTests.cs Comprehensive unit tests for token introspection validation and functionality
Test/Notion.IntegrationTests/AuthenticationClientTests.cs Integration test demonstrating end-to-end token introspection workflow
Src/Notion.Client/Api/Authentication/IntrospectToken/Response/IntrospectTokenResponse.cs Response model with active status, scope, and issued time properties
Src/Notion.Client/Api/Authentication/IntrospectToken/Request/IntrospectTokenRequest.cs Request model implementing required interfaces for token introspection
Src/Notion.Client/Api/Authentication/IntrospectToken/Request/IIntrospectTokenBodyParameters.cs Interface defining token parameter for request body
Src/Notion.Client/Api/Authentication/IntrospectToken/AuthenticationClient.cs Core implementation of the introspect token functionality
Src/Notion.Client/Api/Authentication/IAuthenticationClient.cs Interface extension adding the new introspect method
Src/Notion.Client/Api/Authentication/BasicAuthParamValidator.cs Shared validation utility for basic authentication parameters
Src/Notion.Client/Api/ApiEndpoints.cs Adds the introspect token API endpoint URL

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +61 to +66
var request = new IntrospectTokenRequest
{
Token = "validToken",
ClientId = clientId,
ClientSecret = "validClientSecret"
};
Copy link
Preview

Copilot AI Sep 21, 2025

Choose a reason for hiding this comment

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

Similar issue - the test correctly uses the clientId parameter from InlineData, but the previous test for Token validation doesn't follow the same pattern.

Copilot uses AI. Check for mistakes.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@notion-dotnet notion-dotnet deleted a comment from Copilot AI Sep 21, 2025
@KoditkarVedant KoditkarVedant merged commit 115829b into main Sep 21, 2025
7 checks passed
@KoditkarVedant KoditkarVedant deleted the 453-add-support-for-introspect-token-endpoint branch September 21, 2025 09:06
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.

Add support for introspect token endpoint
1 participant