Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
整合 open.360.cn
的一些业务 Ruby
封装。
在你项目的 Gemfile
文件添加下行内容:
gem 'qihu360'
保存后执行:
$ bundle
或者直接执行下行命令安装:
$ gem install qihu360
require 'qihu'
# 处理 oauth2
auth = Qihu::Auth.new(id:'xxx', secret:'yyy')
# 默认 redirect_uri 是 oob
auth_url = auth.authorize_url()
# 设置回调网址和验证界面模式
auth_url = auth.authorize_url(redirect_uri:'http://icyleaf.com', display:'desktop')
# 获取的 access token
token = auth.get_token('code')
auth = Qihu::Auth.new(id:'xxx', secret:'yyy', token:{
:access_token => 'zzz', :refresh_token => 'qqq', :expires_at => 36000
})
// 或者这样传递 access token
auth.get_token_from_hash(:access_token => 'zzz', :refresh_token => 'qqq', :expires_at => 36000)
# 处理 oauth2
auth = Qihu::Auth.new(id:'xxx', secret:'yyy')
# 默认 redirect_uri 是 oob
code = auth.get_code_from_account('username', 'password')
# 获取的 access token
token = auth.get_token(code)
# 或者直接一步到位
token = auth.get_token_from_account('username', 'password')
auth = Qihu::Auth.new('xxx', 'yyy', token:{
:access_token => 'mmmm',
:refresh_token => 'nnnnn',
:expires_at => 1380050254,
:expires_in => 36000
})
# 刷新 access token 并返回自身
auth = auth.refresh_token
# 初始化必须传入获得 access token 的 Qihu::Auth 实例
client = Qihu::DianJing::Client(auth)
# 请求 account 的账户信息,默认返回 json 格式
response = client.account.getInfo
# 除了驼峰调用模式,下划线同样适用
response = client.account.get_info
# 创建一个计划
response = client.campign.add(name:'Beijing', budget:10000)
# 更改提交的方法
begin
response = client.campign.add(name:'Beijing', bugget:20000, method:'get')
resure Qihu::FailuresError => e
# 捕获 API 接口返回的异常
puts e.message
end
# 获得返回信息
status = response.status
headers = response.headers
body = response.body
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that qihu360 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.