기본 콘텐츠로 건너뛰기

8월, 2013의 게시물 표시

node.js 를 위한 vim 환경 설정.

tmux를 쓰다보니 vim 환경 설정 셋을 문득 만들어 보고 싶었다. 1. 일단 vim 먼저 받고 sudo apt-get install vim 2. manage your runtimepath 관리용 pathgen 설치 mkdir -p ~/.vim/autoload ~/.vim/bundle; \ curl -Sso ~/.vim/autoload/pathogen.vim \     https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim 3. ~/.vimrc 없을테니 아래와 같이 생성. tab/indent 간격은 2에 탭 대신 space로 쓰기 위해 expandtab 추가 execute pathogen#infect() syntax on filetype plugin indent on set tabstop=2 set shiftwidth=2 set softtabstop=2 set expandtab 4. 아무 js 나 vim 으로 열어서 color 적용여부 확인 5. sensible plugin 설치 git clone git://github.com/tpope/vim-sensible.git ~/.vim/bundle/vim-sensible 6. node bundle 설치 git clone https://github.com/moll/vim-node.git ~/.vim/bundle/node 7. coffeescript bundle 설치 git clone https://github.com/kchmck/vim-coffee-script.git ~/.vim/bundle/vim-coffee-script/ 8. zen code 보다 더 좋은 Emmet 설치 - ctrl+y+, 로 활성화 git clone http://github.com/mattn/emmet-vim.git ~/.vim/bundle/emmet-vim 9. less 도 활성화 git clon

Meteor 에서 외부 Application으로 DDP 인증 (2) : SRP 교환

DDP로 인증을 하려면 네트웍상에 평문으로 보내지 않기 위해 SRP(Secure Remote Password) 라는 프로토콜로 변환한다. https://github.com/meteor/meteor/tree/devel/packages/srp package.js 를 보면 biginteger 와 sha256 을 사용한다. 구현해야할 부분은  https://github.com/meteor/meteor/blob/devel/packages/accounts-password/password_client.js#L10 이 곳 참조. password 를 가지고 다음과 같이.     s = new srp.Client password     request = s.startExchange()     if typeof selector == 'string'       selector =         if ~selector.indexof("@")         then username: selector         else email: selector     request.user = selector beginPasswordExchange 를 시작하는 부분의 인자는 request 자체를 사용. request 내용은 A를 키로 하는 SRP 암호문과 user를 키로하는 사용자명이 되겠다. method 쏴준다. A에 srp로 암호화한 문자를 사용. { msg: 'method',   method: 'beginPasswordExchange',   params:    [ { A: '439284960ce6bc7c163262b5629a467cd06bb982432615ec526a1ed204d2f76a1a254faaab6c5c9309e120d708e3e46fe58d8c5017aedb85efb9670cfcbf8a8b2dd996a6226f7be032bfedc23b1261093c0374e3

Meteor 에서 외부 Application으로 DDP 인증.

http://stackoverflow.com/questions/16729992/authenticating-with-meteor-via-ddp-and-srp Basic Auth로 websocket frame을 떠봤더니 o 1 오전 1:47:09 a["{\"server_id\":\"X43fG44wD7iJNCdoq\"}"] 42 오전 1:47:09 ["{\"msg\":\"connect\",\"version\":\"pre1\",\"support\":[\"pre1\"]}"] 69 오전 1:47:09 ["{\"msg\":\"sub\",\"id\":\"8jW8AaNcWf2iRhXWC\",\"name\":\"meteor.loginServiceConfiguration\",\"params\":[]}"] 110 오전 1:47:09 a["{\"msg\":\"connected\",\"session\":\"ZddaS7aatWT4i8nAR\"}"] 62 오전 1:47:09 a["{\"msg\":\"added\",\"collection\":\"users\",\"id\":\"aHC7AHZXbnhs7Efs9\",\"fields\":{\"username\":\"mone\",\"profile\":{\"photoSmall\"