Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Implement GPG related api #36

Merged
merged 3 commits into from
Jan 21, 2017
Merged

Implement GPG related api #36

merged 3 commits into from
Jan 21, 2017

Conversation

sapk
Copy link
Member

@sapk sapk commented Jan 17, 2017

In order to implement go-gitea/gitea#425

I added all the api call that should be implemented and struct needed to format requests and responses.

I follow the github format as a example: https://developer.github.com/v3/users/gpg_keys/

@@ -0,0 +1,67 @@
// Copyright 2015 The Gogs Authors. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

error comment head 2017 Gitea

@lunny
Copy link
Member

lunny commented Jan 17, 2017

LGTM

// GPGKeyEmail a email attache to a GPGKey
type GPGKeyEmail struct {
Email string `json:"email"`
//Verified bool `json:"verified"`
Copy link
Member

Choose a reason for hiding this comment

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

Nitpicking: Commented code?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's in the github api format but i don't know if in gitea we should/could present it. Maybe an other solution could be to uncomment it and add omitempty ?

Copy link
Member

Choose a reason for hiding this comment

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

We could supply it, so you could just uncomment it

@sapk
Copy link
Member Author

sapk commented Jan 17, 2017

As said on gitter, I hesitate to use PublicGPG... in place of GPG... since it will only contain the public part of the keys like the ssh keys. I don't know what you think of it.

@lunny
Copy link
Member

lunny commented Jan 18, 2017

Could we give an option to let user chose and we can use one as default?

@sapk
Copy link
Member Author

sapk commented Jan 18, 2017

@lunny You are saying to let the possibility to users to add a private gpg key to gitea ? From my point of view it would not be a good idea normally you limit the existence of your gpg keys only on trusted media.

My question was just for the format of object and function name to be as https://github.com/go-gitea/go-sdk/blob/master/gitea/user_key.go#L15 since it's the same case (gitea only need the public key)

@Bwko
Copy link
Member

Bwko commented Jan 18, 2017

I think that GPG is clear enough, since we don't have the private key

@sapk
Copy link
Member Author

sapk commented Jan 18, 2017

Ok perfect i will stick with this to continue in the next part (API and UI) in gitea.

@Bwko
Copy link
Member

Bwko commented Jan 18, 2017

LGTM

@sapk sapk mentioned this pull request Jan 20, 2017
5 tasks
@bkcsoft
Copy link
Member

bkcsoft commented Jan 21, 2017

@sapk Is this done?

@bkcsoft bkcsoft merged commit f5de21c into go-gitea:master Jan 21, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Jan 21, 2017

It follows the spec so I'm merging it anyway 😂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants