-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Allow creation of OAuth2 applications for orgs #18084
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
Merged
Merged
Changes from 31 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
840d1e0
Allow creation of OAuth2 applications for orgs
qwerty287 bdda6a1
Merge branch 'main' into org-oauth2
qwerty287 5dd629c
Merge branch 'main' into org-oauth2
qwerty287 e844523
Merge branch 'main' into org-oauth2
qwerty287 2e3bccf
Fix import
qwerty287 d52f718
Merge branch 'main' into org-oauth2
qwerty287 171701a
fmt
qwerty287 8bb9912
Merge branch 'main' into org-oauth2
qwerty287 4567ea9
Merge branch 'main' into org-oauth2
qwerty287 7e5c6dc
Merge branch 'main' into org-oauth2
qwerty287 5940d7f
Merge branch 'main' into org-oauth2
qwerty287 86e733c
Merge branch 'main' into org-oauth2
qwerty287 a8dfb7b
Merge branch 'org-oauth2' of github.com:qwerty287/gitea into org-oauth2
qwerty287 1f920df
Fix merge
qwerty287 3775a32
Merge branch 'main' into org-oauth2
qwerty287 e4fe3c6
Merge branch 'main' into org-oauth2
qwerty287 cb9c5aa
Merge branch 'main' into org-oauth2
qwerty287 2804d63
Merge branch 'main' into org-oauth2
qwerty287 4f6579e
Merge branch 'main' into org-oauth2
qwerty287 0d53655
Merge branch 'main' into org-oauth2
qwerty287 c04065b
Adapt refactors
qwerty287 97b795d
Merge branch 'main' into org-oauth2
qwerty287 443b1bb
Merge branch 'main' into org-oauth2
qwerty287 6d9650e
Merge branch 'main' into org-oauth2
qwerty287 0d76da1
Merge branch 'main' into org-oauth2
qwerty287 c1fd02a
Merge branch 'main' into org-oauth2
qwerty287 eb58018
Merge branch 'main' into org-oauth2
qwerty287 e59ecb4
Merge branch 'main' into org-oauth2
qwerty287 fe95171
Use `locale.Tr`
qwerty287 5805461
Merge branch 'main' into org-oauth2
qwerty287 09c2a7e
Merge branch 'main' into org-oauth2
qwerty287 dbdd8c5
Merge branch 'main' into org-oauth2
6543 599ef41
Merge branch 'main' into org-oauth2
6543 975a01d
Merge branch 'main' into org-oauth2
qwerty287 64b1b9b
Merge branch 'main' into org-oauth2
6543 48f9907
Merge branch 'main' into org-oauth2
qwerty287 cfa7bae
Merge branch 'main' into org-oauth2
qwerty287 dcfed4b
Merge branch 'main' into org-oauth2
qwerty287 16d6a90
Remove modal
qwerty287 4be12c4
Merge branch 'main' into org-oauth2
6543 20183ef
Merge branch 'main' into org-oauth2
qwerty287 4031fa8
Remove dupl code on tmpls
qwerty287 6facd1e
Fixes and move edit form to separate tmpl
qwerty287 cafd775
fix incent
qwerty287 57595d5
Merge branch 'main' into org-oauth2
qwerty287 280bcef
refactor
wxiaoguang 95d7686
fix org application url
wxiaoguang c512332
fix links
wxiaoguang e385e92
fix lint
wxiaoguang 6c4770d
Merge branch 'main' into org-oauth2
wxiaoguang dc778a4
Merge branch 'main' into org-oauth2
wxiaoguang f95470f
Merge branch 'main' into org-oauth2
wxiaoguang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{{template "base/head" .}} | ||
<div class="page-content organization settings options"> | ||
{{template "org/header" .}} | ||
<div class="ui container"> | ||
<div class="ui grid"> | ||
{{template "org/settings/navbar" .}} | ||
<div class="twelve wide column content"> | ||
{{template "base/alert" .}} | ||
<h4 class="ui top attached header"> | ||
{{.locale.Tr "settings.applications"}} | ||
</h4> | ||
<div class="ui attached segment"> | ||
<div class="ui key list"> | ||
<div class="item"> | ||
{{.locale.Tr "settings.oauth2_application_create_description"}} | ||
</div> | ||
{{range $app := .Applications}} | ||
<div class="item"> | ||
<div class="right floated content"> | ||
<a href="{{$.Link}}/{{$app.ID}}" class="ui primary tiny button"> | ||
{{svg "octicon-pencil" 16 "mr-2"}} | ||
{{$.locale.Tr "settings.oauth2_application_edit"}} | ||
</a> | ||
<button class="ui red tiny button delete-button" data-modal-id="remove-gitea-oauth2-application" | ||
data-url="{{$.Link}}/{{.ID}}/delete" | ||
data-id="{{$app.ID}}"> | ||
{{svg "octicon-trash" 16 "mr-2"}} | ||
{{$.locale.Tr "settings.delete_key"}} | ||
</button> | ||
</div> | ||
<div class="content"> | ||
<strong>{{$app.Name}}</strong> | ||
</div> | ||
</div> | ||
{{end}} | ||
</div> | ||
<div class="ui attached bottom segment"> | ||
<h5 class="ui top header"> | ||
{{.locale.Tr "settings.create_oauth2_application" }} | ||
</h5> | ||
<form class="ui form ignore-dirty" action="{{.Link}}" method="post"> | ||
{{.CsrfTokenHtml}} | ||
<div class="field {{if .Err_AppName}}error{{end}}"> | ||
<label for="application-name">{{.locale.Tr "settings.oauth2_application_name"}}</label> | ||
<input id="application-name" name="application_name" value="{{.application_name}}" required> | ||
</div> | ||
<div class="field {{if .Err_RedirectURI}}error{{end}}"> | ||
<label for="redirect-uri">{{.locale.Tr "settings.oauth2_redirect_uri"}}</label> | ||
<input type="url" name="redirect_uri" id="redirect-uri"> | ||
</div> | ||
<button class="ui green button"> | ||
{{.locale.Tr "settings.create_oauth2_application_button"}} | ||
</button> | ||
</form> | ||
</div> | ||
|
||
<div class="ui small basic delete modal" id="remove-gitea-oauth2-application"> | ||
<div class="ui icon header"> | ||
{{svg "octicon-trash"}} | ||
{{.locale.Tr "settings.remove_oauth2_application"}} | ||
</div> | ||
<div class="content"> | ||
<p>{{.locale.Tr "settings.oauth2_application_remove_description"}}</p> | ||
</div> | ||
{{template "base/delete_modal_actions" .}} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{{template "base/footer" .}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{{template "base/head" .}} | ||
<div class="page-content organization settings options"> | ||
{{template "org/header" .}} | ||
<div class="ui container"> | ||
<div class="ui grid"> | ||
{{template "org/settings/navbar" .}} | ||
<div class="twelve wide column content"> | ||
{{template "base/alert" .}} | ||
<h4 class="ui top attached header"> | ||
{{.locale.Tr "settings.edit_oauth2_application"}} | ||
</h4> | ||
<div class="ui attached segment form ignore-dirty"> | ||
{{.CsrfTokenHtml}} | ||
<div class="field"> | ||
<label for="client-id">{{.locale.Tr "settings.oauth2_client_id"}}</label> | ||
<input id="client-id" readonly value="{{.App.ClientID}}"> | ||
</div> | ||
{{if .ClientSecret}} | ||
<div class="field"> | ||
<label for="client-secret">{{.locale.Tr "settings.oauth2_client_secret"}}</label> | ||
<input id="client-secret" type="text" readonly value="{{.ClientSecret}}"> | ||
</div> | ||
{{else}} | ||
<div class="field"> | ||
<label for="client-secret">{{.locale.Tr "settings.oauth2_client_secret"}}</label> | ||
<input id="client-secret" type="password" readonly value="averysecuresecret"> | ||
</div> | ||
{{end}} | ||
<div class="item"> | ||
{{.locale.Tr "settings.oauth2_regenerate_secret_hint"}} | ||
<form class="ui form ignore-dirty" action="{{AppSubUrl}}/org/{{.Org.Name}}/settings/applications/{{.App.ID}}/regenerate_secret" method="post"> | ||
{{.CsrfTokenHtml}} | ||
<a href="#" onclick="event.target.parentNode.submit()">{{.locale.Tr "settings.oauth2_regenerate_secret"}}</a> | ||
</form> | ||
</div> | ||
</div> | ||
<div class="ui attached bottom segment"> | ||
<form class="ui form ignore-dirty" action="{{AppSubUrl}}/org/{{.Org.Name}}/settings/applications/{{.App.ID}}" method="post"> | ||
{{.CsrfTokenHtml}} | ||
<div class="field {{if .Err_AppName}}error{{end}}"> | ||
<label for="application-name">{{.locale.Tr "settings.oauth2_application_name"}}</label> | ||
<input id="application-name" value="{{.App.Name}}" name="application_name" required> | ||
</div> | ||
<div class="field {{if .Err_RedirectURI}}error{{end}}"> | ||
<label for="redirect-uri">{{.locale.Tr "settings.oauth2_redirect_uri"}}</label> | ||
<input type="url" name="redirect_uri" value="{{.App.PrimaryRedirectURI}}" id="redirect-uri"> | ||
</div> | ||
<button class="ui green button"> | ||
{{.locale.Tr "settings.save_application"}} | ||
</button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="ui small basic delete modal" id="delete-oauth2-application"> | ||
<div class="ui icon header"> | ||
{{svg "octicon-trash"}} | ||
{{.locale.Tr "settings.remove_oauth2_application"}} | ||
</div> | ||
<div class="content"> | ||
<p>{{.locale.Tr "settings.remove_oauth2_application_desc"}}</p> | ||
</div> | ||
{{template "base/delete_modal_actions" .}} | ||
</div> | ||
{{template "base/footer" .}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.