Add Create/Get/Delete for oauth2 apps #305
No reviewers
Labels
No Label
has/backport
has/pull
in progress
invalid
kind/breaking
kind/bug
kind/build
kind/deployment
kind/docs
kind/enhancement
kind/feature
kind/lint
kind/proposal
kind/question
kind/refactor
kind/security
kind/testing
kind/translation
kind/ui
need/backport
priority/critical
priority/low
priority/maybe
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
No Milestone
No Assignees
3 Participants
Notifications
Total Time Spent: 16 minutes 46 seconds
Due Date
6543
16 minutes 46 seconds
No due date set.
Dependencies
No dependencies set.
Reference: gitea/go-sdk#305
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch ":master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After doing some discovery work for integrating into Gitea, I noticed I couldn’t programmatically create Oauth2 applications. This PR adds Create, List, and Delete, for Oauth2 User Applications.
However, Update, Edit and Get aren’t implemented in the API, so no attempt was made to create subscribers for those endpoints.
@graytshirt pleace update pr description
@ -0,0 +1,56 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
Tiny nit, could you change this to 2020?
oh, for sure my bad! I just updated and squashed!
haha, it's ok, I get caught by that myself too. Thanks for PR 😄
@graytshirt looks good 🎉 two things ...
since this api endpoints are in >= v1.12.0 pleace add a version check
example: https://gitea.com/gitea/go-sdk/src/branch/master/gitea/issue.go#L121
and thigs from code review
@ -0,0 +1,56 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
2020 :D
done.
@ -0,0 +50,4 @@
}
// DeleteOauth2 delete an Oauth2 application by name
func (c *Client) DeleteOauth2(oauth2name string) error {
this should be an integer since api like to have oauth2app id -> https://try.gitea.io/api/swagger#/user/userDeleteOAuth2Application
yeap. done.
@ -0,0 +28,4 @@
assert.Len(t, a, 1)
assert.EqualValues(t, newApp.Name, a[0].Name)
assert.NoError(t, c.DeleteOauth2(newApp.Name))
use .ID
yeap. done.
I'm not sure why CI passed with Name for deletion - I'll have a look at it later.
Add commands for user oauth2 appsto Add Create/Get/Delete for oauth2 appsI took a fail early approach with checking the version, hope that's okay
sweet! thanks!