Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Oct 15, 2018

Every time I come back to this library I make the same mistake and it costs my hours to debug.

I instantiate the client like so :

c = Tentacat.Client.new("my secret github token" )

Rather than :

c = Tentacat.Client.new( %{access_token: "my secret github token" }

This PR is an attempt to prevent others from making a similar mistake.

Every time I come back to this library I make the same mistake and it costs my hours to debug. 

I instantiate the client like so : 

`c =  Tentacat.Client.new("my secret github token" )`

Rather than :  

`c =  Tentacat.Client.new( %{access_token: "my secret github token" }` 

This PR is an attempt to prevent others from making a similar mistake.
@ghost ghost changed the title Force a check of passed creds Tentacat.Client.new - force a check of cred type Oct 15, 2018
@ghost
Copy link
Author

ghost commented Oct 15, 2018

Just to clarify - So it fails instantly if I pass an incorrect structure when instantiating the client.

@edgurgel
Copy link
Owner

@bryanhuntesl, thanks! I think it makes total sense to validate this 👍


test "default endpoint" do
client = new(%{})
client = new()
Copy link
Author

Choose a reason for hiding this comment

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

So when communicating with github - providing no credentials is acceptable.

@edgurgel edgurgel merged commit 5148ffb into edgurgel:master Nov 14, 2018
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.

1 participant