http 완벽가이드- 19장 배포시스템
TRANSCRIPT
HTTP�완벽가이드19장�배포시스템
1. FrontPage�서버�확장�2. WebDAV
FrontPage�서버�확장
• MS�FrontPage�제작을�지원하고�웹�서버�기능을�확장하는�프로그램과�스크립트�집합(https://www.microsoft.com/korea/technet/prodtechnol/sharepnt/proddocs/admindoc/glossary.mspx#frontpageserverextensions)�
• RPC를�HTTP�Post�요청�위에�구현�
https://www.microsoft.com/korea/technet/prodtechnol/sharepnt/proddocs/admindoc/owsa03.mspx
POST /_vti_bin/_vti_aut/author.dll HTTP/1.1Date: Sat, 12 Aug 2000 20:32:54 GMTUser-Agent: MSFrontPage/4.0..........................................<BODY>method=list+documents%3a4%2e0%2e2%2e3717&service%5fname=&listHiddenDocs=false&listExplorerDocs=false&listRecurse=false&listFiles=true&listFolders=true&listLinkInfo=true&listIncludeParent=true&listDerived=false&listBorders=false&listChildWebs=true&initialUrl=&folderList=%5b%3bTW%7c12+Aug+2000+20%3a33%3a04+%2d0000%5d
WebDAV
역사• Distributed�Authoring�
• Versioning�
• 1999�RFC�2518(HTTP�Extensions�for�Distributed�Authoring)�
• 2002�RFC�3253(Versioning�Extensions�to�WebDAV)�
• 2007�RFC�4918(HTTP�Extensions�for�Web�Distributed�Authoring�and�Versioning)�
• 80,�443�Port�
• 짐�화이트헤드,�팀�버너스�리�
• 팀�버너스�리의�최초의�웹�브라우저�월드와이드웹은�웹�페이지를�보고�편집하는�것이�가능했다!
WebDAV�새로운�HTTP�메서드• PROPFIND:�리소스의�속성을�읽는다�
• PROPATCH:�한�개�이상의�리소스에�대한�한�개�이상의�속성을�정의한다�
• MKCOL:�콜렉션을�생성�
• COPY:�리소스나�리소스의�집합을�복사�
• MOVE:�리소스나�리소스의�집합을�이동��
• LOCK:�하나�이상의�리소스를�잠금�
• UNLOCK:�잠긴�리소스�해제
책이�RFC�2518�기준임�https://tools.ietf.org/html/rfc2518�
RFC�4918을�참조�하는게..�https://tools.ietf.org/html/rfc4918
DAV�HTTP�Header
• DAV�=�“DAV”�“:”�“1”�[“,”�“2”]�[“,”�1#extend]�
• 모든�리소스는�OPTIONS�요청에�이�헤더를�포함해야�됨
Depth�HTTP�Header
• Depth�=�“Depth”�“:”�(“0”�|�“1”�|�“infinity”)�
• LOCK,�COPY,�MOVE가�사용�
• 하위�리소스를�얼만큼의�깊이까지�포함할지
Destination�HTTP�Header
• Destination�=�“Destination”�“:”�absoluteURI�
• COPY,�MOVE�메서드가�사용함
If�HTTP�HeaderIf = "If" ":" ( 1*No-tag-list | 1*Tagged-list)No-tag-list = ListTagged-list = Resource 1*ListResource = Coded-URLList = "(" 1*(["Not"](State-token | "[" entity-tag "]")) ")"State-token = Coded-URLCoded-URL = "<" absoluteURI ">"
• 정의된�상태�토큰은�lock�토큰뿐�
• 전제�조건이�틀리면�요청�실패�
• COPY,�PUT�메소드는�If�헤더에�전제�조건을�기술�
• 흔한�전제�조건은�LOck을�사전에�획득�하는것
Lock-Token�HTTP�Header
• Lock-Token�=�“Lock-Token”�“:”�Coded-URL�
• UNLOCK�메서드에서�해제할�잠금을�명시�
• LOCK�메서드는�응답으로�lock��토큰에�필요한�정보를�전달하는�Lock-Token�헤더를�포함
Overwrite�HTTP�Header
• Overwrite�=�“Overwrite”�“:”�(“T”�|�“F”)�
• COPY,�MOVE�메서드에서�리소스를�덮어�쓸지를�기술
Timeout�HTTP�HeaderTimeOut = "Timeout" ":" 1#TimeTypeTimeType = ("Second-" DAVTimeOutVal | "Infinite" | Other)DAVTimeOutVal = 1*digitOther = "Extend" field-value
• 클라이언트가�필요한�잠금�타임아웃�기술
19-3�변경의�유실문제
잠금�지원• 리소스�소유자만�쓸�수�있게�배타적�쓰기�잠금�
• 여러�사람으로�이루어져�있는�그룹이�하나의�문서를�작업�할�수�있는�공유된�쓰기�잠금�
• PROPFIND�메서드를�통해�지원할�잠금과�형식�결정�
• LOCK,�UNLOCK�
• 저자를�식별하기위해�다이제스트�인증�요구�
• 잠금이�승인되면�도메인�전체에서�유일한�토큰을�클라이언트에�반환�
• (RFC�2518�6.4�opaquelocktoken�Lock�Token�URI�Scheme)
Lock�메서드LOCK /ch-publish.fm HTTP/1.1Host: minstarContent-Type: text/xmlUser-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)Content-Length: 201
<?xml version="1.0"?><a:lockinfo xmlns:a="DAV:"> <a:lockscope><a:exclusive/></a:lockscope> <a:locktype><a:write/></a:locktype> <a:owner><a:href>AuthorA</a:href></a:owner></a:lockinfo>
HTTP/1.1 200 OKServer: Microsoft-IIS/5.0Date: Fri, 10 May 2002 20:56:18 GMTContent-Type: text/xmlContent-Length: 419
<?xml version="1.0"?><a:prop xmlns:a="DAV:"><a:lockdiscovery><a:activelock><a:locktype><a:write/></a:locktype><a:lockscope><a:exclusive/></a:lockscope><a:owner xmlns:a="DAV:"><a:href>AutherA</a:href></a:owner><a:locktoken><a:href>opaquelocktoken:*****</a:href></a:locktoken><a:depth>0</a:depth><a:timeout>Second-180</a:timeout></a:activelock></a:lockdiscovery></a:prop>
UNLock�메서드UNLOCK /ch-publish.fm HTTP/1.1Host: minstar.inktomi.comUser-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)Lock-Token:opaquelocktoken:*********
HTTP/1.1 204 OKServer: Microsoft-IIS/5.0Date: Fri, 10 May 2002 20:56:18 GMT
• 다이제스트�인증,�Lock-Token�맞아야�성공�
• 표�19-1�LOCK과�UNLOCK�메서드의�상태�코드
속성과�META�데이터
• 동적�수정되는�속성(Live�속성)�
• e.g.,�저작자,�수정�일시,�내용�등급…�
• 거의�변하지�않는�속성(Dead�속성)�
• e.g.,�Content-type�
• PROPFIND,�PROPPATCH로�HTTP를�확장해서�속성의�발견과�수정을함
PROPFIND�메서드PROPFIND /ch-publish.fm HTTP/1.1Host: minstar.inktomi.comUser-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)Depth: 0Cache-Control: no-cacheConnection: Keep-AliveContent-Length: 0
HTTP/1.1 207 Multi-StatusServer: Microsoft-IIS/5.0
<?xml version="1.0"?> <a:multistatusxmlns:b="urn:uuid:********/" xmlns:c="xml:" xmlns:a="DAV:"> <a:response> <a:href>http://minstar/ch-publish.fm </a:href> <a:propstat> <a:status>HTTP/1.1 200OK</a:status> <a:prop> <a:getcontentlength b:dt="int">1155</a:getcontentlength> ......................
<a:ishidden b:dt="boolean">0</a:ishidden> <a:iscollection b:dt="boolean">0</a:iscollection> </a:prop> </a:propstat> </a:response></a:multistatus>
• 모든�속성과�그�값을�요청�
• 선택된�속성과�그�값의�집합을�요청�
• 모든�속성의�이름을�요청�
• e.g.,�디렉터리의�목록,�그안의�모든�개별�엔터티의�속성까지�한큐�가능
PROPPATCH�메서드 <d:propertyupdate xmlns:d="DAV:" xmlns:o="http://name-space/scheme/"> <d:set> <d:prop> <o:owner>Author A</o:owner> </d:prop> </d:set> <d:remove> <d:prop> <o:owner/> </d:prop> </d:remove> </d:propertyupdate>
• atomic�
• 표�19-2�PROPFIND와�PROPPATCH�메서드에�대한�상태�코드�요약
콜렉션과�이름�공간
• 콜렉션은�리소스들의�논리�또는�물릭적�그룹�e.g.,�디렉토리�
• xml�이름공간�메커니즘�처럼�충돌�X,�명확한�구조적�제어�기능�
• DELETE,�MKCOL,�MOVE,�COPY,�PROPFIND�들이�사용
MKCOL�메서드MKCOL /publishing HTTP/1.1Host: minstarContent-Length: 0Connection: Keep-Alive
HTTP/1.1 201 CreatedServer: Microsoft-IIS/5.0Date: Fri, 10 May 2002 23:20:36 GMTLocation: http://minstar/publishing/Content-Length: 0
• PUT,�POST�대신�MKCOL메서드를�사용�
DELETE�메서드DELETE /publishing HTTP/1.1Host: minstar
HTTP/1.1 200 OKServer: Microsoft-IIS/5.0Date: Fri, 10 May 2002 23:20:36 GMTLocation: http://minstar/publishing/Content-Length: 0
or
HTTP/1.1 207 Multi-StatusServer: Microsoft-IIS/5.0Content-Location: http://minstar/publishing/..............<?xml version="1.0"?><a:multistatus xmlns:a="DAV:"><a:response><a:href>http://minstar/index3/ch-publish.fm</a:href><a:status> HTTP/1.1 423 Locked </a:status></a:response></a:multistatus>
• Depth�헤더�없으면�무한�infiniy�
COPY/MOVE�메서드{COPY,MOVE} /publishing HTTP/1.1Destination: http://minstar/pub-newDepth: infinityOverwrite: THost: minstar
HTTP/1.1 201 CreatedServer: Microsoft-IIS/5.0Date: Wed, 15 May 2002 18:29:53 GMTLocation: http://minstar.inktomi.com/pub-new/Content-Type: text/xmlContent-Length: 0
• Destination�헤더�
• Depth가�0이면�해당�리소스만�
• Depth�infinity는�MOVE만�가능�
• Overwirte가�T이고�해당�Destination이�있으면�DELETE�후에�해당�메서드�실행�
• Overwrite가�F이고�해당�Destination이�있으면�무조건�실패�
• 해당�리소스를�복제하면�속성도�복제됨�
• 복제시�추가로�속성을�같이�기술�가능�
• 표�19-3�MKCOL,�DELETE,�COPY,�MOVE�메서드에�대한�상태코드�
향상된�HTTP/1.1�메서드•WebDAV는�원래�HTTP의�DELETE,�PUT,�OPTIONS�의미를�수정함�
• GET,�POST,�HEAD는�그대로�
• PUT�
• if�헤더를�같이�기술해서�잠금�토큰을�맞춘후�컨텐츠를�사이트에�전송�
• OPTIONS�
• 응답에�지원�클래스�헤더가�있다�
• class�1:�RFC�2518의�모든�MUST�요구�사항�지원�
• class�2:�class�1�+�LOCK관련�스펙�지원
버전관리
• 초반�RFC에�없음�
• RFC�3253에�추가됨
끝