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

API changes for GA release #380

Closed
chlowell opened this issue Feb 3, 2023 · 2 comments · Fixed by #396
Closed

API changes for GA release #380

chlowell opened this issue Feb 3, 2023 · 2 comments · Fixed by #396
Labels

Comments

@chlowell
Copy link
Collaborator

chlowell commented Feb 3, 2023

API changes since v0.8.0

Upgrading from v0.8.* may require code changes as described below.

confidential.New requires an authority #394

confidential.WithAuthority has been deleted, and the URL it set is now a parameter of confidential.New :

// before
client, err := confidential.New(clientID, cred, confidential.WithAuthority(authority))

// after
client, err := confidential.New(authority, clientID, cred)

confidential.NewCredFromCertChain replaces NewCredFromCert #391

If your application calls NewCredFromCert, update arguments and return values:

before

certs, key, err := confidential.CertFromPEM(certData, password)
if err != nil {
    // TODO: handle error
}
cred := confidential.NewCredFromCert(certs[0], key)

after

certs, key, err := confidential.CertFromPEM(certData, password)
if err != nil {
    // TODO: handle error
}
cred, err := confidential.NewCredFromCert(certs, key)
if err != nil {
    // TODO: handle error
}

If your application calls confidential.NewCredFromCertChain, call NewCredFromCert instead.

All methods accessing cache data have a Context parameter #378

For example, RemoveAccount and Accounts:

// before
accounts, err := client.Accounts()

// after
accounts, err := client.Accounts(context.TODO())

Renamed functions

These functions are renamed but otherwise unchanged:

  • confidential.NewCredFromCertChain -> NewCredFromCert #391
  • confidential.WithAccessor -> WithCache #386
  • public/Client.CreateAuthCodeURL -> AuthCodeURL #384

Deleted API

  • confidential.NewCredFromAssertion. This function was deprecated in v0.6.0; use confidential.NewCredFromAssertionCallback instead #385
  • Unused options types such as public.InteractiveAuthOption and confidential.AcquireTokenSilentOptions. #383, #390
  • confidential/Client.UserID. The value was always "" and never used by the client. #389

New cache.ExportReplace parameters

The interface for custom cache implementations has new parameters for Context and metadata (#378, #395).

@grantjoy
Copy link

grantjoy commented May 10, 2023

This is really misleading as it's not mentioned in the docs but this new format must be used for it to work. All the examples I could find were incorrect.

@bgavrilMS
Copy link
Member

Well, we GA-ed so I guess this can be closed.

@handsomejack-42 handsomejack-42 unpinned this issue Jan 8, 2024
yiannistri added a commit to yiannistri/rancher that referenced this issue Apr 10, 2024
yiannistri added a commit to yiannistri/rancher that referenced this issue Apr 11, 2024
yiannistri added a commit to yiannistri/rancher that referenced this issue Apr 11, 2024
yiannistri added a commit to yiannistri/rancher that referenced this issue Apr 12, 2024
yiannistri added a commit to yiannistri/rancher that referenced this issue Apr 15, 2024
yiannistri added a commit to yiannistri/rancher that referenced this issue Apr 15, 2024
yiannistri added a commit to yiannistri/rancher that referenced this issue Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants