Skip to content

feat: Support setting the audience (aud)#25

Merged
richzw merged 2 commits into
richzw:masterfrom
tqtifnypmb:master
Jun 22, 2025
Merged

feat: Support setting the audience (aud)#25
richzw merged 2 commits into
richzw:masterfrom
tqtifnypmb:master

Conversation

@tqtifnypmb

Copy link
Copy Markdown
Contributor

Support allowing users to set the signing audience, as some Apple APIs require a specific audience.

@richzw
richzw requested review from Copilot and richzw June 21, 2025 05:20

Copilot AI left a comment

Copy link
Copy Markdown

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 a customizable signing audience (aud) required by some Apple APIs.

  • Introduces an Audience field in both Token and StoreConfig structures.
  • Updates token generation to use the provided audience value or default to "appstoreconnect-v1" when unset.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
token.go Added Audience field, updated WithConfig and Generate methods to set and use the audience value.
store.go Added Audience field in the StoreConfig structure.
Comments suppressed due to low confidence (1)

token.go:95

  • Ensure that unit tests cover the scenario where Audience is not provided, verifying that the default value "appstoreconnect-v1" is correctly applied.
		audience = "appstoreconnect-v1"

Comment thread token.go Outdated
}
audience := t.Audience
if audience == "" {
audience = "appstoreconnect-v1"

Copilot AI Jun 21, 2025

Copy link

Choose a reason for hiding this comment

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

Consider extracting the default audience value "appstoreconnect-v1" into a constant to improve maintainability and avoid magic strings.

Suggested change
audience = "appstoreconnect-v1"
audience = DefaultAudience

Copilot uses AI. Check for mistakes.

@richzw richzw left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

It could be better to extract the default audience value "appstoreconnect-v1" into a constant to improve maintainability and avoid magic strings as copilot suggestion.

@tqtifnypmb

@tqtifnypmb

Copy link
Copy Markdown
Contributor Author

Done~

@richzw

richzw commented Jun 22, 2025

Copy link
Copy Markdown
Owner

LGTM, Thank you for your PR

@richzw
richzw merged commit 9b29f63 into richzw:master Jun 22, 2025
1 check passed
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.

3 participants