| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package main | 5 package main |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "encoding/base64" | 8 "encoding/base64" |
| 9 "errors" | 9 "errors" |
| 10 "fmt" | 10 "fmt" |
| 11 "log" | 11 "log" |
| 12 "net/url" | 12 "net/url" |
| 13 "sync" | 13 "sync" |
| 14 | 14 |
| 15 "mojo/public/go/application" | 15 "mojo/public/go/application" |
| 16 "mojo/public/go/bindings" | 16 "mojo/public/go/bindings" |
| 17 "mojo/public/go/system" | 17 "mojo/public/go/system" |
| 18 "mojo/public/interfaces/network/url_request" | 18 "mojo/public/interfaces/network/url_request" |
| 19 auth "mojo/services/authentication/interfaces/authentication" | 19 auth "mojo/services/authentication/interfaces/authentication" |
| 20 network "mojo/services/network/interfaces/network_service" | 20 network "mojo/services/network/interfaces/network_service" |
| 21 "mojo/services/network/interfaces/url_loader" | 21 "mojo/services/network/interfaces/url_loader" |
| 22 vpkg "mojo/services/vanadium/security/interfaces/principal" | 22 vpkg "mojo/services/vanadium/security/interfaces/principal" |
| 23 ) | 23 ) |
| 24 | 24 |
| 25 //#include "mojo/public/c/system/types.h" | 25 //#include "mojo/public/c/system/handle.h" |
| 26 //#include "mojo/public/c/system/result.h" |
| 26 import "C" | 27 import "C" |
| 27 | 28 |
| 28 const blesserURL = "https://dev.v.io/auth/google/bless" | 29 const blesserURL = "https://dev.v.io/auth/google/bless" |
| 29 | 30 |
| 30 type principalServiceImpl struct { | 31 type principalServiceImpl struct { |
| 31 app vpkg.AppInstanceName | 32 app vpkg.AppInstanceName |
| 32 psd *principalServiceDelegate | 33 psd *principalServiceDelegate |
| 33 } | 34 } |
| 34 | 35 |
| 35 func (pImpl *principalServiceImpl) Login() (*vpkg.User, error) { | 36 func (pImpl *principalServiceImpl) Login() (*vpkg.User, error) { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 } | 228 } |
| 228 | 229 |
| 229 //export MojoMain | 230 //export MojoMain |
| 230 func MojoMain(handle C.MojoHandle) C.MojoResult { | 231 func MojoMain(handle C.MojoHandle) C.MojoResult { |
| 231 application.Run(&principalServiceDelegate{}, system.MojoHandle(handle)) | 232 application.Run(&principalServiceDelegate{}, system.MojoHandle(handle)) |
| 232 return C.MOJO_RESULT_OK | 233 return C.MOJO_RESULT_OK |
| 233 } | 234 } |
| 234 | 235 |
| 235 func main() { | 236 func main() { |
| 236 } | 237 } |
| OLD | NEW |