Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit6a733a5

Browse files
committed
Merge pull request#160 from github/org-members-redirection
Org members redirection
2 parents4b80a31 +5612df8 commit6a733a5

File tree

4 files changed

+49
-14
lines changed

4 files changed

+49
-14
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
kind:change
3+
title:Organization Members Resource Changes
4+
created_at:2012-10-12
5+
author_name:pezra
6+
---
7+
8+
Requesting the[member list](/v3/orgs/members/index.html#members-list) of an organization of which you are not a member now redirects to the[public members list](v3/orgs/members/index.html#public-members-list). Requests to[membership check](/v3/orgs/members/index.html#check-membership) resources of an organization of which you are not a member are similarly redirected to the equivalent[public membership check](/v3/orgs/members/index.html#check-public-membership) unless it is a check about yourself, in which case it is treated as a request by a member.
9+
10+
The changes where made to clarify the purpose of these various resources. The`/orgs/{org}/members` resources are intended for use by members of the organization in question. The`/orgs/{org}/public_members` resources are intended for acquiring information about organizations of which you are not a member.

‎content/v3.md‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,19 @@ already\_exists
123123
can happen in resources that must have some unique key (such as Label
124124
names).
125125

126-
If resources have custom validation errors, they will be documented with
127-
the resource.
126+
If resources have custom validation errors, they will be documented with the resource.
127+
128+
##HTTP Redirects
129+
130+
API v3 uses HTTP redirection where appropriate. Clients should assume that any request may result in a redirection. Receiving an HTTP redirection is*not* an error and clients should follow that redirect. Redirect responses will have a`Location` header field which contains the URI of the resource to which the client should repeat the requests.
131+
132+
301
133+
: Permanent redirection. The URI you used to make the request has be superseded by the one specified in the`Location` header field. This and all future requests to this resource should be directed the new URI.
134+
135+
302, 307
136+
: Temporary redirection. The request should be repeated verbatim to the URI specified in the`Location` header field but clients should continue to use the original URI for future requests.
137+
138+
Other redirection status codes may be used in accordance with the HTTP 1.1 spec.
128139

129140
##HTTP Verbs
130141

@@ -188,7 +199,7 @@ users.
188199
##Pagination
189200

190201
Requests that return multiple items will be paginated to 30 items by
191-
default. You can specify further pages with the`?page` parameter.For some
202+
default. You can specify further pages with the`?page` parameter. For some
192203
resources, you can also set a custom page size up to 100 with the`?per_page` parameter.
193204
Note that for technical reasons not all endpoints respect the`?per_page` parameter,
194205
see[events](http://developer.github.com/v3/events/) for example.
@@ -393,4 +404,3 @@ A link that looks like this:
393404
<%= json "Link" =>[
394405
["url1", {:rel => "next"}],
395406
["url2", {:rel => "foo",:bar => "baz"}]] %>
396-

‎content/v3/orgs/members.md‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ title: Organization Members | GitHub API
77
* TOC
88
{:toc}
99

10-
##List members
10+
##Members list
1111

1212
List all users who are members of an organization. A member is a user
13-
that belongs to at least 1 team in the organization. If the authenticated user is
14-
also a member of this organization then both concealed and public
15-
members will be returned. Otherwise only public members are returned.
13+
that belongs to at least 1 team in the organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. If the reqeuster is not a member of the organization the query will be redirected to the[public members list](#public-members-list).
1614

1715
GET /orgs/:org/members
1816

@@ -21,18 +19,32 @@ members will be returned. Otherwise only public members are returned.
2119
<%= headers 200 %>
2220
<%= json(:user) { |h|[h] } %>
2321

24-
##Get member
22+
###Response if requester is not an organization member
23+
24+
<%= headers 302, "Location" => "https://api.github.com/orgs/github/public_members" %>
25+
26+
##Check membership
27+
28+
Check if a user is, publicly or privately, a member of the organization.
2529

2630
GET /orgs/:org/members/:user
2731

28-
###Response if user is a member
32+
###Response ifrequester is an organization member anduser is a member
2933

3034
<%= headers 204 %>
3135

32-
###Response if user is not a member
36+
###Response if requester is an organization member and user is not a member
37+
38+
<%= headers 404 %>
39+
40+
###Response if requester is not an organization member and is inquiring about themselves
3341

3442
<%= headers 404 %>
3543

44+
###Response if requester is not an organization member
45+
46+
<%= headers 302,:Location => "https://api.github.com/orgs/github/public_members/pezra" %>
47+
3648
##Add a member
3749

3850
To add someone as a member to an org, you must add them to a
@@ -49,7 +61,7 @@ they will no longer have any access to the organization's repositories.
4961

5062
<%= headers 204 %>
5163

52-
##List publicmembers
64+
##Publicmembers list
5365

5466
Members of an organization can choose to have their membership
5567
publicized or not.
@@ -61,7 +73,7 @@ publicized or not.
6173
<%= headers 200 %>
6274
<%= json(:user) { |h|[h] } %>
6375

64-
##Get if a user is apublicmember
76+
##Checkpublicmembership
6577

6678
GET /orgs/:org/public_members/:user
6779

‎lib/resources.rb‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ module Helpers
1212
202=>'202 Accepted',
1313
204=>'204 No Content',
1414
301=>'301 Moved Permanently',
15+
302=>'302 Found',
16+
307=>'307 Temporary Redirect',
1517
304=>'304 Not Modified',
1618
401=>'401 Unauthorized',
1719
403=>'403 Forbidden',
@@ -23,7 +25,8 @@ module Helpers
2325

2426
AUTHORS={
2527
:technoweenie=>'821395fe70906c8290df7f18ac4ac6cf',
26-
:pengwynn=>'7e19cd5486b5d6dc1ef90e671ba52ae0'
28+
:pengwynn=>'7e19cd5486b5d6dc1ef90e671ba52ae0',
29+
:pezra=>'f38112009dc16547051c8ac246cee443'
2730
}
2831

2932
DefaultTimeFormat="%B %-d, %Y".freeze

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp