Padloc Logo Docs & Resources

Interface: UnlockedOrg

org.UnlockedOrg

Hierarchy

  • Org

    UnlockedOrg

Properties

_key

Protected Optional _key: Uint8Array

The key used for encryption. Sub classes must set this property in the unlock method.

Inherited from

Org._key

Defined in

core/src/container.ts:33


_propertySerializationOptions

_propertySerializationOptions: SerializationOptions[]

Inherited from

Org._propertySerializationOptions

Defined in

core/src/encoding.ts:163


accessors

accessors: Accessor[] = []

The ids and encrypted keys of all accessors

Inherited from

Org.accessors

Defined in

core/src/container.ts:159


created

created: Date

Creation date

Inherited from

Org.created

Defined in

core/src/org.ts:240


directory

directory: OrgDirectorySettings

Inherited from

Org.directory

Defined in

core/src/org.ts:302


encryptedData

Optional encryptedData: Uint8Array

Encrypted data

Inherited from

Org.encryptedData

Defined in

core/src/container.ts:28


encryptionParams

encryptionParams: AESEncryptionParams

Parameters used for encryption of content data

Inherited from

Org.encryptionParams

Defined in

core/src/container.ts:24


groups

groups: Group[] = []

This organizations Groups.

Inherited from

Org.groups

Defined in

core/src/org.ts:292


id

id: string = ""

Unique identier

Inherited from

Org.id

Defined in

core/src/org.ts:233


invites

invites: Invite[] = []

Pending Invites

Inherited from

Org.invites

Defined in

core/src/org.ts:299


invitesKey

invitesKey: Uint8Array

AES key used as encryption key for Invites

Overrides

Org.invitesKey

Defined in

core/src/org.ts:724


keyParams

keyParams: RSAEncryptionParams

Parameters used to wrap the shared encryption key

Inherited from

Org.keyParams

Defined in

core/src/container.ts:155


members

members: OrgMember[] = []

Array of organization members

Inherited from

Org.members

Defined in

core/src/org.ts:288


minMemberUpdated

minMemberUpdated: Date

Minimum accepted update time for organization members. Any members with a OrgMember.updated value lower than this should be considered invalid.

In order to prevent an attacker from rolling back this value, all clients should verify that updated organization object always have a Org.minMemberUpdated value equal to or higher than the previous one.

Inherited from

Org.minMemberUpdated

Defined in

core/src/org.ts:280


name

name: string = ""

Organization name

Inherited from

Org.name

Defined in

core/src/org.ts:236


privateKey

privateKey: Uint8Array

Private key used for signing member details

Overrides

Org.privateKey

Defined in

core/src/org.ts:723


publicKey

Optional publicKey: Uint8Array

Public key used for verifying member signatures

Inherited from

Org.publicKey

Defined in

core/src/org.ts:248


revision

revision: string = ""

Revision id used for ensuring continuity when synchronizing the account object between client and server

Inherited from

Org.revision

Defined in

core/src/org.ts:308


signingParams

signingParams: RSASigningParams

Parameters for creating member signatures

Inherited from

Org.signingParams

Defined in

core/src/org.ts:284


updated

updated: Date

Last updated

Inherited from

Org.updated

Defined in

core/src/org.ts:244


vaults

vaults: { id: string ; name: string ; revision?: string }[] = []

Shared Vaults owned by this organization

Inherited from

Org.vaults

Defined in

core/src/org.ts:295

Accessors

info

get info(): OrgInfo

Returns

OrgInfo

Inherited from

Org.info

Defined in

core/src/org.ts:315


kind

get kind(): string

A string representing the objects "type", useful for segmenting storage, among other things. Defaults to the lowercase class name, but can be overwritten by subclasses

Returns

string

Inherited from

Org.kind

Defined in

core/src/encoding.ts:159


owner

get owner(): undefined | OrgMember

Account which created this organization

Returns

undefined | OrgMember

Inherited from

Org.owner

Defined in

core/src/org.ts:311

Methods

_fromRaw

Protected _fromRaw(raw): void

Restore values from a raw object. The default implementation simply copies over all iterable properties from the base object. Overwrite this method for properties that require special treatment

Parameters

Name Type
raw any

Returns

void

Inherited from

Org._fromRaw

Defined in

core/src/encoding.ts:286


_toRaw

Protected _toRaw(version): any

Transform this object into a raw javascript object used for serialization. The default implementation simply copies all iterable properties not included in the [[exlude]] array and calls toRaw on any properties that are themselfes instances of Serializable. This method should be overwritten by subclasses if certain properties require special treatment.

Parameters

Name Type
version undefined | string

Returns

any

Inherited from

Org._toRaw

Defined in

core/src/encoding.ts:257


addOrUpdateMember

addOrUpdateMember(__namedParameters): Promise<void>

Adds a member to the organization, or updates the existing member with the same id.

Parameters

Name Type
__namedParameters Object
__namedParameters.accountId? string
__namedParameters.email string
__namedParameters.name string
__namedParameters.orgSignature? Uint8Array
__namedParameters.publicKey? Uint8Array
__namedParameters.role? OrgRole
__namedParameters.status? OrgMemberStatus

