GS2-Deploy/CDK Reference of GS2-Identifier

Entities

User

GS2-Identifier User

This entity represents the game developer who has access to the project.

The user has credentials for programmatic access and A password can be registered that allows the user to log into the Management Console and manage the project based on the user’s permissions.

TypeRequireDefaultLimitationDescription
namestring~ 128 charsusername
descriptionstring~ 1024 charsdescription of Namespace

GetAttr

TypeDescription
ItemUserCreated User

Implementation Example

Type: GS2::Identifier::User
Properties:
  Name: user-0001
  Description: null
from gs2_cdk import Stack, core, identifier

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        identifier.User(
            stack=self,
            name='user-0001',
        )

print(SampleStack().yaml())  # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        new \Gs2Cdk\Identifier\Model\User(
            stack: $this,
            name: "user-0001",
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
    public SampleStack() {
        super();
        new io.gs2.cdk.identifier.model.User(
            this,
            "user-0001"
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
import core from "@/gs2cdk/core";
import identifier from "@/gs2cdk/identifier";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new identifier.model.User(
            this,
            "user-0001"
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Identifier.Model.User(
            this,
            "user-0001"
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template

SecurityPolicy

Security Policy

Define restrictions on the types of APIs that users can use and the resources they can access. Access restriction rules are defined using JSON format definition data called policy documents. For the specifications of policy documents, please refer to the explanation page on policy documents in the development documents.

TypeRequireDefaultLimitationDescription
namestring~ 128 charsSecurity Policy Name
descriptionstring~ 1024 charsdescription of Namespace
policystring~ 5242880 charsPolicy Document

GetAttr

TypeDescription
ItemSecurityPolicyCreated security policy

Implementation Example

Type: GS2::Identifier::SecurityPolicy
Properties:
  Name: policy-0001
  Description: null
  Policy: {}
from gs2_cdk import Stack, core, identifier

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        identifier.SecurityPolicy(
            stack=self,
            name='policy-0001',
            policy='{}',
        )

print(SampleStack().yaml())  # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        new \Gs2Cdk\Identifier\Model\SecurityPolicy(
            stack: $this,
            name: "policy-0001",
            policy: "{}",
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
    public SampleStack() {
        super();
        new io.gs2.cdk.identifier.model.SecurityPolicy(
            this,
            "policy-0001",
            "{}"
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
import core from "@/gs2cdk/core";
import identifier from "@/gs2cdk/identifier";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new identifier.model.SecurityPolicy(
            this,
            "policy-0001",
            "{}"
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Identifier.Model.SecurityPolicy(
            this,
            "policy-0001",
            "{}"
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template

Identifier

Credential

An API key is required to access GS2’s API. A credential consists of a client ID and a client secret, and access using the credential is restricted based on the privileges of the user who owns the credential.

TypeRequireDefaultLimitationDescription
userNamestring~ 128 charsusername

GetAttr

TypeDescription
ItemIdentifierCredentials created
ClientSecretstringClient Secret

Implementation Example

Type: GS2::Identifier::Identifier
Properties:
  UserName: user-0001
from gs2_cdk import Stack, core, identifier

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        identifier.Identifier(
            stack=self,
            user_name='user-0001',
        )

print(SampleStack().yaml())  # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        new \Gs2Cdk\Identifier\Model\Identifier(
            stack: $this,
            userName: "user-0001",
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
    public SampleStack() {
        super();
        new io.gs2.cdk.identifier.model.Identifier(
            this,
            "user-0001"
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
import core from "@/gs2cdk/core";
import identifier from "@/gs2cdk/identifier";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new identifier.model.Identifier(
            this,
            "user-0001"
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Identifier.Model.Identifier(
            this,
            "user-0001"
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template

Password

Password

Password for logging into the Management Console based on user permissions. A password allows different accounts to log in to a single project and still limit the information they have access to.

TypeRequireDefaultLimitationDescription
userNamestring~ 128 charsusername
passwordstring~ 1024 charsPassword

GetAttr

TypeDescription
ItemPasswordPassword created

Implementation Example

Type: GS2::Identifier::Password
Properties:
  UserName: user-0001
  Password: password-0001
from gs2_cdk import Stack, core, identifier

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        identifier.Password(
            stack=self,
            user_name='user-0001',
            password='password-0001',
        )

print(SampleStack().yaml())  # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        new \Gs2Cdk\Identifier\Model\Password(
            stack: $this,
            userName: "user-0001",
            password: "password-0001",
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
    public SampleStack() {
        super();
        new io.gs2.cdk.identifier.model.Password(
            this,
            "user-0001",
            "password-0001"
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
import core from "@/gs2cdk/core";
import identifier from "@/gs2cdk/identifier";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new identifier.model.Password(
            this,
            "user-0001",
            "password-0001"
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Identifier.Model.Password(
            this,
            "user-0001",
            "password-0001"
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template

AttachSecurityPolicy

TypeRequireDefaultLimitationDescription
userNamestring~ 128 charsusername
securityPolicyIdstring~ 1024 charsGRN of security policy to be assigned

GetAttr

TypeDescription
ItemsSecurityPolicy[]List of security policies newly assigned to users

Implementation Example

Type: GS2::Identifier::AttachSecurityPolicy
Properties:
  UserName: user-0001
  SecurityPolicyId: $securityPolicy1.securityPolicyId
from gs2_cdk import Stack, core, identifier

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        identifier.AttachSecurityPolicy(
            stack=self,
            user_name='user-0001',
            security_policy_id=self.security_policy1.security_policy_id,
        )

print(SampleStack().yaml())  # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        new \Gs2Cdk\Identifier\Model\AttachSecurityPolicy(
            stack: $this,
            userName: "user-0001",
            securityPolicyId: self::$securityPolicy1.securityPolicyId,
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
    public SampleStack() {
        super();
        new io.gs2.cdk.identifier.model.AttachSecurityPolicy(
            this,
            "user-0001",
            "$securityPolicy1.securityPolicyId"
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
import core from "@/gs2cdk/core";
import identifier from "@/gs2cdk/identifier";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new identifier.model.AttachSecurityPolicy(
            this,
            "user-0001",
            "$securityPolicy1.securityPolicyId"
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Identifier.Model.AttachSecurityPolicy(
            this,
            "user-0001",
            "$securityPolicy1.securityPolicyId"
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template

ProjectToken

TypeRequireDefaultLimitationDescription
tokenstring~ 1024 charsProject Token