1// Copyright 2016-2020 The Libsacloud Authors 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package sacloud 16 17// AuthStatus 現在の認証状態 18type AuthStatus struct { 19 Account *Account // アカウント 20 Member *Member // 会員情報 21 AuthClass EAuthClass `json:",omitempty"` // 認証クラス 22 AuthMethod EAuthMethod `json:",omitempty"` // 認証方法 23 ExternalPermission string `json:",omitempty"` // 他サービスへのアクセス権 24 IsAPIKey bool `json:",omitempty"` // APIキーでのアクセスフラグ 25 OperationPenalty string `json:",omitempty"` // オペレーションペナルティ 26 Permission EPermission `json:",omitempty"` // 権限 27 IsOk bool `json:"is_ok,omitempty"` // 結果 28 29 // RESTFilter [unknown type] `json:",omitempty"` 30 // User [unknown type] `json:",omitempty"` 31 32} 33 34// -------------------------------------------------------- 35 36// EAuthClass 認証種別 37type EAuthClass string 38 39var ( 40 // EAuthClassAccount アカウント認証 41 EAuthClassAccount = EAuthClass("account") 42) 43 44// -------------------------------------------------------- 45 46// EAuthMethod 認証方法 47type EAuthMethod string 48 49var ( 50 // EAuthMethodAPIKey APIキー認証 51 EAuthMethodAPIKey = EAuthMethod("apikey") 52) 53 54// -------------------------------------------------------- 55 56// EExternalPermission 他サービスへのアクセス権 57type EExternalPermission string 58 59var ( 60 // EExternalPermissionBill 請求情報 61 EExternalPermissionBill = EExternalPermission("bill") 62 // EExternalPermissionCDN ウェブアクセラレータ 63 EExternalPermissionCDN = EExternalPermission("cdn") 64) 65 66// -------------------------------------------------------- 67 68// EOperationPenalty ペナルティ 69type EOperationPenalty string 70 71var ( 72 // EOperationPenaltyNone ペナルティなし 73 EOperationPenaltyNone = EOperationPenalty("none") 74) 75 76// -------------------------------------------------------- 77 78// EPermission アクセスレベル 79type EPermission string 80 81var ( 82 // EPermissionCreate 作成・削除権限 83 EPermissionCreate = EPermission("create") 84 85 // EPermissionArrange 設定変更権限 86 EPermissionArrange = EPermission("arrange") 87 88 // EPermissionPower 電源操作権限 89 EPermissionPower = EPermission("power") 90 91 // EPermissionView リソース閲覧権限 92 EPermissionView = EPermission("view") 93) 94