Giter Site home page Giter Site logo

airtable-go's People

Contributors

fabioberger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

airtable-go's Issues

Update Required for API Key Validation to Accommodate New Airtable API Key Formats

Hello,

I'm reaching out to address a compatibility issue with the airtable-go library in relation to the latest changes in Airtable's API key format. Airtable has updated their API keys to a new format, which includes a longer length and the use of additional characters such as "." (dot). This change impacts the airtable-go library's ability to validate API keys using the current implementation found in client.go.

Issue Description:
The library currently validates API keys with a fixed length of 17 characters and expects them to start with a specific prefix ("key"). This validation is performed by the IsValidAPIKey function in the utils package. However, with Airtable's recent update to their API key format, this validation logic no longer accommodates the new key specifications, potentially leading to valid API keys being incorrectly flagged as invalid.

func isValidAirtableID(id, expectedPrefix string) bool {
    regex := regexp.MustCompile("[a-zA-Z0-9]{17}")
    return len(id) == 17 && strings.HasPrefix(id, expectedPrefix) && regex.Match([]byte(id))
}

Suggested Actions:

  1. Update Validation Logic: Revise the isValidAirtableID function (and by extension, IsValidAPIKey and IsValidBaseID) to support the new API key format. This may involve adjusting the length check and expanding the character set to include "." (dot) among other characters now allowed in Airtable API keys.
  2. Flexible Length Check: Given that API key formats can change, consider making the length check more flexible or removing it altogether, focusing instead on the presence of a valid prefix and ensuring the key consists only of allowed characters.
  3. Enhance Documentation: Update the library's documentation to reflect these changes and provide guidance on the new API key format expectations for users of the airtable-go library.

Impact of Issue:
Without these adjustments, users of the airtable-go library who had to migrate to or are using the new Airtable API keys may encounter errors or be unable to use the library to interact with Airtable, hindering the library's applicability and usefulness.

We greatly appreciate the work you've put into developing and maintaining the airtable-go library. Addressing this issue will not only enhance its functionality but also ensure its compatibility with Airtable's evolving platform.

Thank you for considering this request. I'm looking forward to your thoughts on this matter and am happy to contribute to testing or further discussions if helpful.

Best regards
Pascal Rossi

Seeing re-use of elements for ListRecords

If I pass a []Row, where Row is:

type Row struct {
	AirtableID string `json:"id,omitempty"`
	Fields     map[string]interface{} `json:"fields"`
}

I end up having data cross the row boundary. If I switch it to an []interface{} or remove the optimization of it only creating tempRecordsHolder once, I get the correct behavior.

I've read the json.Unmarshal doc and agree it sounds like it shouldn't be re-using any values, but it looks like it is.

Proposal: allow HTTP transport (roundtripper) to be parameterized

First off, thanks for writing this API and open-sourcing it.

I was wondering if it makes sense to allow the transport of the HTTP client used by theimplementation to be parameterized.

This allows for:

  • automatic rate limiting by client. The RoundTripper implementation could automatically delay requests if more than 'm' concurrent requests are happening in the last 'n' seconds.
  • removal of API methods that exist only to allow the client to be stubbed. A custom RoundTripper can do whatever the heck it wants under the covers as long as it implements RoundTrip() correctly. IMO, this covers the testing use-case in a more idiomatic way than having to expose custom methods in the public interface used only for testing.

Let me know if this makes sense and I'll be happy to send a PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.