Returns

Promise<void>

Inherited from

Org.addOrUpdateMember

Defined in

core/src/org.ts:616


canRead

canRead(vault, account): undefined | boolean

Check whether the given account has read access to a vault

Parameters

Name Type
vault Object
vault.id string
account Object
account.email string

Returns

undefined | boolean

Inherited from

Org.canRead

Defined in

core/src/org.ts:426


canWrite

canWrite(vault, acc): undefined | boolean

Check whether the given account has write access to a vault

Parameters

Name Type
vault Object
vault.id string
acc Object
acc.email string

Returns

undefined | boolean

Inherited from

Org.canWrite

Defined in

core/src/org.ts:436


clone

clone(): UnlockedOrg

Creates a deep clone of the object

Returns

UnlockedOrg

Inherited from

Org.clone

Defined in

core/src/container.ts:85


fromBytes

fromBytes(bytes): UnlockedOrg

Deserializes the object from a byte array

Parameters

Name Type
bytes Uint8Array

Returns

UnlockedOrg

Inherited from

Org.fromBytes

Defined in

core/src/encoding.ts:237


fromJSON

fromJSON(json): UnlockedOrg

Deserializes the object from a JSON string

Parameters

Name Type
json string

Returns

UnlockedOrg

Inherited from

Org.fromJSON

Defined in

core/src/encoding.ts:223


fromRaw

fromRaw(raw): UnlockedOrg

Restores propertiers from a raw object of the same form generated by toRaw. The base implementation blindly copies over values from the raw object via Object.assign so subclasses should explictly process any propertyies that need special treatment.

Also takes are of validation and "upgrading" in case the raw object has an old version. Use the protected _fromRaw method to implement subclass-specific behavior.

Parameters

Name Type
raw any

Returns

UnlockedOrg

Inherited from

Org.fromRaw

Defined in

core/src/encoding.ts:196


generateKeys

generateKeys(): Promise<void>

Generates a new publicKey, privateKey and invitesKey and encrypts the latter two

Returns

Promise<void>

Inherited from

Org.generateKeys

Defined in

core/src/org.ts:496


getAccessors

getAccessors(vault): ActiveOrgMember[]

Get all membes that have acess to a given vault, either directly or through a Group

Parameters

Name Type
vault Vault

Returns

ActiveOrgMember[]

Inherited from

Org.getAccessors

Defined in

core/src/org.ts:391


getData

getData(): Promise<Uint8Array>

Decrypts and extracts the plain text data from the container. This will usually require unlocking the container first.

Returns

Promise<Uint8Array>

Inherited from

Org.getData

Defined in

core/src/container.ts:61


getGroup

getGroup(name): undefined | Group

Get group with the given name

Parameters

Name Type
name string

Returns

undefined | Group

Inherited from

Org.getGroup

Defined in

core/src/org.ts:355


getGroupsForMember

getGroupsForMember(__namedParameters): Group[]

Get all Groups the given Account is a member of

Parameters

Name Type
__namedParameters Object
__namedParameters.email string

Returns

Group[]

Inherited from

Org.getGroupsForMember

Defined in

core/src/org.ts:370


getGroupsForVault

getGroupsForVault(__namedParameters): Group[]

Get all groups assigned to a given Vault

Parameters

Name Type
__namedParameters Object
__namedParameters.id string

Returns

Group[]

Inherited from

Org.getGroupsForVault

Defined in

core/src/org.ts:375


getInvite

getInvite(id): undefined | Invite

Get the invite with the given id

Parameters

Name Type
id string

Returns

undefined | Invite

Inherited from

Org.getInvite

Defined in

core/src/org.ts:449


getMember

getMember(__namedParameters): undefined | OrgMember

Get the OrgMember object for this Account

Parameters

Name Type
__namedParameters { accountId?: string ; email: string } | { accountId: string ; email?: string }

Returns

undefined | OrgMember

Inherited from

Org.getMember

Defined in

core/src/org.ts:345


getMembersForGroup

getMembersForGroup(group): OrgMember[]

Get all members of a given group

Parameters

Name Type
group Group

Returns

OrgMember[]

Inherited from

Org.getMembersForGroup

Defined in

core/src/org.ts:360


getMembersForVault

getMembersForVault(__namedParameters): ActiveOrgMember[]

Get all members directly assigned to a given Vault

Parameters

Name Type
__namedParameters Object
__namedParameters.id string

Returns

ActiveOrgMember[]

Inherited from

Org.getMembersForVault

Defined in

core/src/org.ts:380


getVaultsForMember

getVaultsForMember(acc): { id: string ; name: string ; revision?: string }[]

Get all vaults the given member has access to

Parameters

Name Type
acc Object
acc.email string

Returns

{ id: string ; name: string ; revision?: string }[]

Inherited from

Org.getVaultsForMember

Defined in

core/src/org.ts:407


initialize

initialize(account): Promise<void>

Initializes the organization, generating publicKey, privateKey, and invitesKey and adding the given account as the organization owner.

Parameters

