Whois lookup response gives error when calling its properties method - whois-ruby

Using this gem: whois (3.6.5)
Doing this:
Whois::Client.new(timeout: 2).lookup('miaz.ca')
And then trying to call .properties on the result of the call (pasted below)
"Domain name: miaz.ca\nDomain status: registered\nCreation date: 2014/03/12\nExpiry date:
2018/03/12\nUpdated date: 2017/03/02\nDNSSEC:
Unsigned\n\nRegistrar:\n Name: Go Daddy Domains
Canada, Inc\n Number: 2316042\n\nName servers:\n
ns61.domaincontrol.com\n ns62.domaincontrol.com\n\n% WHOIS look-up
made at 2017-08-15 20:13:15 (GMT)\n%\n% Use of CIRA's WHOIS service is
governed by the Terms of Use in its Legal\n% Notice, available at
http://www.cira.ca/legal-notice/?lang=en \n%\n% (c) 2017 Canadian
Internet Registration Authority, (http://www.cira.ca/) \n"
But then calling Whois::Client.new(timeout: 2).lookup('childrenandco.qa')
gives this response and .properties gives a undefined method 'zip' for "shops.myshopify.com":String:
"Domain Name: childrenandco.qa\r\nLast Modified: 15-Aug-2017 14:06:49 UTC\r\nRegistrar
Name: W3INFOTECH W.L.L\r\nStatus:
inactive\r\n\r\nRegistrant Contact ID: W3R2736\r\nRegistrant
Contact Name: Ibrahim alobaidan\r\nRegistrant Contact Email:
Visit www.domains.qa\r\n\r\nTech Contact ID:
W3T2736\r\nTech Contact Name: Ibrahim alobaidan\r\nTech
Contact Email: Visit www.domains.qa\r\n\r\nName Server:
shops.myshopify.com\r\n"

Related

AWS HTTP API Integration with AWS Step Functions -> Sending Multiple Values in the Input

I have a Type: AWS::Serverless::HttpApi which I am trying to connect to a Type: AWS::Serverless::StateMachine as a trigger. Meaning the HTTP API would trigger the Step Function state machine.
I can get it working, by only specifying a single input. For example, the DefinitionBody when it works, looks like this:
DefinitionBody:
info:
version: '1.0'
title:
Ref: AWS::StackName
paths:
"/github/secret":
post:
responses:
default:
description: "Default response for POST /"
x-amazon-apigateway-integration:
integrationSubtype: "StepFunctions-StartExecution"
credentials:
Fn::GetAtt: [StepFunctionsApiRole, Arn]
requestParameters:
Input: $request.body
StateMachineArn: !Ref SecretScannerStateMachine
payloadFormatVersion: "1.0"
type: "aws_proxy"
connectionType: "INTERNET"
timeoutInMillis: 30000
openapi: 3.0.1
x-amazon-apigateway-importexport-version: "1.0"
Take note of the following line: Input: $request.body. I am only specifying the $request.body.
However, I need to be able to send the $request.body and $request.header.X-Hub-Signature-256. I need to send BOTH these values to my state machine as an input.
I have tried so many different ways. For example:
Input: " { body: $request.body, header: $request.header.X-Hub-Signature-256 }"
and
$request.body
$request.header.X-Hub-Signature-256
and
Input: $request
I get different errors each time, but this is the main one:
Warnings found during import: Unable to create integration for resource at path 'POST /github/secret': Invalid selection expression specified: Validation Result: warnings : [], errors : [Invalid source: $request specified for destination: Input].
Any help on how to pass multiple values would so be appreciated.

How to implement an empty path in YAML file

I am trying to implement the below calls:
POST https://host/sessions
DELETE https://host/sessions/{session_id}
The POST call is to establish a session, the DELETE call is to log out an established session.
So, in the YAML file, how to have an empty base path? It's currently a slash in the YAML file as it's a required filed, but the slash is redundant. Any idea? Thanks.
swagger: '2.0'
info:
version: '0.0.1'
title: authenticate
#description: To be provided
# #termsOfService:To be provided
contact:
name: test
basePath: /sessions
paths:
/:
post:
summary: eatablish a session
description: sessions is a collection.This POST creates a new session in the sessions collection and the name of the session returned by this command is the session token.
consumes:
- "application/json"
parameters:
- in: header
name: user_name
type: string
required: true
- in: header
name: password
type: string
required: true
responses:
200:
description: establish a session successfully
400:
$ref: "#/responses/BadRequest"
500:
description: unexpected error
schema:
$ref: '#/definitions/errorModel'
/{session_id}:
delete:
summary: log out
description: use sessionid to log out an established session.
produces:
- application/json
parameters:
- in: path
name: session_id
type: string
required: true
responses:
200:
description: log out a session successfully
400:
$ref: "#/responses/BadRequest"
500:
description: unexpected error
schema:
$ref: '#/definitions/errorModel'
Swagger defines
A relative path to an individual endpoint. The field name MUST begin with a forward slash (/).
Therefore, the slash is required and you can't have an empty path.

serverless-appsync-plugin 'pipeline' deployment error

I am using serverless to deploy an Appsync API using 'PIPELINE', for use as an API lambda-functions. This plugin https://github.com/sid88in/serverless-appsync-plugin is used to deploy Appsync with the ability to use 'pipeline'. I used the description from the documentation however when I try to do deploy it in myself I have an error:
Error: The CloudFormation template is invalid: Template error: instance of Fn::GetAtt references undefined resource GraphQlDsmeInfo
functions:
graphlql:
handler: handler.meInfo
name: meInfo
custom:
accountId: testId
appSync:
name: test-AppSync
authenticationType: API_KEY
mappingTemplates:
- type: Query
field: meInfo
request: 'meInfo-request-mapping-template.vtl'
response: 'meInfo-response-mapping-template.vtl'
kind: PIPELINE
functions:
- meInfo
functionConfigurations:
- dataSource: meInfo
name: 'meInfo'
request: 'meInfo-request-mapping-template.vtl'
response: 'meInfo-response-mapping-template.vtl'
Could somebody help me to configure 'serverless-appsync-plugin ' with pipeline kind?
You need to specify the data source used in your function.
It seems you've deployed the handler as Lambda function. If not, first you should have a separate serverless.yml config for your Lambda and deploy it. Then you need to attach this Lambda as AppSync data source, so your AppSync config would look like this:
custom:
accountId: testId
appSync:
name: test-AppSync
authenticationType: API_KEY
dataSources:
- type: AWS_LAMBDA
name: Lambda_Name
description: 'Lambda Description'
config:
lambdaFunctionArn: 'arn:aws:lambda:xxxx'
serviceRoleArn: 'arn:aws:iam::xxxx'
mappingTemplates:
- type: Query
field: meInfo
request: 'meInfo-request-mapping-template.vtl'
response: 'meInfo-response-mapping-template.vtl'
kind: PIPELINE
functions:
- meInfo
functionConfigurations:
- dataSource: Lambda_Name
name: 'meInfo'
request: 'meInfo-request-mapping-template.vtl'
response: 'meInfo-response-mapping-template.vtl'
There is an article which describes the process in details that might be useful: https://medium.com/hackernoon/running-a-scalable-reliable-graphql-endpoint-with-serverless-24c3bb5acb43

How to fix Circular dependency between resources on a logical ID

I trying to automate building process of my serverless application. When I set up CognitoUserPool resources I need the resources Ref CognitoUserPoolClient to create a link to redirect the client in "EmailMessage"
But the CognitoUserPoolClient need Ref CognitoUserPool
CognitoUserPool:
Type: AWS::Cognito::UserPool
Properties:
# Generate a name based on the stage
UserPoolName: ${self:custom.STAGE}-${self:custom.CLIENT}-user-pool
EmailMessage: !Join
- ''
- - >
You are invited to the SonderMMS platform, the world's first owned media management software. <br>
Username: {username} <br>
Password: {####} <br>
Login
<a href='
https://${self:custom.COGNITO_DOMAIN}.auth.${self:custom.REGION}.amazoncognito.com/oauth2/authorize?&response_type=token&redirect_uri=${self:custom.URL.${self:custom.STAGE}}&client_id=
- !Sub '#{CognitoUserPoolClient}'
- >
'> here </a>.
EmailSubject: "Email Invite"
CognitoUserPoolClient:
Type: AWS::Cognito::UserPoolClient
Properties:
# Generate an app client name based on the stage
ClientName: ${self:custom.STAGE}-${self:custom.CLIENT}-user-pool-client
UserPoolId: !Ref CognitoUserPool
ExplicitAuthFlows:
- ADMIN_NO_SRP_AUTH
GenerateSecret: false
So i get this error
The CloudFormation template is invalid: Circular dependency between resources: [CognitoUserPoolClient, ApiGatewayAuthorizer, IdentityPool, SSMCognitoUserPoolClientId, IdentityPoolRoleMapping, SSMUserPoolId, ApiGatewayMethodTelstraPost, CognitoUserPool, SSMIdentityPoolId, ApiGatewayDeployment1559121507544, CognitoUnAuthorizedRole]

Apiary Error when invoking API

I get the following error on ApiaryWe are sorry, but the API call failed.
My host is defined as
FORMAT: 1A
HOST: https://test.mynetwork.com/
GET CALL IS DEFINED AS
data urn [models/v2/files/{urn}/data{?guid}]
GET [GET]
Parameters
urn (required, string, ttt)...design urn.
guid (optional, string,067e6162-3b6f-4ae2-a171-2470b63dfe02)...filter by guid.
Response 200 (application/vnd.api+json)
Body
data
{
"version": "1.0",
}
When i invoke this , i get error . Any inputs
I have edited your API Blueprint as follows:
FORMAT: 1A
HOST: https://test.mynetwork.com
# Test API
This is a test API
## data urn [/models/v2/files/{urn}/data{?guid}]
+ Parameters
+ urn: `ttt` (required, string) - design urn
+ guid: `067e6162-3b6f-4ae2-a171-2470b63dfe02` (optional, string) - filter by guid
### test [GET]
+ Response 200 (application/vnd.api+json)
{
"version": "1.0"
}
You can find tutorials here: https://help.apiary.io/
Also not sure what you mean "invoke" the API - are you calling the mock server or are you hitting your own server through Apiary.
Happy to help further via the support option in Apiary itself or email us on support [at] apiary.io.