Skip to content

Go SDK v0.3.0 #193

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

Closed
wants to merge 11 commits into from
Closed

Go SDK v0.3.0 #193

wants to merge 11 commits into from

Conversation

MOmarMiraj
Copy link
Contributor

No description provided.

@MOmarMiraj MOmarMiraj self-assigned this Apr 10, 2025
example/main.go Outdated
}
// [developer-docs.sdk.go.list-items]-end

// [developer-docs.sdk.go.list-archived-items]-start
Copy link
Member

Choose a reason for hiding this comment

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

Can we call this snippet something like "using item list filters"? I think this is also what we should aim to name it in the docs, stating out that the filtering available today is by states.

- **Support for item states**: You can now fetch an item's state using the SDK. `Item` and `ItemOverview` expose two states: `Active` and`Archived`.
- `Active`: An item located inside a vault. (Default)
- `Archived`: An item that has been moved to the Archive. 1Password doesn't include archived items in search results or suggest them when you fill in apps and browsers. You can keep archived items as long as you'd like.
- **Filtering the return of item listing by state**: You can now filter the listed items by item state. The current exposed filter is `ByState`, which allows devs to filter `ItemOverviews` by their `State` .
Copy link
Member

Choose a reason for hiding this comment

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

I find this a bit abstract - who is "devs"?

Likely, the people reading this are also the people that use the SDK, so I'd rephrase this to something such as simply:

You can now filter the listed items by item state. 

- **Adding custom fields in sections automatically**: The SDK now automatically adds custom fields without a section to an empty section within the item, creating it if necessary.
- **`Tags` in item overviews**: The return type of `Items().ListAll` now also contains the item tags.
- **Broader item editing capabilities**: You are now able to use the `items.put` function on more items, including those with fields that are not directly editable through the SDK (such as legacy fields, passkeys etc.)
- **Improved Deleting Capabilities:** You can now delete `Archived` items in the SDKs.
Copy link
Member

Choose a reason for hiding this comment

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

maybe even under FIXED?

Consider rephrasing to:

**Deleting Archived Items:** The SDK now supports deleting items from the archive.

As "improved deleting capabilities" loses some nuance:

  • it does not reference items
  • "improved" is redundant with the title of the section

- When multiple sections match a section query in resolving secret references, the SDK look through the fields in all sections, instead of erroring.
This release contains a breaking change for the Go SDK.

`Items().ListAll()` has changed to `Items().List()` and below is how to migrate.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`Items().ListAll()` has changed to `Items().List()` and below is how to migrate.
`Items().ListAll()` has changed to `Items().List()`. To migrate to the latest SDK version:


`Items().ListAll()` has changed to `Items().List()` and below is how to migrate.

Before:
Copy link
Member

Choose a reason for hiding this comment

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

This should mention explicitly the action that needs to be performed. Is it replacing? Is it deleting/adding code?

After:

```go
overviews, err := client.Items().List(
Copy link
Member

Choose a reason for hiding this comment

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

let's make sure the indentation is similar between the two snippets, such that they are really replaceable.

panic(err)
}

// To iterate through this you can do the following:
Copy link
Member

Choose a reason for hiding this comment

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

This should not be in the code that we recommend customers to copy paste. Consider breaking this down in two snippets if there are explanations we need to provide halfway through?

Comment on lines 59 to 60
`Vaults().ListAll()` has changed to `Vaults().List()` and the migration guide is below:

Copy link
Member

Choose a reason for hiding this comment

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

same comment as above

```
`Vaults().ListAll()` has changed to `Vaults().List()` and the migration guide is below:

Before:
Copy link
Member

Choose a reason for hiding this comment

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

same comment as above

}
```

* All functions that return an Iterator will now return the appropriate list type.
Copy link
Member

Choose a reason for hiding this comment

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

This is a bit misplaced here, as you ve already provided migration guides above. Consider either incorporating this in the points above or breaking down the migration guides for each point.


* All functions that return an Iterator will now return the appropriate list type.

This does not affect any code already deployed, and will not take effect in your codebase until you choose to update to v0.3.0+ of the 1Password Go SDK
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This does not affect any code already deployed, and will not take effect in your codebase until you choose to update to v0.3.0+ of the 1Password Go SDK
This does not affect any code that's already deployed, and will not take effect in your codebase until updating to v0.3.0+ of the 1Password Go SDK.

Copy link
Member

Choose a reason for hiding this comment

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

Also, \n EOF please 🙏

@MOmarMiraj
Copy link
Contributor Author

This has been addressed in #194

@MOmarMiraj MOmarMiraj closed this Apr 14, 2025
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