Name Type
account Account

Returns

Promise<void>

Inherited from

Org.initialize

Defined in

core/src/org.ts:463


isAdmin

isAdmin(m): boolean

Whether the given Account is an OrgRole.Admin

Parameters

Name Type
m Object
m.email string

Returns

boolean

Inherited from

Org.isAdmin

Defined in

core/src/org.ts:333


isMember

isMember(acc): boolean

Whether the given Account is an organization member

Parameters

Name Type
acc Object
acc.email string

Returns

boolean

Inherited from

Org.isMember

Defined in

core/src/org.ts:350


isOwner

isOwner(__namedParameters): boolean

Whether the given Account is an OrgRole.Owner

Parameters

Name Type
__namedParameters Object
__namedParameters.email string

Returns

boolean

Inherited from

Org.isOwner

Defined in

core/src/org.ts:328


isSuspended

isSuspended(m): boolean

Whether the given Account is currently suspended

Parameters

Name Type
m Object
m.email string

Returns

boolean

Inherited from

Org.isSuspended

Defined in

core/src/org.ts:339


lock

lock(): void

Locks the container, removing the possibility to extract the plain text data via getData until the container is unlocked again. Subclasses extending this class must take care to delete any keys or other sensitive data that may have been stored temporarily after unlocking the container.

Returns

void

Inherited from

Org.lock

Defined in

core/src/org.ts:537


makeOwner

makeOwner(member): Promise<void>

Transfers organization ownership to a different member

Parameters

Name Type
member Object
member.email string

Returns

Promise<void>

Inherited from

Org.makeOwner

Defined in

core/src/org.ts:685


removeInvite

removeInvite(__namedParameters): void

Remove an invite

Parameters

Name Type
__namedParameters Invite

Returns

void

Inherited from

Org.removeInvite

Defined in

core/src/org.ts:454


removeMember

removeMember(member, reSignMembers?): Promise<void>

Removes a member from the organization

Parameters

Name Type Default value
member Object undefined
member.email string undefined
reSignMembers boolean true

Returns

Promise<void>

Inherited from

Org.removeMember

Defined in

core/src/org.ts:655


rotateKeys

rotateKeys(force?): Promise<void>

Regenerates all cryptographic keys and updates all member signatures

Parameters

Name Type Default value
force boolean false

Returns

Promise<void>

Inherited from

Org.rotateKeys

Defined in

core/src/org.ts:507


setData

setData(data): Promise<void>

Encrypts the provided data and stores it in the container

Parameters

Name Type
data Uint8Array

Returns

Promise<void>

Inherited from

Org.setData

Defined in

core/src/container.ts:38


sign

sign(member): Promise<OrgMember>

Signs the members public key, id, role and email address so they can be verified later

Parameters

Name Type
member OrgMember

Returns

Promise<OrgMember>

Inherited from

Org.sign

Defined in

core/src/org.ts:547


toBytes

toBytes(): Uint8Array

Returns a serialization of the object in form of a byte array

Returns

Uint8Array

Inherited from

Org.toBytes

Defined in

core/src/encoding.ts:230


toJSON

toJSON(): string

Returns a JSON serialization of the object

Returns

string

Inherited from

Org.toJSON

Defined in

core/src/encoding.ts:216


toRaw

toRaw(version?): any

Creates a raw javascript object representation of the class, which can be used for storage or data transmission. Also handles "downgrading" to previous versions. Use _toRaw for subclass-specific behavior.

Parameters

Name Type
version? string

Returns

any

Inherited from

Org.toRaw

Defined in

core/src/encoding.ts:179


toString

toString(): string

Returns

string

Inherited from

Org.toString

Defined in

core/src/org.ts:717


unlock

unlock(account): Promise<void>

"Unlocks" the organization, granting access to the organizations privateKey and invitesKey properties.

Parameters

Name Type
account UnlockedAccount

Returns

Promise<void>

Inherited from

Org.unlock

Defined in

core/src/org.ts:529


updateAccessors

updateAccessors(subjects): Promise<void>

Updates the containers accessors, generating a new shared key and encrypting it with the public keys of the provided subjects. Non-empty containers need to be unlocked first.

Parameters

Name Type
subjects { id: string ; publicKey: Uint8Array }[]

Returns

Promise<void>

Inherited from

Org.updateAccessors

Defined in

core/src/container.ts:189


validate

validate(): boolean

This is called during deserialization and should verify that all properties have been populated with values of the correct type. Subclasses should implement this method based on their class structure.

Returns

boolean

Inherited from

Org.validate

Defined in

core/src/org.ts:709


verify

verify(member): Promise<void>

Verifies the members public key, id, role and email address. Throws if verification fails.

Parameters

Name Type
member OrgMember

Returns

Promise<void>

Inherited from

Org.verify

Defined in

core/src/org.ts:577


verifyAll

verifyAll(members?): Promise<void>

Verify all provided members, throws if verification fails for any of them.

Parameters

Name Type
members OrgMember[]

Returns

Promise<void>

Inherited from

Org.verifyAll

Defined in

core/src/org.ts:608